public abstract class JDBCAbstractCMPFieldBridge extends Object implements JDBCCMPFieldBridge
Revisions:
20021023 Steve Coy:
loadArgumentResults(java.sql.ResultSet, int, java.lang.Object[])
so that it passes the jdbc type to
Modifier and Type | Field and Description |
---|---|
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 and Description |
---|
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) |
Modifier and Type | Method and Description |
---|---|
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(CmpEntityBeanContext ctx)
Gets the value of this field for the specified instance context.
|
void |
initInstance(CmpEntityBeanContext 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 reference.
|
int |
loadInstanceResults(ResultSet rs,
int parameterIndex,
CmpEntityBeanContext 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(CmpEntityBeanContext 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(CmpEntityBeanContext ctx) |
int |
setInstanceParameters(PreparedStatement ps,
int parameterIndex,
CmpEntityBeanContext 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(CmpEntityBeanContext ctx,
Object value)
Sets the value of this field for the specified instance context.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getLockedValue, lockInstanceValue
getInstanceValue, isDirty, isLoaded, isReadTimedOut, setClean, setInstanceValue
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
public JDBCAbstractCMPFieldBridge(JDBCStoreManager manager, JDBCCMPFieldMetaData metadata)
public JDBCAbstractCMPFieldBridge(JDBCStoreManager manager, JDBCCMPFieldMetaData metadata, JDBCType jdbcType)
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)
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(CmpEntityBeanContext ctx)
FieldBridge
getValue
in interface FieldBridge
ctx
- the context for which this field's value should be fetchedpublic void setValue(CmpEntityBeanContext 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 extractedIllegalArgumentException
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 pkIllegalArgumentException
public abstract void resetPersistenceContext(CmpEntityBeanContext ctx)
JDBCFieldBridge
resetPersistenceContext
in interface JDBCFieldBridge
public void initInstance(CmpEntityBeanContext ctx)
initInstance
in interface JDBCFieldBridge
public int setInstanceParameters(PreparedStatement ps, int parameterIndex, CmpEntityBeanContext 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, CmpEntityBeanContext 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(CmpEntityBeanContext ctx)
public boolean isCMPField()
isCMPField
in interface JDBCFieldBridge
Copyright © 2013 JBoss, a division of Red Hat, Inc.. All rights reserved.