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

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

public final class SQLStatementInsertCheck
extends java.lang.Object

SQLStatementInsertCheck class to check duplicate primary key problem. If that would be the case then DuplicateIdentityException will be raised.


Constructor Summary
SQLStatementInsertCheck(SQLEngine engine, PersistenceFactory factory)
          Constructor.
 
Method Summary
 void insertDuplicateKeyCheck(java.sql.Connection conn, Identity identity)
          Performs check for Duplicate primary key.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SQLStatementInsertCheck

public SQLStatementInsertCheck(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

insertDuplicateKeyCheck

public void insertDuplicateKeyCheck(java.sql.Connection conn,
                                    Identity identity)
                             throws PersistenceException
Performs check for Duplicate primary key.

Parameters:
conn - An open JDBC connection.
identity - Identity of the object to insert.
Throws:
PersistenceException - If a database access error occurs, identity size mismatches.


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