deegree 2.3 (2010/04/09 10:10 build-4-official)

org.deegree.io.datastore
Interface DatastoreTransaction

All Known Implementing Classes:
GenericSQLTransaction, SDETransaction, SQLTransaction

public interface DatastoreTransaction

Handler for TransactionOperations (Insert, Update, Delete, Native). One instance is bound to exactly one Datastore instance (and one Datastore has no more than one active DatastoreTransaction at a time.

Version:
$Revision: 18544 $, $Date: 2009-07-20 16:14:38 +0200 (Mo, 20. Jul 2009) $
Author:
Anup Deshmukh, Markus Schneider, last edited by: $Author: mschneider $

Method Summary
 void commit()
          Makes the changes persistent that have been performed in this transaction.
 Datastore getDatastore()
          Returns the associated Datastore instance.
 int performDelete(MappedFeatureType mappedFeatureType, Filter filter, String lockId)
          Deletes the features from the datastore that are matched by the given filter and type.
 List<FeatureId> performInsert(List<Feature> features)
          Inserts the given feature instances into the datastore.
 int performNative(Native operation)
          Performs a native operation against the datastore.
 int performUpdate(MappedFeatureType mappedFeatureType, Feature replacementFeature, Filter filter, String lockId)
          Performs a replace-update operation against the datastore.
 int performUpdate(MappedFeatureType mappedFeatureType, Map<PropertyPath,FeatureProperty> replacementProps, Filter filter, String lockId)
          Performs an update operation against the datastore.
 void release()
          Releases the transaction instance so other clients may acquire a transaction (and underlying resources, such as JDBCConnections can be cleaned up).
 void rollback()
          Aborts the changes that have been performed in this transaction.
 

Method Detail

getDatastore

Datastore getDatastore()
Returns the associated Datastore instance.

Returns:
the associated Datastore instance

commit

void commit()
            throws DatastoreException
Makes the changes persistent that have been performed in this transaction.

Throws:
DatastoreException

rollback

void rollback()
              throws DatastoreException
Aborts the changes that have been performed in this transaction.

Throws:
DatastoreException

release

void release()
             throws DatastoreException
Releases the transaction instance so other clients may acquire a transaction (and underlying resources, such as JDBCConnections can be cleaned up).

Throws:
DatastoreException

performInsert

List<FeatureId> performInsert(List<Feature> features)
                              throws DatastoreException
Inserts the given feature instances into the datastore.

Please note that the features to be inserted must have suitable feature ids at this point.

Parameters:
features -
Returns:
feature ids of the inserted (root) features
Throws:
DatastoreException
See Also:
FeatureIdAssigner

performUpdate

int performUpdate(MappedFeatureType mappedFeatureType,
                  Map<PropertyPath,FeatureProperty> replacementProps,
                  Filter filter,
                  String lockId)
                  throws DatastoreException
Performs an update operation against the datastore.

Parameters:
mappedFeatureType - feature type that is to be updated
replacementProps - properties and their replacement values
filter - selects the feature instances that are to be updated
lockId - optional id of associated lock (may be null)
Returns:
number of updated feature instances
Throws:
DatastoreException

performUpdate

int performUpdate(MappedFeatureType mappedFeatureType,
                  Feature replacementFeature,
                  Filter filter,
                  String lockId)
                  throws DatastoreException
Performs a replace-update operation against the datastore.

Parameters:
mappedFeatureType - feature type that is to be replaced
replacementFeature - feature instance that will be used to replace the properties of the selected features
filter - selects the feature instances that are to be replaced
lockId - optional id of associated lock (may be null)
Returns:
number of replaced feature instances
Throws:
DatastoreException

performDelete

int performDelete(MappedFeatureType mappedFeatureType,
                  Filter filter,
                  String lockId)
                  throws DatastoreException
Deletes the features from the datastore that are matched by the given filter and type.

Parameters:
mappedFeatureType -
filter -
lockId - optional id of associated lock (may be null)
Returns:
number of deleted feature instances
Throws:
DatastoreException

performNative

int performNative(Native operation)
                  throws DatastoreException
Performs a native operation against the datastore.

Parameters:
operation - operation to perform
Returns:
int
Throws:
DatastoreException

deegree 2.3 (2010/04/09 10:10 build-4-official)

an open source project founded by lat/lon, Bonn, Germany.
For more information visit: http://www.deegree.org