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

java.lang.Object
  extended byorg.jboss.ejb.plugins.cmp.jdbc.JDBCAbstractCreateCommand
All Implemented Interfaces:
JDBCCreateCommand (src)
Direct Known Subclasses:
JDBCIdentityColumnCreateCommand (src) , JDBCInsertPKCreateCommand (src)

public abstract class JDBCAbstractCreateCommand
extends java.lang.Object
implements JDBCCreateCommand (src)

Base class for create commands that drives the operation sequence.


Field Summary
protected  boolean createAllowed
           
protected  boolean debug
           
protected  JDBCEntityBridge (src) entity
           
protected  SQLExceptionProcessorMBean exceptionProcessor
           
protected  boolean insertAfterEjbPostCreate
           
protected  JDBCFieldBridge (src) [] insertFields
           
protected  java.lang.String insertSQL
           
protected  Logger (src) log
           
protected  AuthenticationManager (src) securityManager
           
protected  boolean trace
           
 
Constructor Summary
JDBCAbstractCreateCommand()
           
 
Method Summary
protected  void afterInsert(EntityEnterpriseContext (src)  ctx)
           
protected  void beforeInsert(EntityEnterpriseContext (src)  ctx)
           
protected  void checkCreateAllowed()
           
 java.lang.Object execute(java.lang.reflect.Method m, java.lang.Object[] args, EntityEnterpriseContext (src)  ctx)
           
protected  int executeInsert(int paramIndex, java.sql.PreparedStatement ps, EntityEnterpriseContext (src)  ctx)
           
protected  void generateFields(EntityEnterpriseContext (src)  ctx)
           
protected  JDBCCMPFieldBridge (src) getGeneratedPKField()
           
protected  java.lang.Object getPrimaryKey(EntityEnterpriseContext (src)  ctx)
           
 void init(JDBCStoreManager (src)  manager)
           
protected  void initEntityCommand(JDBCEntityCommandMetaData (src)  entityCommand)
           
protected  void initGeneratedFields()
           
protected  void initInsertFields()
           
protected  void initInsertSQL()
           
protected  boolean isInsertField(JDBCFieldBridge (src)  field)
           
protected  void performInsert(EntityEnterpriseContext (src)  ctx)
           
protected  java.sql.PreparedStatement prepareStatement(java.sql.Connection c, java.lang.String sql, EntityEnterpriseContext (src)  ctx)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

log

protected Logger (src)  log

debug

protected boolean debug

trace

protected boolean trace

entity

protected JDBCEntityBridge (src)  entity

securityManager

protected AuthenticationManager (src)  securityManager

createAllowed

protected boolean createAllowed

exceptionProcessor

protected SQLExceptionProcessorMBean exceptionProcessor

insertSQL

protected java.lang.String insertSQL

insertFields

protected JDBCFieldBridge (src) [] insertFields

insertAfterEjbPostCreate

protected boolean insertAfterEjbPostCreate
Constructor Detail

JDBCAbstractCreateCommand

public JDBCAbstractCreateCommand()
Method Detail

init

public void init(JDBCStoreManager (src)  manager)
          throws DeploymentException (src) 
Specified by:
init in interface JDBCCreateCommand (src)
Throws:
DeploymentException (src)

initEntityCommand

protected void initEntityCommand(JDBCEntityCommandMetaData (src)  entityCommand)
                          throws DeploymentException (src) 
Throws:
DeploymentException (src)

execute

public java.lang.Object execute(java.lang.reflect.Method m,
                                java.lang.Object[] args,
                                EntityEnterpriseContext (src)  ctx)
                         throws CreateException (src) 
Specified by:
execute in interface JDBCCreateCommand (src)
Throws:
CreateException (src)

checkCreateAllowed

protected void checkCreateAllowed()
                           throws CreateException (src) 
Throws:
CreateException (src)

getGeneratedPKField

protected JDBCCMPFieldBridge (src)  getGeneratedPKField()
                                          throws DeploymentException (src) 
Throws:
DeploymentException (src)

initGeneratedFields

protected void initGeneratedFields()
                            throws DeploymentException (src) 
Throws:
DeploymentException (src)

generateFields

protected void generateFields(EntityEnterpriseContext (src)  ctx)
                       throws CreateException (src) 
Throws:
CreateException (src)

initInsertFields

protected void initInsertFields()

isInsertField

protected boolean isInsertField(JDBCFieldBridge (src)  field)

initInsertSQL

protected void initInsertSQL()

beforeInsert

protected void beforeInsert(EntityEnterpriseContext (src)  ctx)
                     throws CreateException (src) 
Throws:
CreateException (src)

performInsert

protected void performInsert(EntityEnterpriseContext (src)  ctx)
                      throws CreateException (src) 
Throws:
CreateException (src)

prepareStatement

protected java.sql.PreparedStatement prepareStatement(java.sql.Connection c,
                                                      java.lang.String sql,
                                                      EntityEnterpriseContext (src)  ctx)
                                               throws java.sql.SQLException
Throws:
java.sql.SQLException

executeInsert

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

afterInsert

protected void afterInsert(EntityEnterpriseContext (src)  ctx)
                    throws CreateException (src) 
Throws:
CreateException (src)

getPrimaryKey

protected java.lang.Object getPrimaryKey(EntityEnterpriseContext (src)  ctx)