| org.geotools.data.jdbc.JDBCFeatureSource org.geotools.data.jdbc.JDBCFeatureStore
All known Subclasses: org.geotools.data.oracle.OracleFeatureStore, org.geotools.data.postgis.PostgisFeatureStore, org.geotools.data.jdbc.JDBCFeatureLocking, org.geotools.data.db2.DB2FeatureStore,
JDBCFeatureStore | public class JDBCFeatureStore extends JDBCFeatureSource implements FeatureStore(Code) | | This is a starting point for providing your own FeatureStore implementation.
author: Jody Garnett, Refractions Research |
transaction | protected Transaction transaction(Code) | | Current Transaction this FeatureSource is opperating against
|
addFeatures | public Set addFeatures(FeatureReader reader) throws IOException(Code) | | Add Features from reader to this FeatureStore.
Equivelent to:
Set set = new HashSet();
FeatureWriter writer = dataStore.getFeatureWriter( typeName, true, transaction );
Featrue feature, newFeature;
while( reader.hasNext() ){
feature = reader.next();
newFeature = writer.next();
newFeature.setAttributes( feature.getAttribtues( null ) );
writer.write();
set.add( newfeature.getID() );
}
reader.close();
writer.close();
return set;
(If you don't have a FeatureReader handy DataUtilities.reader() may be
able to help out)
Subclasses may override this method to perform the appropriate
optimization for this result.
Parameters: reader - The Set of FeatureIDs added throws: IOException - See Also: org.geotools.data.FeatureStore.addFeatures(org.geotools.data.FeatureReader) |
getInProcessLockingManager | protected InProcessLockingManager getInProcessLockingManager()(Code) | | Used by subclasses to access locking manager.
All our implementations here are rely on
FeatureWriter to check the locks.
When making your own SQL opperations, have a look at
assertFids( Set fids ), and assertFids( Filter ). You
may use these to check against the lockingManager if one is used.
If the lockingManager is not used, ie is null, it assumed that you are
making use of native database locks. Or doing your own thing.
That is the assertFids functions only when lockingManager is non null.
LockingManager |
modifyFeatures | public void modifyFeatures(AttributeType type, Object value, Filter filter) throws IOException(Code) | | Modifies features matching filter .
Equivelent to:
modifyFeatures( new AttributeType[]{ type, }, new Object[]{ value, }, filter );
Subclasses may override this method to perform the appropriate
optimization for this result.
Parameters: type - Attribute to modify Parameters: value - Modification being made to type Parameters: filter - Identifies features to modify throws: IOException - |
modifyFeatures | public void modifyFeatures(AttributeType[] type, Object[] value, Filter filter) throws IOException(Code) | | Modifies features matching filter .
Equivelent to:
FeatureWriter writer = dataStore.getFeatureWriter( typeName, filter, transaction );
Feature feature;
while( writer.hasNext() ){
feature = writer.next();
feature.setAttribute( type[0].getName(), value[0] );
feature.setAttribute( type[1].getName(), value[1] );
...
feature.setAttribute( type[N].getName(), value[N] );
writer.write();
}
writer.close();
Subclasses may override this method to perform the appropriate
optimization for this result.
Parameters: type - Attributes to modify Parameters: value - Modifications being made to type Parameters: filter - Identifies features to modify throws: IOException - |
removeFeatures | public void removeFeatures(Filter filter) throws IOException(Code) | | Removes features indicated by provided filter.
Equivelent to:
FeatureWriter writer = dataStore.getFeatureWriter( typeName, filter, transaction );
Feature feature;
while( writer.hasNext() ){
feature = writer.next();
writer.remove();
}
writer.close();
Subclasses may override this method to perform the appropriate
optimization for this result.
Parameters: filter - Identifies features to remove throws: IOException - |
setFeatures | public void setFeatures(FeatureReader reader) throws IOException(Code) | | Replace with contents of reader.
Equivelent to:
FeatureWriter writer = dataStore.getFeatureWriter( typeName, false, transaction );
Feature feature, newFeature;
while( writer.hasNext() ){
feature = writer.next();
writer.remove();
}
while( reader.hasNext() ){
newFeature = reader.next();
feature = writer.next();
newFeature.setAttributes( feature.getAttributes( null ) );
writer.write();
}
reader.close();
writer.close();
Subclasses may override this method to perform the appropriate
optimization for this result.
Parameters: reader - Contents to replace with throws: IOException - |
|
|