Class SQLStatementUpdateCheck

java.lang.Object
org.castor.cpa.persistence.sql.engine.SQLStatementUpdateCheck

public final class SQLStatementUpdateCheck extends Object
SQLStatementUpdatCheck class to check whether the new SQL update statement has failed because entity has been removed previously from persistent storage or the object has been modified before. If the object has been modified an ObjectModifiedException and if object has been deleted an ObjectDeletedException is raised.
Version:
$Revision: 8285 $ $Date: 2006-04-25 15:08:23 -0600 (Tue, 25 Apr 2006) $
Author:
Assaf Arkin, Thomas Yip, Bruce Snyder, Werner Guttmann, Ralf Joachim, Ahmad Hassan, Dennis Butterstein
  • Constructor Details

    • SQLStatementUpdateCheck

      public SQLStatementUpdateCheck(SQLEngine engine)
      Constructor.
      Parameters:
      engine - SQL engine for all persistence operations at entities of the type this class is responsible for. Holds all required information of the entity type.
  • Method Details

    • updateFailureCheck

      public void updateFailureCheck(CastorConnection conn, Identity identity) throws PersistenceException
      This function checks whether the object specified in the statement has been previously removed from the persistent storage or has been modified. If the object has been modified an ObjectModifiedException and if object has been deleted an ObjectDeletedException is raised.
      Parameters:
      conn - CastorConnection holding connection and PersistenceFactory to be used to create statement.
      identity - Identity of the object to check for availability.
      Throws:
      PersistenceException - If a database access error occurs, identity size mismatches, column length mismatches, ObjectDeletedException if object had been deleted or ObjectModifiedException if object had been modified before.