Enum Class FeatureQuery.ProjectionType

All Implemented Interfaces:
Serializable, Comparable<Feature­Query​.Projection­Type>, Constable
Enclosing class:
Feature­Query

public static enum FeatureQuery.ProjectionType extends Enum<FeatureQuery.ProjectionType>
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 Abstract­Attribute value. But the same expression can also be wrapped in a feature Abstract­Operation 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 by SQL GENERATED ALWAYS statement, optionally with STORED or VIRTUAL modifier.
Since:
1.4
  • Enum Constant Details

    • STORED

      public static final FeatureQuery.ProjectionType 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 be Abstract­Attribute and its value will be modifiable. This is the default projection type.

      Feature instances in expression evaluation

      The features given in calls to Expression​.apply(Object) are instances from the source Feature­Set, before filtering.
    • COMPUTING

      public static final FeatureQuery.ProjectionType COMPUTING
      The expression is evaluated every times that the property value is requested. The feature property type will be Abstract­Operation. This projection type may be preferable to STORED 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 to Expression​.apply(Object) are instances from the target Feature­Set, after filtering. The instances from the source Feature­Set are no longer available when the expression is executed. Consequently, all fields that are necessary for computing a COMPUTING field shall have been first copied in STORED 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

      public static FeatureQuery.ProjectionType[] 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

      public static FeatureQuery.ProjectionType valueOf(String name)
      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:
      Illegal­Argument­Exception - if this enum class has no constant with the specified name
      Null­Pointer­Exception - if the argument is null