org.apache.openjpa.kernel
Class SaveFieldManager

java.lang.Object
  extended by org.apache.openjpa.kernel.AbstractFieldManager
      extended by org.apache.openjpa.kernel.ClearFieldManager
          extended by org.apache.openjpa.kernel.SaveFieldManager
All Implemented Interfaces:
Serializable, FieldConsumer, FieldManager, FieldSupplier

public class SaveFieldManager
extends ClearFieldManager
implements Serializable

FieldManager type used to store information for rollback.

Author:
Abe White
See Also:
Serialized Form

Constructor Summary
SaveFieldManager(StateManagerImpl sm, PersistenceCapable pc, BitSet dirty)
          Constructor.
 
Method Summary
 Object fetchObjectField(int field)
          Return the value of the given field.
 PersistenceCapable getState()
          Return the persistence capable copy holding the rollback field values.
 BitSet getUnloaded()
          Return the currently-loaded fields that will be unloaded after rollback.
 boolean isFieldEqual(int field, Object current)
          Compare the given field.
 boolean restoreField(int field)
          Restore the given field.
 boolean saveField(int field)
          Save the given field.
 void storeObjectField(int field, Object curVal)
          Set the value of the given field.
 
Methods inherited from class org.apache.openjpa.kernel.ClearFieldManager
fetchBooleanField, fetchByteField, fetchCharField, fetchDoubleField, fetchFloatField, fetchIntField, fetchLongField, fetchShortField, fetchStringField, getInstance
 
Methods inherited from class org.apache.openjpa.kernel.AbstractFieldManager
storeBooleanField, storeByteField, storeCharField, storeDoubleField, storeFloatField, storeIntField, storeLongField, storeShortField, storeStringField
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SaveFieldManager

SaveFieldManager(StateManagerImpl sm,
                 PersistenceCapable pc,
                 BitSet dirty)
Constructor. Provide StateManagerImpl of instance to save.

Method Detail

getState

public PersistenceCapable getState()
Return the persistence capable copy holding the rollback field values.


getUnloaded

public BitSet getUnloaded()
Return the currently-loaded fields that will be unloaded after rollback.


saveField

public boolean saveField(int field)
Save the given field. If this method returns true, then you need to use this field manager to replace the given field in the instance returned by getState().


restoreField

public boolean restoreField(int field)
Restore the given field. If this method returns true, then you need to use this field manager to replace the given field in the state manager's instance.


isFieldEqual

public boolean isFieldEqual(int field,
                            Object current)
Compare the given field.

Returns:
true if the field is the same in the current state and in the saved state; otherwise, false.

fetchObjectField

public Object fetchObjectField(int field)
Description copied from interface: FieldSupplier
Return the value of the given field.

Specified by:
fetchObjectField in interface FieldSupplier
Overrides:
fetchObjectField in class ClearFieldManager

storeObjectField

public void storeObjectField(int field,
                             Object curVal)
Description copied from interface: FieldConsumer
Set the value of the given field.

Specified by:
storeObjectField in interface FieldConsumer
Overrides:
storeObjectField in class AbstractFieldManager


Copyright © 2006-2011 Apache Software Foundation. All Rights Reserved.