- All Implemented Interfaces:
Serializable
,Comparable<FeatureQuery.ProjectionType>
,Constable
- Enclosing class:
FeatureQuery
Whether a property evaluated by a query is computed on the fly or stored.
By default, an expression is evaluated only once for each feature instance,
then the result is stored as a feature
AbstractAttribute
value.
But the same expression can also be wrapped in a feature AbstractOperation
and evaluated every times that the value is requested.
Analogy with relational databases
The terminology used in this enumeration is close to the one used in relational database. A projection is the set of feature properties to keep in the query results. The projection may contain generated columns, which are specified in SQL bySQL GENERATED ALWAYS
statement, optionally with STORED
or VIRTUAL
modifier.- Since:
- 1.4
-
Nested Class Summary
Nested classes/interfaces inherited from class Enum
Enum.EnumDesc<E extends Enum<E>>
-
Enum Constant Summary
-
Method Summary
Modifier and TypeMethodDescriptionReturns the enum constant of this class with the specified name.static FeatureQuery.ProjectionType[]
values()
Returns an array containing the constants of this enum class, in the order they are declared.Methods inherited from class Enum
clone, compareTo, describeConstable, equals, finalize, getDeclaringClass, hashCode, name, ordinal, toString, valueOf
-
Enum Constant Details
-
STORED
The expression is evaluated exactly once when a feature instance is created, and the result is stored as a feature attribute. The feature property type will beAbstractAttribute
and its value will be modifiable. This is the default projection type.Feature instances in expression evaluation
The features given in calls toExpression.apply(Object)
are instances from the sourceFeatureSet
, before filtering. -
COMPUTING
The expression is evaluated every times that the property value is requested. The feature property type will beAbstractOperation
. This projection type may be preferable toSTORED
in the following circumstances:- The expression may produce different results every times that it is evaluated.
- The feature property should be a link to another attribute.
- Potentially expensive computation should be deferred until first needed.
- Computation result should not be stored in order to reduce memory usage.
Feature instances in expression evaluation
The features given in calls toExpression.apply(Object)
are instances from the targetFeatureSet
, after filtering. The instances from the sourceFeatureSet
are no longer available when the expression is executed. Consequently, all fields that are necessary for computing aCOMPUTING
field shall have been first copied inSTORED
fields.Note on naming: verb tense -ing instead of -ed is for emphasizing that the data used for computation are current (filtered) data instead of past (original) data.- See Also:
-
-
Method Details
-
values
Returns an array containing the constants of this enum class, in the order they are declared.- Returns:
- an array containing the constants of this enum class, in the order they are declared
-
valueOf
Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (Extraneous whitespace characters are not permitted.)- Parameters:
name
- the name of the enum constant to be returned.- Returns:
- the enum constant with the specified name
- Throws:
IllegalArgumentException
- if this enum class has no constant with the specified nameNullPointerException
- if the argument is null
-