|
|||||||||||
| PREV CLASS NEXT CLASS | 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.
Revisions:
20021023 Steve Coy:
loadArgumentResults(java.sql.ResultSet, int, java.lang.Object[]) so that it passes the jdbc type to
| Field Summary | |
protected boolean |
checkDirtyAfterGet
|
protected byte |
defaultFlags
|
protected String |
fieldName
|
protected int |
jdbcContextIndex
|
protected org.jboss.logging.Logger |
log
|
protected JDBCStoreManager |
manager
|
protected boolean |
primaryKeyMember
|
protected boolean |
readOnly
|
protected long |
readTimeOut
|
protected CMPFieldStateFactory |
stateFactory
|
protected int |
tableIndex
|
| Constructor Summary | |
JDBCAbstractCMPFieldBridge(JDBCStoreManager manager,
JDBCCMPFieldMetaData metadata)
|
|
JDBCAbstractCMPFieldBridge(JDBCStoreManager manager,
JDBCCMPFieldMetaData metadata,
JDBCType jdbcType)
|
|
JDBCAbstractCMPFieldBridge(JDBCStoreManager manager,
String fieldName,
Class fieldType,
JDBCType jdbcType,
boolean readOnly,
long readTimeOut,
Class primaryKeyClass,
Field primaryKeyField,
int jdbcContextIndex,
int tableIndex,
boolean checkDirtyAfterGet,
CMPFieldStateFactory stateFactory)
|
|
| Method Summary | |
void |
addDefaultFlag(byte flag)
get rid of it later |
byte |
getDefaultFlags()
Returns the default field flags. |
int |
getFieldIndex()
|
String |
getFieldName()
Gets the name of this field. |
Class |
getFieldType()
|
JDBCType |
getJDBCType()
Gets the JDBC type of this field. |
JDBCEntityPersistenceStore |
getManager()
|
Class |
getPrimaryKeyClass()
|
Field |
getPrimaryKeyField()
Gets the field of the primary key object in which the value of this field is stored. |
Object |
getPrimaryKeyValue(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. |
Object |
getValue(EntityEnterpriseContext ctx)
Gets the value of this field for the specified instance context. |
void |
initInstance(EntityEnterpriseContext 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(ResultSet rs,
int parameterIndex,
Object[] argumentRef)
Loads the value of this cmp field from result set into argument referance. |
int |
loadInstanceResults(ResultSet rs,
int parameterIndex,
EntityEnterpriseContext ctx)
Loads the data from result set into the instance associated with the specified context. |
int |
loadPrimaryKeyResults(ResultSet rs,
int parameterIndex,
Object[] pkRef)
Loads the data from result set into the primary key object. |
abstract void |
resetPersistenceContext(EntityEnterpriseContext ctx)
Resets any persistence data maintained in the context. |
int |
setArgumentParameters(PreparedStatement ps,
int parameterIndex,
Object arg)
Sets the prepared statement parameters with the data from the object. |
protected abstract void |
setDirtyAfterGet(EntityEnterpriseContext ctx)
|
int |
setInstanceParameters(PreparedStatement ps,
int parameterIndex,
EntityEnterpriseContext ctx)
Sets the prepared statement parameters with the data from the instance associated with the context. |
void |
setLockingStrategy(LockingStrategy lockingStrategy)
|
int |
setPrimaryKeyParameters(PreparedStatement ps,
int parameterIndex,
Object primaryKey)
Sets the prepared statement parameters with the data from the primary key. |
Object |
setPrimaryKeyValue(Object primaryKey,
Object value)
Sets the value of this field to the specified value in the specified primaryKey object. |
void |
setValue(EntityEnterpriseContext ctx,
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 |
getLockedValue, lockInstanceValue |
| Methods inherited from interface org.jboss.ejb.plugins.cmp.jdbc.bridge.JDBCFieldBridge |
getInstanceValue, isDirty, isLoaded, isReadTimedOut, setClean, setInstanceValue |
| Field Detail |
protected final org.jboss.logging.Logger log
protected final JDBCStoreManager manager
protected final String fieldName
protected final boolean readOnly
protected final long readTimeOut
protected final boolean primaryKeyMember
protected final int jdbcContextIndex
protected final int tableIndex
protected CMPFieldStateFactory stateFactory
protected boolean checkDirtyAfterGet
protected byte defaultFlags
| Constructor Detail |
public JDBCAbstractCMPFieldBridge(JDBCStoreManager manager, JDBCCMPFieldMetaData metadata) throws org.jboss.deployment.DeploymentException
public JDBCAbstractCMPFieldBridge(JDBCStoreManager manager, JDBCCMPFieldMetaData metadata, JDBCType jdbcType) throws org.jboss.deployment.DeploymentException
public JDBCAbstractCMPFieldBridge(JDBCStoreManager manager, String fieldName, Class fieldType, JDBCType jdbcType, boolean readOnly, long readTimeOut, Class primaryKeyClass, Field primaryKeyField, int jdbcContextIndex, int tableIndex, boolean checkDirtyAfterGet, CMPFieldStateFactory stateFactory)
| Method Detail |
public byte getDefaultFlags()
JDBCCMPFieldBridge
getDefaultFlags in interface JDBCCMPFieldBridgepublic void addDefaultFlag(byte flag)
addDefaultFlag in interface JDBCCMPFieldBridgeflag - public JDBCEntityPersistenceStore getManager()
getManager in interface JDBCFieldBridgepublic String getFieldName()
FieldBridge
getFieldName in interface FieldBridgepublic JDBCType getJDBCType()
JDBCFieldBridge
getJDBCType in interface JDBCFieldBridgepublic Class getFieldType()
getFieldType in interface CMPFieldBridgepublic boolean isPrimaryKeyMember()
JDBCFieldBridge
isPrimaryKeyMember in interface JDBCFieldBridgepublic Field getPrimaryKeyField()
JDBCCMPFieldBridge
getPrimaryKeyField in interface JDBCCMPFieldBridgepublic boolean isReadOnly()
JDBCFieldBridge
isReadOnly in interface JDBCFieldBridgepublic long getReadTimeOut()
public Object getValue(EntityEnterpriseContext ctx)
FieldBridge
getValue in interface FieldBridgectx - the context for which this field's value should be fetched
public void setValue(EntityEnterpriseContext ctx, Object value)
FieldBridge
setValue in interface FieldBridgectx - the context for which this field's value should be setvalue - the new value of this fieldpublic Object getPrimaryKeyValue(Object primaryKey) throws IllegalArgumentException
JDBCCMPFieldBridge
getPrimaryKeyValue in interface JDBCCMPFieldBridgeprimaryKey - the primary key object from which this fields value
will be extracted
IllegalArgumentExceptionpublic Object setPrimaryKeyValue(Object primaryKey, Object value) throws IllegalArgumentException
JDBCCMPFieldBridge
setPrimaryKeyValue in interface JDBCCMPFieldBridgeprimaryKey - the primary key object which the value
will be insertedvalue - the value for field that will be set in the pk
IllegalArgumentExceptionpublic abstract void resetPersistenceContext(EntityEnterpriseContext ctx)
JDBCFieldBridge
resetPersistenceContext in interface JDBCFieldBridgepublic void initInstance(EntityEnterpriseContext ctx)
initInstance in interface JDBCFieldBridgepublic int setInstanceParameters(PreparedStatement ps, int parameterIndex, EntityEnterpriseContext ctx)
JDBCFieldBridge
setInstanceParameters in interface JDBCFieldBridgepublic int setPrimaryKeyParameters(PreparedStatement ps, int parameterIndex, Object primaryKey) throws IllegalArgumentException
JDBCCMPFieldBridge
setPrimaryKeyParameters in interface JDBCCMPFieldBridgeIllegalArgumentExceptionpublic int setArgumentParameters(PreparedStatement ps, int parameterIndex, Object arg)
JDBCCMPFieldBridge
setArgumentParameters in interface JDBCCMPFieldBridgepublic int loadInstanceResults(ResultSet rs, int parameterIndex, EntityEnterpriseContext ctx)
JDBCFieldBridge
loadInstanceResults in interface JDBCFieldBridgepublic int loadPrimaryKeyResults(ResultSet rs, int parameterIndex, Object[] pkRef) throws IllegalArgumentException
JDBCCMPFieldBridge
loadPrimaryKeyResults in interface JDBCCMPFieldBridgeIllegalArgumentExceptionpublic int loadArgumentResults(ResultSet rs, int parameterIndex, Object[] argumentRef) throws IllegalArgumentException
JDBCFieldBridge
loadArgumentResults in interface JDBCFieldBridgeIllegalArgumentExceptionpublic boolean isRelationTableField()
isRelationTableField in interface JDBCCMPFieldBridgepublic final int getFieldIndex()
public Class getPrimaryKeyClass()
public int getTableIndex()
JDBCCMPFieldBridge
getTableIndex in interface JDBCCMPFieldBridgepublic void setLockingStrategy(LockingStrategy lockingStrategy)
setLockingStrategy in interface JDBCCMPFieldBridgelockingStrategy - locking strategy assigned to the fieldprotected abstract void setDirtyAfterGet(EntityEnterpriseContext ctx)
public boolean isCMPField()
isCMPField in interface JDBCFieldBridge
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||