Class QueryCapabilities


  • public class QueryCapabilities
    extends Object
    Describes the query capabilities for a specific FeatureType, so client code can request which features are natively supported by a FeatureSource.

    This is the minimal Query capabilities we could come up in order to reliably support paging. Yet, the need for a more complete set of capabilities is well known and a new proposal should be done in order to define the complete set of capabilities a FeatureSource should advertise.

    Since:
    2.5.x
    Author:
    Gabriel Roldan (TOPP)
    • Constructor Detail

      • QueryCapabilities

        public QueryCapabilities()
    • Method Detail

      • isOffsetSupported

        public boolean isOffsetSupported()
        Is offset supported. A value of true implies ability to have a consistent sort order. At least SortBy.NATURAL_ORDER shall be supported, and be the default order if a Query with offset but no SortBy is issued.
      • supportsSorting

        public boolean supportsSorting​(SortBy... sortAttributes)
        Returns whether a list of properties can be used as SortBy keys.

        May include current feature type properties as well as "@id" for sorting on the Feature ID. Note, however, that ability to sort by the fature id does not necessarily implies the same ordering than SortBy.NATURAL_ORDER, though its probable they match for datastores where the feature id is built up from a primary key.

        Returns true if passed a null or empty array, otherwise the actual attributes are checked. When the array is not null and not empty, by default returns false. FeatureSource implementations should override as needed.

        Returns:
        whether the FeatureType this query capabilities refers to can be natively sorted by the provided list of attribtue/order pairs
      • isReliableFIDSupported

        public boolean isReliableFIDSupported()
        Returns whether the feature source is capable of producing "reliable" fids.

        In this content the term "reliable" refers to the ability to read the same feature twice (with no transactions against the feature source in the interim) and get the same feature id back both times.

        Returns:
        True to indicate reliable fids are supported, otherwise false.
      • isUseProvidedFIDSupported

        public boolean isUseProvidedFIDSupported()
        If true the datastore supports using the provided feature id in the data insertion workflow as opposed to generating a new id. In that case it will look into the user data map (Property.getUserData()) for a Hints.USE_PROVIDED_FID key associated to a Boolean.TRUE value, if the key/value pair is there an attempt to use the provided id will be made, and the operation will fail of the key cannot be parsed into a valid storage identifier.
      • isJoiningSupported

        public boolean isJoiningSupported()
        If true the datastore supports joins between feature types within the datastores.
      • isVersionSupported

        public boolean isVersionSupported()
        If true the datastore supports version information and allows version based queries.