org.jboss.ejb.plugins.cmp.jdbc
Class JDBCIdentityColumnCreateCommand

java.lang.Object
  extended byorg.jboss.ejb.plugins.cmp.jdbc.JDBCAbstractCreateCommand (src) 
      extended byorg.jboss.ejb.plugins.cmp.jdbc.JDBCIdentityColumnCreateCommand
All Implemented Interfaces:
JDBCCreateCommand (src)
Direct Known Subclasses:
JDBC30GeneratedKeysCreateCommand (src) , JDBCDB2IdentityValLocalCreateCommand (src) , JDBCHsqldbCreateCommand (src) , JDBCInformixCreateCommand (src) , JDBCMySQLCreateCommand (src) , JDBCOracleCreateCommand (src) , JDBCOracleSequenceCreateCommand (src) , JDBCPostgreSQLCreateCommand (src) , JDBCSQLServerCreateCommand (src) , JDBCSybaseCreateCommand (src)

public abstract class JDBCIdentityColumnCreateCommand
extends JDBCAbstractCreateCommand (src)

Base class for create commands where the PK value is generated as side effect of performing the insert operation. This is typically associated with database platforms that use identity columns


Field Summary
protected  JDBCCMPFieldBridge (src) pkField
           
protected  java.lang.String pkSQL
           
 
Fields inherited from class org.jboss.ejb.plugins.cmp.jdbc.JDBCAbstractCreateCommand (src)
createAllowed, debug, entity, exceptionProcessor, insertAfterEjbPostCreate, insertFields, insertSQL, log, securityManager, trace
 
Constructor Summary
JDBCIdentityColumnCreateCommand()
           
 
Method Summary
protected  int executeInsert(int paramIndex, java.sql.PreparedStatement ps, EntityEnterpriseContext (src)  ctx)
           
protected  void initGeneratedFields()
           
protected  boolean isInsertField(JDBCFieldBridge (src)  field)
           
protected  java.sql.SQLException processException(java.lang.Throwable t)
          Helper for subclasses that use reflection to avoid driver dependencies.
 
Methods inherited from class org.jboss.ejb.plugins.cmp.jdbc.JDBCAbstractCreateCommand (src)
afterInsert, beforeInsert, checkCreateAllowed, execute, generateFields, getGeneratedPKField, getPrimaryKey, init, initEntityCommand, initInsertFields, initInsertSQL, performInsert, prepareStatement
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

pkField

protected JDBCCMPFieldBridge (src)  pkField

pkSQL

protected java.lang.String pkSQL
Constructor Detail

JDBCIdentityColumnCreateCommand

public JDBCIdentityColumnCreateCommand()
Method Detail

isInsertField

protected boolean isInsertField(JDBCFieldBridge (src)  field)
Overrides:
isInsertField in class JDBCAbstractCreateCommand (src)

initGeneratedFields

protected void initGeneratedFields()
                            throws DeploymentException (src) 
Overrides:
initGeneratedFields in class JDBCAbstractCreateCommand (src)
Throws:
DeploymentException (src)

executeInsert

protected int executeInsert(int paramIndex,
                            java.sql.PreparedStatement ps,
                            EntityEnterpriseContext (src)  ctx)
                     throws java.sql.SQLException
Overrides:
executeInsert in class JDBCAbstractCreateCommand (src)
Throws:
java.sql.SQLException

processException

protected java.sql.SQLException processException(java.lang.Throwable t)
Helper for subclasses that use reflection to avoid driver dependencies.

Parameters:
t - an Exception raised by a reflected call
Returns:
SQLException extracted from the Throwable