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

org.deegree.io.datastore.sql.transaction.delete
Class DeleteHandler

java.lang.Object
  extended by org.deegree.io.datastore.sql.AbstractRequestHandler
      extended by org.deegree.io.datastore.sql.transaction.delete.DeleteHandler

public class DeleteHandler
extends AbstractRequestHandler

Handler for Delete operations (which usually occur as parts of Transaction requests).

When a Delete operation is performed, the following actions are taken:

Version:
$Revision: 18195 $, $Date: 2009-06-18 17:55:39 +0200 (Do, 18. Jun 2009) $
Author:
Markus Schneider, last edited by: $Author: mschneider $
See Also:
FeatureGraph, TableGraph

Field Summary
 
Fields inherited from class org.deegree.io.datastore.sql.AbstractRequestHandler
aliasGenerator, conn, datastore, FT_COLUMN, FT_PREFIX
 
Constructor Summary
DeleteHandler(SQLTransaction dsTa, TableAliasGenerator aliasGenerator, Connection conn, String lockId)
          Creates a new DeleteHandler from the given parameters.
 
Method Summary
 void deleteOrphanedPropertyRows(TableRelation relation, Object[] keyValues)
          Delete orphaned rows in the specified property table (target table of the given TableRelation).
(package private)  TableNode determineJTNode(FeatureId fid, FeatureId subFid, TableRelation relation1, TableRelation relation2)
          Determines the row in the join table that connects a certain feature with a subfeature.
(package private)  List<TableNode> determinePropNodes(FeatureId fid, TableRelation relation)
          Determines the TableNode that represent the simple/geometry properties in the property table attached by the given TableRelation.
 int performDelete(MappedFeatureType ft, Filter filter)
          Deletes the features from the Datastore that have a certain type and are matched by the given filter.
 
Methods inherited from class org.deegree.io.datastore.sql.AbstractRequestHandler
appendColumnsList, appendFeatureIdColumns, appendFeatureIdConstraint, appendFeatureIdConstraint, appendJoinCondition, appendJoins, appendQualifiedColumn, appendQualifiedColumnsList, determineAffectedAndModifiableFIDs, determineAffectedFIDs, determineSubFeatures, determineSuperFeatures, extractFeatureId, extractFeatureIds, extractFeatureIdsForceUnique
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DeleteHandler

public DeleteHandler(SQLTransaction dsTa,
                     TableAliasGenerator aliasGenerator,
                     Connection conn,
                     String lockId)
Creates a new DeleteHandler from the given parameters.

Parameters:
dsTa -
aliasGenerator -
conn -
lockId - optional id of associated lock (may be null)
Method Detail

performDelete

public int performDelete(MappedFeatureType ft,
                         Filter filter)
                  throws DatastoreException
Deletes the features from the Datastore that have a certain type and are matched by the given filter.

Parameters:
ft - non-abstract feature type of the features to be deleted
filter - constraints the feature instances to be deleted
Returns:
number of deleted feature instances
Throws:
DatastoreException

determinePropNodes

List<TableNode> determinePropNodes(FeatureId fid,
                                   TableRelation relation)
                             throws DatastoreException
Determines the TableNode that represent the simple/geometry properties in the property table attached by the given TableRelation.

Parameters:
fid - id of the feature that owns the properties
relation - describes how the property table is joined to the feature table
Returns:
the simple/geometry properties in the the related property table
Throws:
DatastoreException

determineJTNode

TableNode determineJTNode(FeatureId fid,
                          FeatureId subFid,
                          TableRelation relation1,
                          TableRelation relation2)
                    throws DatastoreException
Determines the row in the join table that connects a certain feature with a subfeature.

Parameters:
fid - id of the (super-) feature
subFid - id of the subfeature
relation1 - describes how the join table is attached
relation2 - describes how the subfeature table is joined
Returns:
join table row (as a TableNode)
Throws:
DatastoreException

deleteOrphanedPropertyRows

public void deleteOrphanedPropertyRows(TableRelation relation,
                                       Object[] keyValues)
                                throws DatastoreException
Delete orphaned rows in the specified property table (target table of the given TableRelation).

Only used by the UpdateHandler.

Parameters:
relation -
keyValues -
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