org.castor.cpa.persistence.sql.engine
Class SQLStatementUpdate

java.lang.Object
  extended by org.castor.cpa.persistence.sql.engine.SQLStatementUpdate

public final class SQLStatementUpdate
extends java.lang.Object

SQLStatementStore class that makes use of Update class hierarchy to generate sql query structure. It provides parameter binding support to the prepared statement and then executes it.

Version:
$Revision: 8469 $ $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

Constructor Summary
SQLStatementUpdate(SQLEngine engine, PersistenceFactory factory)
          Constructor.
 
Method Summary
 java.lang.Object executeStatement(java.sql.Connection conn, Identity identity, ProposedEntity newentity, ProposedEntity oldentity)
          Stores the identity to the database using JDBC Connection.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SQLStatementUpdate

public SQLStatementUpdate(SQLEngine engine,
                          PersistenceFactory factory)
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.
factory - Persistence factory for the database engine the entity is persisted in. Used to format the SQL statement.
Method Detail

executeStatement

public java.lang.Object executeStatement(java.sql.Connection conn,
                                         Identity identity,
                                         ProposedEntity newentity,
                                         ProposedEntity oldentity)
                                  throws PersistenceException
Stores the identity to the database using JDBC Connection.

Parameters:
conn - An Open JDBC Connection.
identity - Identity of the object to update.
newentity - Entity holding the new values to set with update.
oldentity - Entity holding the old values to check for concurrent modifications.
Returns:
Always returns null.
Throws:
PersistenceException - If failed to update object in database. This could happen if a database access error occurs, type of one of the values to bind is ambiguous, identity or column size mismatch or object to be updated does not exist.


Intalio Inc. (C) 1999-2008. All rights reserved http://www.intalio.com