org.geotools.data.jdbc
Class JDBCFeatureSource.JDBCQueryCapabilities

java.lang.Object
  extended by org.geotools.data.QueryCapabilities
      extended by org.geotools.data.jdbc.JDBCFeatureSource.JDBCQueryCapabilities
Enclosing class:
JDBCFeatureSource

protected class JDBCFeatureSource.JDBCQueryCapabilities
extends QueryCapabilities

A default QueryCapabilities implementation for JDBCFeatureSource with template methods JDBCFeatureSource subclasses may override.

This default implementation assumes sorting is supported both in ascending and descending order by any FeatureType attribute. Sorting by SortBy.NATURAL_ORDER and SortBy.REVERSE_ORDER, by the other hand, defaults to false, since a datastore may take explicit actions in orther to support those concepts, though most of the time it implies sorting by the primary key for JDBC datastores.

Since:
2.4.3
Version:
$Id: JDBCFeatureSource.java 35735 2010-06-19 15:17:07Z aaime $
Author:
Gabriel Roldan (TOPP)
See Also:
supportsNaturalOrderSorting(), supportsReverseOrderSorting(), supportsPropertySorting(PropertyName, SortOrder)

Constructor Summary
JDBCFeatureSource.JDBCQueryCapabilities(org.opengis.feature.simple.SimpleFeatureType fullFeatureType)
          Creates a new JDBCQueryCapabilities to check for sorting support over the attributes of the provided feature type.
 
Method Summary
protected  boolean isNullFidMapper(FIDMapper mapper)
          Helper method to test if a fid mapper is a null fid mapper.
 boolean isReliableFIDSupported()
          Consults the fid mapper for the feature source, if the null feature map reliable fids not supported.
 boolean isUseProvidedFIDSupported()
          If true the datastore supports using the provided feature id in the data insertion workflow as opposed to generating a new id.
protected  boolean supportsNaturalOrderSorting()
          Indicates whether sorting by SortBy.NATURAL_ORDER is supported; defaults to false.
protected  boolean supportsPropertySorting(org.opengis.filter.expression.PropertyName propertyName, org.opengis.filter.sort.SortOrder sortOrder)
          Template method to check for sorting support in the given sort order for a specific attribute type, given by a PropertyName expression.
protected  boolean supportsReverseOrderSorting()
          Indicates whether sorting by SortBy.REVERSE_ORDER is supported; defaults to false.
 boolean supportsSorting(org.opengis.filter.sort.SortBy[] sortAttributes)
          Overrides to delegate to the three template methods in order to check for sorting capabilities over the natural and reverse order, and each specific attribute type.
 
Methods inherited from class org.geotools.data.QueryCapabilities
isOffsetSupported
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

JDBCFeatureSource.JDBCQueryCapabilities

public JDBCFeatureSource.JDBCQueryCapabilities(org.opengis.feature.simple.SimpleFeatureType fullFeatureType)
Creates a new JDBCQueryCapabilities to check for sorting support over the attributes of the provided feature type.

Parameters:
fullFeatureType - the feature type with all the registered attribtues
Method Detail

supportsSorting

public boolean supportsSorting(org.opengis.filter.sort.SortBy[] sortAttributes)
Overrides to delegate to the three template methods in order to check for sorting capabilities over the natural and reverse order, and each specific attribute type.

Overrides:
supportsSorting in class QueryCapabilities
Returns:
whether the FeatureType this query capabilities refers to can be natively sorted by the provided list of attribtue/order pairs

supportsNaturalOrderSorting

protected boolean supportsNaturalOrderSorting()
Indicates whether sorting by SortBy.NATURAL_ORDER is supported; defaults to false.

Returns:
false, override if NATURAL_ORDER sorting is supported.

supportsReverseOrderSorting

protected boolean supportsReverseOrderSorting()
Indicates whether sorting by SortBy.REVERSE_ORDER is supported; defaults to false.

Returns:
false, override if REVERSE_ORDER sorting is supported.

supportsPropertySorting

protected boolean supportsPropertySorting(org.opengis.filter.expression.PropertyName propertyName,
                                          org.opengis.filter.sort.SortOrder sortOrder)
Template method to check for sorting support in the given sort order for a specific attribute type, given by a PropertyName expression.

This default implementation assumes both orders are supported as long as the property name corresponds to the name of one of the attribute types in the complete FeatureType.

Parameters:
propertyName - the expression holding the property name to check for sortability support
sortOrder - the order, ascending or descending, to check for sortability support over the given property name.
Returns:
true if propertyName refers to one of the FeatureType attributes

isReliableFIDSupported

public boolean isReliableFIDSupported()
Consults the fid mapper for the feature source, if the null feature map reliable fids not supported.

Overrides:
isReliableFIDSupported in class QueryCapabilities
Returns:
True to indicate reliable fids are supported, otherwise false.

isNullFidMapper

protected boolean isNullFidMapper(FIDMapper mapper)
Helper method to test if a fid mapper is a null fid mapper.


isUseProvidedFIDSupported

public boolean isUseProvidedFIDSupported()
Description copied from class: QueryCapabilities
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.

Overrides:
isUseProvidedFIDSupported in class QueryCapabilities
Returns:


Copyright © 1996-2010 Geotools. All Rights Reserved.