org.jboss.ejb.plugins.cmp.jdbc.bridge
Class JDBCCMP1xFieldBridge

java.lang.Object
  extended byorg.jboss.ejb.plugins.cmp.jdbc.bridge.JDBCAbstractCMPFieldBridge (src) 
      extended byorg.jboss.ejb.plugins.cmp.jdbc.bridge.JDBCCMP1xFieldBridge
All Implemented Interfaces:
CMPFieldBridge (src) , FieldBridge (src) , JDBCCMPFieldBridge (src) , JDBCFieldBridge (src)

public class JDBCCMP1xFieldBridge
extends JDBCAbstractCMPFieldBridge (src)

JDBCCMP1xFieldBridge is a concrete implementation of JDBCCMPFieldBridge for CMP version 1.x. Getting and setting of instance fields set the corresponding field in bean instance. Dirty checking is performed by storing the current value in the entity persistence context when ever setClean is called, and comparing current value to the original value. Life-cycle: Tied to the EntityBridge. Multiplicity: One for each entity bean cmp field.


Field Summary
 
Fields inherited from class org.jboss.ejb.plugins.cmp.jdbc.bridge.JDBCAbstractCMPFieldBridge (src)
checkDirtyAfterGet, defaultFlags, fieldName, jdbcContextIndex, log, manager, primaryKeyMember, readOnly, readTimeOut, stateFactory, tableIndex
 
Constructor Summary
JDBCCMP1xFieldBridge(JDBCStoreManager (src)  manager, JDBCCMPFieldMetaData (src)  metadata)
           
 
Method Summary
 java.lang.Object getInstanceValue(EntityEnterpriseContext (src)  ctx)
          Gets the internal value of this field without user level checks.
 java.lang.Object getLockedValue(EntityEnterpriseContext (src)  ctx)
           
 boolean isDirty(EntityEnterpriseContext (src)  ctx)
          Has the value of this field changes since the last time clean was called.
 boolean isLoaded(EntityEnterpriseContext (src)  ctx)
          Has the data been loaded?
 boolean isReadTimedOut(EntityEnterpriseContext (src)  ctx)
          Has current data read timed out?
 void lockInstanceValue(EntityEnterpriseContext (src)  ctx)
          Optimistically locks field value.
 void resetPersistenceContext(EntityEnterpriseContext (src)  ctx)
          Resets any persistence data maintained in the context.
 void setClean(EntityEnterpriseContext (src)  ctx)
          Mark this field as clean.
protected  void setDirtyAfterGet(EntityEnterpriseContext (src)  ctx)
           
 void setInstanceValue(EntityEnterpriseContext (src)  ctx, java.lang.Object value)
          Sets the internal value of this field without user level checks.
 
Methods inherited from class org.jboss.ejb.plugins.cmp.jdbc.bridge.JDBCAbstractCMPFieldBridge (src)
addDefaultFlag, getDefaultFlags, getFieldIndex, getFieldName, getFieldType, getJDBCType, getManager, getPrimaryKeyClass, getPrimaryKeyField, getPrimaryKeyValue, getReadTimeOut, getTableIndex, getValue, initInstance, isCMPField, isPrimaryKeyMember, isReadOnly, isRelationTableField, loadArgumentResults, loadInstanceResults, loadPrimaryKeyResults, setArgumentParameters, setInstanceParameters, setLockingStrategy, setPrimaryKeyParameters, setPrimaryKeyValue, setValue
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

JDBCCMP1xFieldBridge

public JDBCCMP1xFieldBridge(JDBCStoreManager (src)  manager,
                            JDBCCMPFieldMetaData (src)  metadata)
                     throws DeploymentException (src) 
Method Detail

getInstanceValue

public java.lang.Object getInstanceValue(EntityEnterpriseContext (src)  ctx)
Description copied from interface: JDBCFieldBridge (src)
Gets the internal value of this field without user level checks.

Parameters:
ctx - the context for which this field's value should be fetched
Returns:
the value of this field

setInstanceValue

public void setInstanceValue(EntityEnterpriseContext (src)  ctx,
                             java.lang.Object value)
Description copied from interface: JDBCFieldBridge (src)
Sets the internal value of this field without user level checks.

Parameters:
ctx - the context for which this field's value should be set
value - the new value of this field

getLockedValue

public java.lang.Object getLockedValue(EntityEnterpriseContext (src)  ctx)
Parameters:
ctx - instance's context
Returns:
field value that was locked.

lockInstanceValue

public void lockInstanceValue(EntityEnterpriseContext (src)  ctx)
Description copied from interface: JDBCCMPFieldBridge (src)
Optimistically locks field value.


isLoaded

public boolean isLoaded(EntityEnterpriseContext (src)  ctx)
Description copied from interface: JDBCFieldBridge (src)
Has the data been loaded?


isDirty

public boolean isDirty(EntityEnterpriseContext (src)  ctx)
Has the value of this field changes since the last time clean was called.


setClean

public void setClean(EntityEnterpriseContext (src)  ctx)
Mark this field as clean. Saves the current state in context, so it can be compared when isDirty is called.


isReadTimedOut

public boolean isReadTimedOut(EntityEnterpriseContext (src)  ctx)
Description copied from interface: JDBCFieldBridge (src)
Has current data read timed out?


resetPersistenceContext

public void resetPersistenceContext(EntityEnterpriseContext (src)  ctx)
Description copied from interface: JDBCFieldBridge (src)
Resets any persistence data maintained in the context.

Specified by:
resetPersistenceContext in interface JDBCFieldBridge (src)
Specified by:
resetPersistenceContext in class JDBCAbstractCMPFieldBridge (src)

setDirtyAfterGet

protected void setDirtyAfterGet(EntityEnterpriseContext (src)  ctx)
Specified by:
setDirtyAfterGet in class JDBCAbstractCMPFieldBridge (src)