|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.geotools.data.store.ContentFeatureSource
org.geotools.jdbc.JDBCFeatureSource
public class JDBCFeatureSource
Field Summary |
---|
Fields inherited from class org.geotools.data.store.ContentFeatureSource |
---|
entry, hints, query, queryCapabilities, schema, transaction |
Constructor Summary | |
---|---|
JDBCFeatureSource(ContentEntry entry,
Query query)
Creates the new feature store. |
Method Summary | |
---|---|
protected void |
addHints(java.util.Set<Hints.Key> hints)
Subclass hook too add additional hints. |
protected org.opengis.feature.simple.SimpleFeatureType |
buildFeatureType()
Builds the feature type from database metadata. |
protected QueryCapabilities |
buildQueryCapabilities()
Builds the query capabilities for this feature source. |
protected boolean |
canFilter()
Determines if the datastore can natively perform a filtering. |
protected boolean |
canLimit()
Determines if the datastore can natively limit the number of features returned in a query. |
protected boolean |
canOffset()
Determines if the datastore can natively skip the first offset number of features
returned in a query. |
protected boolean |
canRetype()
Determines if the datasatore can natively perform "retyping" which includes limiting the number of attributes returned and reordering of those attributes |
protected boolean |
canSort()
Determines if the datastore can natively perform sorting. |
protected ReferencedEnvelope |
getBoundsInternal(Query query)
Calculates the bounds of a specified query. |
protected int |
getCountInternal(Query query)
Calculates the number of features of a specified query. |
JDBCDataStore |
getDataStore()
Type narrow to JDBCDataStore . |
PrimaryKey |
getPrimaryKey()
Returns the primary key of the table backed by feature store. |
protected FeatureReader<org.opengis.feature.simple.SimpleFeatureType,org.opengis.feature.simple.SimpleFeature> |
getReaderInternal(Query query)
Subclass method for returning a native reader from the datastore. |
JDBCState |
getState()
Type narrow to JDBCState . |
protected boolean |
handleVisitor(Query query,
org.opengis.feature.FeatureVisitor visitor)
Subclass method which allows subclasses to natively handle a visitor. |
boolean |
isExposePrimaryKeyColumns()
The flag which will expose columns which compose a tables identifying or primary key, through feature type attributes. |
void |
setExposePrimaryKeyColumns(boolean exposePrimaryKeyColumns)
Sets the flag which will expose columns which compose a tables identifying or primary key, through feature type attributes. |
Methods inherited from class org.geotools.data.store.ContentFeatureSource |
---|
accepts, addFeatureListener, canReproject, getAbsoluteSchema, getBounds, getBounds, getCount, getEntry, getFeatures, getFeatures, getFeatures, getInfo, getName, getQueryCapabilities, getReader, getReader, getReader, getSchema, getSupportedHints, getTransaction, getView, getView, isView, joinQuery, removeFeatureListener, resolvePropertyNames, resolvePropertyNames, setTransaction |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public JDBCFeatureSource(ContentEntry entry, Query query) throws java.io.IOException
entry
- The datastore entry.query
- The defining query.
java.io.IOException
Method Detail |
---|
protected QueryCapabilities buildQueryCapabilities()
ContentFeatureSource
buildQueryCapabilities
in class ContentFeatureSource
protected void addHints(java.util.Set<Hints.Key> hints)
ContentFeatureSource
By default, the followings are already present:
addHints
in class ContentFeatureSource
hints
- The set of hints supported by the feature source.public JDBCDataStore getDataStore()
JDBCDataStore
.
getDataStore
in interface FeatureSource<org.opengis.feature.simple.SimpleFeatureType,org.opengis.feature.simple.SimpleFeature>
getDataStore
in class ContentFeatureSource
public JDBCState getState()
JDBCState
.
getState
in class ContentFeatureSource
#setTransaction(Transaction)}.
public PrimaryKey getPrimaryKey()
public void setExposePrimaryKeyColumns(boolean exposePrimaryKeyColumns)
Note: setting this flag which affect all feature sources created from or working against the current transaction.
public boolean isExposePrimaryKeyColumns()
protected org.opengis.feature.simple.SimpleFeatureType buildFeatureType() throws java.io.IOException
buildFeatureType
in class ContentFeatureSource
java.io.IOException
protected int getCountInternal(Query query) throws java.io.IOException
ContentFeatureSource
getCountInternal
in class ContentFeatureSource
java.io.IOException
protected ReferencedEnvelope getBoundsInternal(Query query) throws java.io.IOException
ContentFeatureSource
getBoundsInternal
in class ContentFeatureSource
java.io.IOException
protected boolean canFilter()
ContentFeatureSource
If the subclass can handle filtering natively it should override this method
to return true
. In this case it must do the filtering
or throw an exception. This includes the case of partial native filtering
where the datastore can only handle part of the filter natively. In these
cases it is up to the subclass to apply a decorator to the reader it returns
which will handle any part of the filter can was not applied natively. See
FilteringFeatureReader
.
Not overriding this method or returning false
will cause the
feature reader created by the subclass to be wrapped in a filtering feature
reader when the query specifies a filter. See FilteringFeatureReader
.
canFilter
in class ContentFeatureSource
protected boolean canSort()
ContentFeatureSource
If the subclass can handle retyping natively it should override this method
to return true
. In this case it must do the retyping
or throw an exception.
Not overriding this method or returning false
will cause an
exception to be thrown when the query specifies sorting.
canSort
in class ContentFeatureSource
protected boolean canRetype()
ContentFeatureSource
If the subclass can handle retyping natively it should override this method
to return true
. In this case it must do the retyping
or throw an exception.
Not overriding this method or returning false
will cause the
feature reader created by the subclass to be wrapped in a retyping feature
reader when the query specifies a retype.
canRetype
in class ContentFeatureSource
protected boolean canLimit()
ContentFeatureSource
If the subclass can handle a map feature cap natively then it should override
this method to return true
. In this case it must do
the cap or throw an exception.
Not overriding this method or returning false
will case the
feature reader created by the subclass to be wrapped in a max feature capping
decorator when the query specifies a max feature cap.
canLimit
in class ContentFeatureSource
MaxFeatureReader
protected boolean canOffset()
ContentFeatureSource
offset
number of features
returned in a query.
If the subclass can handle a map feature cap natively then it should override
this method to return true
. In this case it must do
the cap or throw an exception.
Not overriding this method or returning false
will case the
feature reader created by the subclass to be be accesset offset times before
being returned to the caller.
canOffset
in class ContentFeatureSource
protected FeatureReader<org.opengis.feature.simple.SimpleFeatureType,org.opengis.feature.simple.SimpleFeature> getReaderInternal(Query query) throws java.io.IOException
ContentFeatureSource
It is important to note that if the native reader intends to handle any of the following natively:
true
:
ContentFeatureSource.canReproject()
ContentFeatureSource.canFilter()
ContentFeatureSource.canLimit()
ContentFeatureSource.canSort()
getReaderInternal
in class ContentFeatureSource
java.io.IOException
protected boolean handleVisitor(Query query, org.opengis.feature.FeatureVisitor visitor) throws java.io.IOException
ContentFeatureSource
Subclasses would override this method and return true in cases where the specific visitor could be handled without iterating over the entire result set of query. An example would be handling visitors that calculate aggregate values.
handleVisitor
in class ContentFeatureSource
query
- The query being made.visitor
- The visitor to
java.io.IOException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |