|
||||||||||
PREV CLASS (src) NEXT CLASS (src) | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.jboss.ejb.plugins.cmp.jdbc.bridge.JDBCAbstractCMPFieldBridge
JDBCAbstractCMPFieldBridge is the default implementation of JDBCCMPFieldBridge. Most of the heavy lifting of this command is handled by JDBCUtil. It is left to subclasses to implement the logic for getting and setting instance values and dirty checking, as this is dependent on the CMP version used. Life-cycle: Tied to the EntityBridge. Multiplicity: One for each entity bean cmp field.
Field Summary | |
protected boolean |
checkDirtyAfterGet
|
protected byte |
defaultFlags
|
protected java.lang.String |
fieldName
|
protected int |
jdbcContextIndex
|
protected Logger (src) |
log
|
protected JDBCStoreManager (src) |
manager
|
protected boolean |
primaryKeyMember
|
protected boolean |
readOnly
|
protected long |
readTimeOut
|
protected CMPFieldStateFactory (src) |
stateFactory
|
protected int |
tableIndex
|
Constructor Summary | |
JDBCAbstractCMPFieldBridge(JDBCStoreManager (src) manager,
JDBCCMPFieldMetaData (src) metadata)
|
|
JDBCAbstractCMPFieldBridge(JDBCStoreManager (src) manager,
JDBCCMPFieldMetaData (src) metadata,
JDBCType (src) jdbcType)
|
|
JDBCAbstractCMPFieldBridge(JDBCStoreManager (src) manager,
java.lang.String fieldName,
java.lang.Class fieldType,
JDBCType (src) jdbcType,
boolean readOnly,
long readTimeOut,
java.lang.Class primaryKeyClass,
java.lang.reflect.Field primaryKeyField,
int jdbcContextIndex,
int tableIndex,
boolean checkDirtyAfterGet,
CMPFieldStateFactory (src) stateFactory)
|
Method Summary | |
void |
addDefaultFlag(byte flag)
get rid of it later |
byte |
getDefaultFlags()
Returns the default field flags. |
int |
getFieldIndex()
|
java.lang.String |
getFieldName()
Gets the name of this field. |
java.lang.Class |
getFieldType()
|
JDBCType (src) |
getJDBCType()
Gets the JDBC type of this field. |
JDBCEntityPersistenceStore (src) |
getManager()
|
java.lang.Class |
getPrimaryKeyClass()
|
java.lang.reflect.Field |
getPrimaryKeyField()
Gets the field of the primary key object in which the value of this field is stored. |
java.lang.Object |
getPrimaryKeyValue(java.lang.Object primaryKey)
Gets the value of this field in the specified primaryKey object. |
long |
getReadTimeOut()
|
int |
getTableIndex()
The index of the field among the table fields. |
java.lang.Object |
getValue(EntityEnterpriseContext (src) ctx)
Gets the value of this field for the specified instance context. |
void |
initInstance(EntityEnterpriseContext (src) ctx)
Set CMPFieldValue to Java default value (i.e., 0 or null). |
boolean |
isCMPField()
|
boolean |
isPrimaryKeyMember()
Is this field a member of the primary key. |
boolean |
isReadOnly()
Is this field read only. |
boolean |
isRelationTableField()
|
int |
loadArgumentResults(java.sql.ResultSet rs,
int parameterIndex,
java.lang.Object[] argumentRef)
Loads the value of this cmp field from result set into argument referance. |
int |
loadInstanceResults(java.sql.ResultSet rs,
int parameterIndex,
EntityEnterpriseContext (src) ctx)
Loads the data from result set into the instance associated with the specified context. |
int |
loadPrimaryKeyResults(java.sql.ResultSet rs,
int parameterIndex,
java.lang.Object[] pkRef)
Loads the data from result set into the primary key object. |
abstract void |
resetPersistenceContext(EntityEnterpriseContext (src) ctx)
Resets any persistence data maintained in the context. |
int |
setArgumentParameters(java.sql.PreparedStatement ps,
int parameterIndex,
java.lang.Object arg)
Sets the prepared statement parameters with the data from the object. |
protected abstract void |
setDirtyAfterGet(EntityEnterpriseContext (src) ctx)
|
int |
setInstanceParameters(java.sql.PreparedStatement ps,
int parameterIndex,
EntityEnterpriseContext (src) ctx)
Sets the prepared statement parameters with the data from the instance associated with the context. |
void |
setLockingStrategy(LockingStrategy (src) lockingStrategy)
|
int |
setPrimaryKeyParameters(java.sql.PreparedStatement ps,
int parameterIndex,
java.lang.Object primaryKey)
Sets the prepared statement parameters with the data from the primary key. |
java.lang.Object |
setPrimaryKeyValue(java.lang.Object primaryKey,
java.lang.Object value)
Sets the value of this field to the specified value in the specified primaryKey object. |
void |
setValue(EntityEnterpriseContext (src) ctx,
java.lang.Object value)
Sets the value of this field for the specified instance context. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface org.jboss.ejb.plugins.cmp.jdbc.bridge.JDBCCMPFieldBridge (src) |
getLockedValue, lockInstanceValue |
Methods inherited from interface org.jboss.ejb.plugins.cmp.jdbc.bridge.JDBCFieldBridge (src) |
getInstanceValue, isDirty, isLoaded, isReadTimedOut, setClean, setInstanceValue |
Field Detail |
protected final Logger (src) log
protected final JDBCStoreManager (src) manager
protected final java.lang.String fieldName
protected final boolean readOnly
protected final long readTimeOut
protected final boolean primaryKeyMember
protected final int jdbcContextIndex
protected final int tableIndex
protected CMPFieldStateFactory (src) stateFactory
protected boolean checkDirtyAfterGet
protected byte defaultFlags
Constructor Detail |
public JDBCAbstractCMPFieldBridge(JDBCStoreManager (src) manager, JDBCCMPFieldMetaData (src) metadata) throws DeploymentException (src)
public JDBCAbstractCMPFieldBridge(JDBCStoreManager (src) manager, JDBCCMPFieldMetaData (src) metadata, JDBCType (src) jdbcType) throws DeploymentException (src)
public JDBCAbstractCMPFieldBridge(JDBCStoreManager (src) manager, java.lang.String fieldName, java.lang.Class fieldType, JDBCType (src) jdbcType, boolean readOnly, long readTimeOut, java.lang.Class primaryKeyClass, java.lang.reflect.Field primaryKeyField, int jdbcContextIndex, int tableIndex, boolean checkDirtyAfterGet, CMPFieldStateFactory (src) stateFactory)
Method Detail |
public byte getDefaultFlags()
JDBCCMPFieldBridge (src)
getDefaultFlags
in interface JDBCCMPFieldBridge (src)
public void addDefaultFlag(byte flag)
addDefaultFlag
in interface JDBCCMPFieldBridge (src)
flag
- public JDBCEntityPersistenceStore (src) getManager()
getManager
in interface JDBCFieldBridge (src)
public java.lang.String getFieldName()
FieldBridge (src)
getFieldName
in interface FieldBridge (src)
public JDBCType (src) getJDBCType()
JDBCFieldBridge (src)
getJDBCType
in interface JDBCFieldBridge (src)
public java.lang.Class getFieldType()
getFieldType
in interface CMPFieldBridge (src)
public boolean isPrimaryKeyMember()
JDBCFieldBridge (src)
isPrimaryKeyMember
in interface JDBCFieldBridge (src)
public java.lang.reflect.Field getPrimaryKeyField()
JDBCCMPFieldBridge (src)
getPrimaryKeyField
in interface JDBCCMPFieldBridge (src)
public boolean isReadOnly()
JDBCFieldBridge (src)
isReadOnly
in interface JDBCFieldBridge (src)
public long getReadTimeOut()
public java.lang.Object getValue(EntityEnterpriseContext (src) ctx)
FieldBridge (src)
getValue
in interface FieldBridge (src)
ctx
- the context for which this field's value should be fetched
public void setValue(EntityEnterpriseContext (src) ctx, java.lang.Object value)
FieldBridge (src)
setValue
in interface FieldBridge (src)
ctx
- the context for which this field's value should be setvalue
- the new value of this fieldpublic java.lang.Object getPrimaryKeyValue(java.lang.Object primaryKey) throws java.lang.IllegalArgumentException
JDBCCMPFieldBridge (src)
getPrimaryKeyValue
in interface JDBCCMPFieldBridge (src)
primaryKey
- the primary key object from which this fields value
will be extracted
java.lang.IllegalArgumentException
public java.lang.Object setPrimaryKeyValue(java.lang.Object primaryKey, java.lang.Object value) throws java.lang.IllegalArgumentException
JDBCCMPFieldBridge (src)
setPrimaryKeyValue
in interface JDBCCMPFieldBridge (src)
primaryKey
- the primary key object which the value
will be insertedvalue
- the value for field that will be set in the pk
java.lang.IllegalArgumentException
public abstract void resetPersistenceContext(EntityEnterpriseContext (src) ctx)
JDBCFieldBridge (src)
resetPersistenceContext
in interface JDBCFieldBridge (src)
public void initInstance(EntityEnterpriseContext (src) ctx)
initInstance
in interface JDBCFieldBridge (src)
public int setInstanceParameters(java.sql.PreparedStatement ps, int parameterIndex, EntityEnterpriseContext (src) ctx)
JDBCFieldBridge (src)
setInstanceParameters
in interface JDBCFieldBridge (src)
public int setPrimaryKeyParameters(java.sql.PreparedStatement ps, int parameterIndex, java.lang.Object primaryKey) throws java.lang.IllegalArgumentException
JDBCCMPFieldBridge (src)
setPrimaryKeyParameters
in interface JDBCCMPFieldBridge (src)
java.lang.IllegalArgumentException
public int setArgumentParameters(java.sql.PreparedStatement ps, int parameterIndex, java.lang.Object arg)
JDBCCMPFieldBridge (src)
setArgumentParameters
in interface JDBCCMPFieldBridge (src)
public int loadInstanceResults(java.sql.ResultSet rs, int parameterIndex, EntityEnterpriseContext (src) ctx)
JDBCFieldBridge (src)
loadInstanceResults
in interface JDBCFieldBridge (src)
public int loadPrimaryKeyResults(java.sql.ResultSet rs, int parameterIndex, java.lang.Object[] pkRef) throws java.lang.IllegalArgumentException
JDBCCMPFieldBridge (src)
loadPrimaryKeyResults
in interface JDBCCMPFieldBridge (src)
java.lang.IllegalArgumentException
public int loadArgumentResults(java.sql.ResultSet rs, int parameterIndex, java.lang.Object[] argumentRef) throws java.lang.IllegalArgumentException
JDBCFieldBridge (src)
loadArgumentResults
in interface JDBCFieldBridge (src)
java.lang.IllegalArgumentException
public boolean isRelationTableField()
isRelationTableField
in interface JDBCCMPFieldBridge (src)
public final int getFieldIndex()
public java.lang.Class getPrimaryKeyClass()
public int getTableIndex()
JDBCCMPFieldBridge (src)
getTableIndex
in interface JDBCCMPFieldBridge (src)
public void setLockingStrategy(LockingStrategy (src) lockingStrategy)
setLockingStrategy
in interface JDBCCMPFieldBridge (src)
lockingStrategy
- locking strategy assigned to the fieldprotected abstract void setDirtyAfterGet(EntityEnterpriseContext (src) ctx)
public boolean isCMPField()
isCMPField
in interface JDBCFieldBridge (src)
|
||||||||||
PREV CLASS (src) NEXT CLASS (src) | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |