Class FeatureQuery.NamedExpression
Object
NamedExpression
- All Implemented Interfaces:
Serializable
- Enclosing class:
FeatureQuery
An expression to be retrieved by a
Query, together with the name to assign to it.
NamedExpression specifies also if the expression should be evaluated exactly once
and its value stored, or evaluated every times that the value is requested.
Analogy with relational databases
ANamedExpression instance can be understood as the definition of a column in a SQL database table.
In relational database terminology, subset of columns is called projection.
A projection is specified by a SQL SELECT statement, which maps to NamedExpression as below:
SELECT expression AS alias
FeatureQuery.setProjection(NamedExpression[]) method.- Since:
- 1.1
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionfinal GenericNameDeprecated.final Expression<? super AbstractFeature, ?> Deprecated.Replaced byexpression()in preparation for makingNamedExpressiona record.Deprecated.Replaced bytype()in preparation for makingNamedExpressiona record. -
Constructor Summary
ConstructorsConstructorDescriptionNamedExpression(Expression<? super AbstractFeature, ?> expression) Creates a new stored column with the given expression and no name.NamedExpression(Expression<? super AbstractFeature, ?> expression, String alias) Creates a new stored column with the given expression and the given name.NamedExpression(Expression<? super AbstractFeature, ?> expression, GenericName alias) Creates a new stored column with the given expression and the given name.NamedExpression(Expression<? super AbstractFeature, ?> expression, GenericName alias, FeatureQuery.ProjectionType type) Creates a new column with the given expression, the given name and the given projection type. -
Method Summary
Modifier and TypeMethodDescriptionalias()The name to assign to the expression result, ornullif unspecified.booleanCompares this column with the given object for equality.Expression<? super AbstractFeature, ?> The literal, value reference or more complex expression to be retrieved by aQuery.intReturns a hash code value for this column.Returns a string representation of this column for debugging purpose.type()Whether the expression result should be stored or evaluated every times that it is requested.
-
Field Details
-
expression
Deprecated.Replaced byexpression()in preparation for makingNamedExpressiona record.The literal, value reference or more complex expression to be retrieved by aQuery. Nevernull. -
alias
Deprecated.Replaced byalias()in preparation for makingNamedExpressiona record.The name to assign to the expression result, ornullif unspecified. -
type
Deprecated.Replaced bytype()in preparation for makingNamedExpressiona record.Whether the expression result should be stored or evaluated every times that it is requested. A stored value will exist as a featureAbstractAttribute, while a virtual value will exist as a feature. The latter are commonly called "computed fields" and are equivalent to SQLinvalid reference
AbstractOperationGENERATED ALWAYSkeyword for columns.- Since:
- 1.4
-
-
Constructor Details
-
NamedExpression
Creates a new stored column with the given expression and no name.- Parameters:
expression- the literal, value reference or expression to be retrieved by aQuery.
-
NamedExpression
Creates a new stored column with the given expression and the given name.- Parameters:
expression- the literal, value reference or expression to be retrieved by aQuery.alias- the name to assign to the expression result, ornullif unspecified.
-
NamedExpression
Creates a new stored column with the given expression and the given name. This constructor creates aLocalNamefrom the given string.- Parameters:
expression- the literal, value reference or expression to be retrieved by aQuery.alias- the name to assign to the expression result, ornullif unspecified.
-
NamedExpression
public NamedExpression(Expression<? super AbstractFeature, ?> expression, GenericName alias, FeatureQuery.ProjectionType type) Creates a new column with the given expression, the given name and the given projection type.- Parameters:
expression- the literal, value reference or expression to be retrieved by aQuery.alias- the name to assign to the expression result, ornullif unspecified.type- whether to create a featureAbstractAttributeor a feature.invalid reference
AbstractOperation- Since:
- 1.4
-
-
Method Details
-
expression
The literal, value reference or more complex expression to be retrieved by aQuery. Nevernull.- Since:
- 1.5
-
alias
The name to assign to the expression result, ornullif unspecified.- Since:
- 1.5
-
type
Whether the expression result should be stored or evaluated every times that it is requested. A stored value will exist as a feature, while a virtual value will exist as a featureinvalid reference
Attribute. The latter are commonly called "computed fields" and are equivalent to SQLinvalid reference
OperationGENERATED ALWAYSkeyword for columns.- Since:
- 1.5
-
hashCode
-
equals
-
toString
-
alias()in preparation for makingNamedExpressiona record.