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 GenericName
Deprecated.final Expression
<? super AbstractFeature, ?> Deprecated.Replaced byexpression()
in preparation for makingNamedExpression
a record.Deprecated.Replaced bytype()
in preparation for makingNamedExpression
a 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, ornull
if unspecified.boolean
Compares this column with the given object for equality.Expression
<? super AbstractFeature, ?> The literal, value reference or more complex expression to be retrieved by aQuery
.int
Returns 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 makingNamedExpression
a record.The literal, value reference or more complex expression to be retrieved by aQuery
. Nevernull
. -
alias
Deprecated.Replaced byalias()
in preparation for makingNamedExpression
a record.The name to assign to the expression result, ornull
if unspecified. -
type
Deprecated.Replaced bytype()
in preparation for makingNamedExpression
a 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 featureinvalid reference
AbstractOperation
GENERATED ALWAYS
keyword 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, ornull
if unspecified.
-
NamedExpression
Creates a new stored column with the given expression and the given name. This constructor creates aLocalName
from 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, ornull
if 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, ornull
if unspecified.type
- whether to create a featureAbstractAttribute
or a featureinvalid 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, ornull
if 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 featureinvalid reference
Attribute
invalid reference
Operation
GENERATED ALWAYS
keyword for columns.- Since:
- 1.5
-
hashCode
-
equals
-
toString
-
alias()
in preparation for makingNamedExpression
a record.