|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.jboss.ejb.plugins.cmp.jdbc.bridge.JDBCAbstractCMPFieldBridge
public abstract class 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
org.jboss.deployment.DeploymentException
public JDBCAbstractCMPFieldBridge(JDBCStoreManager manager, JDBCCMPFieldMetaData metadata, JDBCType jdbcType) throws org.jboss.deployment.DeploymentException
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 JDBCCMPFieldBridge
public void addDefaultFlag(byte flag)
addDefaultFlag
in interface JDBCCMPFieldBridge
public JDBCEntityPersistenceStore getManager()
getManager
in interface JDBCFieldBridge
public String getFieldName()
FieldBridge
getFieldName
in interface FieldBridge
public JDBCType getJDBCType()
JDBCFieldBridge
getJDBCType
in interface JDBCFieldBridge
public Class getFieldType()
getFieldType
in interface CMPFieldBridge
public boolean isPrimaryKeyMember()
JDBCFieldBridge
isPrimaryKeyMember
in interface JDBCFieldBridge
public Field getPrimaryKeyField()
JDBCCMPFieldBridge
getPrimaryKeyField
in interface JDBCCMPFieldBridge
public boolean isReadOnly()
JDBCFieldBridge
isReadOnly
in interface JDBCFieldBridge
public long getReadTimeOut()
public Object getValue(EntityEnterpriseContext ctx)
FieldBridge
getValue
in interface FieldBridge
ctx
- the context for which this field's value should be fetched
public void setValue(EntityEnterpriseContext ctx, Object value)
FieldBridge
setValue
in interface FieldBridge
ctx
- 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 JDBCCMPFieldBridge
getPrimaryKeyValue
in interface JDBCFieldBridge
primaryKey
- the primary key object from which this fields value
will be extracted
IllegalArgumentException
public Object setPrimaryKeyValue(Object primaryKey, Object value) throws IllegalArgumentException
JDBCCMPFieldBridge
setPrimaryKeyValue
in interface JDBCCMPFieldBridge
primaryKey
- the primary key object which the value
will be insertedvalue
- the value for field that will be set in the pk
IllegalArgumentException
public abstract void resetPersistenceContext(EntityEnterpriseContext ctx)
JDBCFieldBridge
resetPersistenceContext
in interface JDBCFieldBridge
public void initInstance(EntityEnterpriseContext ctx)
initInstance
in interface JDBCFieldBridge
public int setInstanceParameters(PreparedStatement ps, int parameterIndex, EntityEnterpriseContext ctx)
JDBCFieldBridge
setInstanceParameters
in interface JDBCFieldBridge
public int setPrimaryKeyParameters(PreparedStatement ps, int parameterIndex, Object primaryKey) throws IllegalArgumentException
JDBCCMPFieldBridge
setPrimaryKeyParameters
in interface JDBCCMPFieldBridge
IllegalArgumentException
public int setArgumentParameters(PreparedStatement ps, int parameterIndex, Object arg)
JDBCCMPFieldBridge
setArgumentParameters
in interface JDBCCMPFieldBridge
public int loadInstanceResults(ResultSet rs, int parameterIndex, EntityEnterpriseContext ctx)
JDBCFieldBridge
loadInstanceResults
in interface JDBCFieldBridge
public int loadPrimaryKeyResults(ResultSet rs, int parameterIndex, Object[] pkRef) throws IllegalArgumentException
JDBCCMPFieldBridge
loadPrimaryKeyResults
in interface JDBCCMPFieldBridge
IllegalArgumentException
public int loadArgumentResults(ResultSet rs, int parameterIndex, Object[] argumentRef) throws IllegalArgumentException
JDBCFieldBridge
loadArgumentResults
in interface JDBCFieldBridge
IllegalArgumentException
public boolean isRelationTableField()
isRelationTableField
in interface JDBCCMPFieldBridge
public final int getFieldIndex()
public Class getPrimaryKeyClass()
public int getTableIndex()
JDBCCMPFieldBridge
getTableIndex
in interface JDBCCMPFieldBridge
public void setLockingStrategy(LockingStrategy lockingStrategy)
setLockingStrategy
in interface JDBCCMPFieldBridge
lockingStrategy
- 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 |