org.deegree.feature.persistence.sql
Class SQLFeatureStoreTransaction

java.lang.Object
  extended by org.deegree.feature.persistence.sql.SQLFeatureStoreTransaction
All Implemented Interfaces:
FeatureStoreTransaction

public class SQLFeatureStoreTransaction
extends Object
implements FeatureStoreTransaction

FeatureStoreTransaction implementation for SQLFeatureStore.

Version:
$Revision: 32157 $, $Date: 2011-10-18 21:25:57 +0200 (Tue, 18 Oct 2011) $
Author:
Markus Schneider, Andreas Schmitz, last edited by: $Author: mschneider $

Method Summary
 void commit()
          Makes the changes persistent that have been performed in this transaction and releases the transaction instance so other clients may acquire a transaction on the FeatureStore.
 Connection getConnection()
          Returns the underlying JDBC connection.
 FeatureStore getStore()
          Returns the underlying FeatureStore instance.
 int performDelete(IdFilter filter, Lock lock)
          Deletes the features from the FeatureStore that are matched by the given filter.
 int performDelete(QName ftName, OperatorFilter filter, Lock lock)
          Deletes the features from the FeatureStore that are matched by the given filter and type.
 List<String> performInsert(FeatureCollection fc, IDGenMode mode)
          Inserts the given FeatureCollection into the FeatureStore (including subfeatures).
 int performUpdate(QName ftName, List<Property> replacementProps, Filter filter, Lock lock)
          Performs an update operation against the FeatureStore.
 void rollback()
          Aborts the changes that have been performed in this transaction and releases the transaction instance so other clients may acquire a transaction on the FeatureStore.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

commit

public void commit()
            throws FeatureStoreException
Description copied from interface: FeatureStoreTransaction
Makes the changes persistent that have been performed in this transaction and releases the transaction instance so other clients may acquire a transaction on the FeatureStore.

Specified by:
commit in interface FeatureStoreTransaction
Throws:
FeatureStoreException - if the committing fails

getStore

public FeatureStore getStore()
Description copied from interface: FeatureStoreTransaction
Returns the underlying FeatureStore instance.

Specified by:
getStore in interface FeatureStoreTransaction
Returns:
the underlying FeatureStore instance, never null

getConnection

public Connection getConnection()
Returns the underlying JDBC connection. Can be used for performing other operations in the same transaction context.

Returns:
the underlying JDBC connection, never null

performDelete

public int performDelete(QName ftName,
                         OperatorFilter filter,
                         Lock lock)
                  throws FeatureStoreException
Description copied from interface: FeatureStoreTransaction
Deletes the features from the FeatureStore that are matched by the given filter and type.

Specified by:
performDelete in interface FeatureStoreTransaction
Parameters:
ftName - feature type of the features to be deleted, must not be null
filter - filter that determines the features to be deleted, must not be null
lock - optional lock object, may be null
Returns:
number of deleted feature instances
Throws:
FeatureStoreException - if the deletion fails

performDelete

public int performDelete(IdFilter filter,
                         Lock lock)
                  throws FeatureStoreException
Description copied from interface: FeatureStoreTransaction
Deletes the features from the FeatureStore that are matched by the given filter.

Specified by:
performDelete in interface FeatureStoreTransaction
Parameters:
filter - filter that determines the features to be deleted, must not be null
lock - optional lock object, may be null
Returns:
number of deleted feature instances
Throws:
FeatureStoreException - if the deletion fails (*not* if a specified id does not exist)

performInsert

public List<String> performInsert(FeatureCollection fc,
                                  IDGenMode mode)
                           throws FeatureStoreException
Description copied from interface: FeatureStoreTransaction
Inserts the given FeatureCollection into the FeatureStore (including subfeatures).

Specified by:
performInsert in interface FeatureStoreTransaction
Parameters:
fc - features to be inserted, must not be null
mode - mode for deriving the ids of the inserted objects, must not be null
Returns:
effective ids of the inserted feature and subfeatures (in document order)
Throws:
FeatureStoreException - if the insertion fails

performUpdate

public int performUpdate(QName ftName,
                         List<Property> replacementProps,
                         Filter filter,
                         Lock lock)
                  throws FeatureStoreException
Description copied from interface: FeatureStoreTransaction
Performs an update operation against the FeatureStore.

Specified by:
performUpdate in interface FeatureStoreTransaction
Parameters:
ftName - feature type of the features to be updated, must not be null
replacementProps - properties and their replacement values, must not be null
filter - selects the feature instances that are to be updated, must not be null
lock - optional lock object, may be null
Returns:
number of updated feature instances
Throws:
FeatureStoreException - if the update fails

rollback

public void rollback()
              throws FeatureStoreException
Description copied from interface: FeatureStoreTransaction
Aborts the changes that have been performed in this transaction and releases the transaction instance so other clients may acquire a transaction on the FeatureStore.

Specified by:
rollback in interface FeatureStoreTransaction
Throws:
FeatureStoreException - if the rollback fails


Copyright © 2011. All Rights Reserved.