org.xorm
Class StateManagerImpl

java.lang.Object
  |
  +--org.xorm.ObjectState
        |
        +--org.xorm.StateManagerImpl
All Implemented Interfaces:
StateManager

public final class StateManagerImpl
extends org.xorm.ObjectState
implements StateManager

A single instance of StateManagerImpl tracks the state of a non-interface JDO PersistenceCapable object. The StateManager is not needed for instances of InterfaceInvocationHandler, which don't completely follow the JDO spec at present.


Field Summary
protected  Object proxy
           
protected  byte status
           
static byte STATUS_DELETED
           
static byte STATUS_DIRTY
           
static byte STATUS_HOLLOW
           
static byte STATUS_NEW
           
static byte STATUS_PERSISTENT
           
static byte STATUS_PERSISTENT_CLEAN
           
static byte STATUS_PERSISTENT_DELETED
           
static byte STATUS_PERSISTENT_DIRTY
           
static byte STATUS_PERSISTENT_NEW
           
static byte STATUS_PERSISTENT_NEW_DELETED
           
static byte STATUS_PERSISTENT_NONTRANSACTIONAL
           
static byte STATUS_TRANSACTIONAL
           
static byte STATUS_TRANSIENT
           
static byte STATUS_TRANSIENT_CLEAN
           
static byte STATUS_TRANSIENT_DIRTY
           
 
Method Summary
 boolean getBooleanField(PersistenceCapable pc, int field, boolean currentValue)
           
 byte getByteField(PersistenceCapable pc, int field, byte currentValue)
           
 char getCharField(PersistenceCapable pc, int field, char currentValue)
           
 double getDoubleField(PersistenceCapable pc, int field, double currentValue)
           
 float getFloatField(PersistenceCapable pc, int field, float currentValue)
           
 int getIntField(PersistenceCapable pc, int field, int currentValue)
           
 long getLongField(PersistenceCapable pc, int field, long currentValue)
           
 Object getObjectField(PersistenceCapable pc, int field, Object currentValue)
           
 Object getObjectId(PersistenceCapable pc)
           
 PersistenceManager getPersistenceManager(PersistenceCapable pc)
           
 Object getProxy()
           
 short getShortField(PersistenceCapable pc, int field, short currentValue)
           
 byte getStatus()
           
 String getStatusName()
           
 String getStringField(PersistenceCapable pc, int field, String currentValue)
           
 Object getTransactionalObjectId(PersistenceCapable pc)
           
 boolean isDeleted()
           
 boolean isDeleted(PersistenceCapable pc)
           
 boolean isDirty()
           
 boolean isDirty(PersistenceCapable pc)
           
 boolean isHollow()
           
 boolean isLoaded(PersistenceCapable pc, int field)
           
 boolean isNew()
           
 boolean isNew(PersistenceCapable pc)
           
 boolean isPersistent()
           
 boolean isPersistent(PersistenceCapable pc)
           
 boolean isTransactional()
           
 boolean isTransactional(PersistenceCapable pc)
           
 void makeDirty(PersistenceCapable pc, String fieldName)
           
 void preSerialize(PersistenceCapable pc)
          Ensures all fields are loaded from the datastore.
 void providedBooleanField(PersistenceCapable pc, int field, boolean currentValue)
           
 void providedByteField(PersistenceCapable pc, int field, byte currentValue)
           
 void providedCharField(PersistenceCapable pc, int field, char currentValue)
           
 void providedDoubleField(PersistenceCapable pc, int field, double currentValue)
           
 void providedFloatField(PersistenceCapable pc, int field, float currentValue)
           
 void providedIntField(PersistenceCapable pc, int field, int currentValue)
           
 void providedLongField(PersistenceCapable pc, int field, long currentValue)
           
 void providedObjectField(PersistenceCapable pc, int field, Object currentValue)
           
 void providedShortField(PersistenceCapable pc, int field, short currentValue)
           
 void providedStringField(PersistenceCapable pc, int field, String currentValue)
           
 boolean replacingBooleanField(PersistenceCapable pc, int field)
           
 byte replacingByteField(PersistenceCapable pc, int field)
           
 char replacingCharField(PersistenceCapable pc, int field)
           
 double replacingDoubleField(PersistenceCapable pc, int field)
           
 byte replacingFlags(PersistenceCapable pc)
           
 float replacingFloatField(PersistenceCapable pc, int field)
           
 int replacingIntField(PersistenceCapable pc, int field)
           
 long replacingLongField(PersistenceCapable pc, int field)
           
 Object replacingObjectField(PersistenceCapable pc, int field)
           
 short replacingShortField(PersistenceCapable pc, int field)
           
 StateManager replacingStateManager(PersistenceCapable pc, StateManager sm)
           
 String replacingStringField(PersistenceCapable pc, int field)
           
 void setBooleanField(PersistenceCapable pc, int field, boolean currentValue, boolean newValue)
           
 void setByteField(PersistenceCapable pc, int field, byte currentValue, byte newValue)
           
 void setCharField(PersistenceCapable pc, int field, char currentValue, char newValue)
           
 void setDeleted(boolean value)
           
 void setDirty(boolean value)
           
 void setDoubleField(PersistenceCapable pc, int field, double currentValue, double newValue)
           
 void setFloatField(PersistenceCapable pc, int field, float currentValue, float newValue)
           
 void setHollow(boolean value)
           
 void setIntField(PersistenceCapable pc, int field, int currentValue, int newValue)
           
 void setLongField(PersistenceCapable pc, int field, long currentValue, long newValue)
           
 void setNew(boolean value)
           
 void setObjectField(PersistenceCapable pc, int field, Object currentValue, Object newValue)
           
 void setPersistent(boolean value)
           
 void setProxy(Object proxy)
           
 void setShortField(PersistenceCapable pc, int field, short currentValue, short newValue)
           
 void setStatus(byte status)
           
 void setStringField(PersistenceCapable pc, int field, String currentValue, String newValue)
           
 void setTransactional(boolean value)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

STATUS_TRANSACTIONAL

public static final byte STATUS_TRANSACTIONAL
See Also:
Constant Field Values

STATUS_DIRTY

public static final byte STATUS_DIRTY
See Also:
Constant Field Values

STATUS_PERSISTENT

public static final byte STATUS_PERSISTENT
See Also:
Constant Field Values

STATUS_NEW

public static final byte STATUS_NEW
See Also:
Constant Field Values

STATUS_DELETED

public static final byte STATUS_DELETED
See Also:
Constant Field Values

STATUS_HOLLOW

public static final byte STATUS_HOLLOW
See Also:
Constant Field Values

STATUS_TRANSIENT

public static final byte STATUS_TRANSIENT
See Also:
Constant Field Values

STATUS_TRANSIENT_CLEAN

public static final byte STATUS_TRANSIENT_CLEAN
See Also:
Constant Field Values

STATUS_TRANSIENT_DIRTY

public static final byte STATUS_TRANSIENT_DIRTY
See Also:
Constant Field Values

STATUS_PERSISTENT_NONTRANSACTIONAL

public static final byte STATUS_PERSISTENT_NONTRANSACTIONAL
See Also:
Constant Field Values

STATUS_PERSISTENT_CLEAN

public static final byte STATUS_PERSISTENT_CLEAN
See Also:
Constant Field Values

STATUS_PERSISTENT_DIRTY

public static final byte STATUS_PERSISTENT_DIRTY
See Also:
Constant Field Values

STATUS_PERSISTENT_NEW

public static final byte STATUS_PERSISTENT_NEW
See Also:
Constant Field Values

STATUS_PERSISTENT_DELETED

public static final byte STATUS_PERSISTENT_DELETED
See Also:
Constant Field Values

STATUS_PERSISTENT_NEW_DELETED

public static final byte STATUS_PERSISTENT_NEW_DELETED
See Also:
Constant Field Values

status

protected byte status

proxy

protected Object proxy
Method Detail

replacingFlags

public byte replacingFlags(PersistenceCapable pc)
Specified by:
replacingFlags in interface StateManager

replacingStateManager

public StateManager replacingStateManager(PersistenceCapable pc,
                                          StateManager sm)
Specified by:
replacingStateManager in interface StateManager

isDirty

public boolean isDirty(PersistenceCapable pc)
Specified by:
isDirty in interface StateManager

isTransactional

public boolean isTransactional(PersistenceCapable pc)
Specified by:
isTransactional in interface StateManager

isPersistent

public boolean isPersistent(PersistenceCapable pc)
Specified by:
isPersistent in interface StateManager

isNew

public boolean isNew(PersistenceCapable pc)
Specified by:
isNew in interface StateManager

isDeleted

public boolean isDeleted(PersistenceCapable pc)
Specified by:
isDeleted in interface StateManager

getPersistenceManager

public PersistenceManager getPersistenceManager(PersistenceCapable pc)
Specified by:
getPersistenceManager in interface StateManager

makeDirty

public void makeDirty(PersistenceCapable pc,
                      String fieldName)
Specified by:
makeDirty in interface StateManager

getObjectId

public Object getObjectId(PersistenceCapable pc)
Specified by:
getObjectId in interface StateManager

getTransactionalObjectId

public Object getTransactionalObjectId(PersistenceCapable pc)
Specified by:
getTransactionalObjectId in interface StateManager

isLoaded

public boolean isLoaded(PersistenceCapable pc,
                        int field)
Specified by:
isLoaded in interface StateManager

preSerialize

public void preSerialize(PersistenceCapable pc)
Ensures all fields are loaded from the datastore.

Specified by:
preSerialize in interface StateManager

getBooleanField

public boolean getBooleanField(PersistenceCapable pc,
                               int field,
                               boolean currentValue)
Specified by:
getBooleanField in interface StateManager

getCharField

public char getCharField(PersistenceCapable pc,
                         int field,
                         char currentValue)
Specified by:
getCharField in interface StateManager

getByteField

public byte getByteField(PersistenceCapable pc,
                         int field,
                         byte currentValue)
Specified by:
getByteField in interface StateManager

getShortField

public short getShortField(PersistenceCapable pc,
                           int field,
                           short currentValue)
Specified by:
getShortField in interface StateManager

getIntField

public int getIntField(PersistenceCapable pc,
                       int field,
                       int currentValue)
Specified by:
getIntField in interface StateManager

getLongField

public long getLongField(PersistenceCapable pc,
                         int field,
                         long currentValue)
Specified by:
getLongField in interface StateManager

getFloatField

public float getFloatField(PersistenceCapable pc,
                           int field,
                           float currentValue)
Specified by:
getFloatField in interface StateManager

getDoubleField

public double getDoubleField(PersistenceCapable pc,
                             int field,
                             double currentValue)
Specified by:
getDoubleField in interface StateManager

getStringField

public String getStringField(PersistenceCapable pc,
                             int field,
                             String currentValue)
Specified by:
getStringField in interface StateManager

getObjectField

public Object getObjectField(PersistenceCapable pc,
                             int field,
                             Object currentValue)
Specified by:
getObjectField in interface StateManager

setBooleanField

public void setBooleanField(PersistenceCapable pc,
                            int field,
                            boolean currentValue,
                            boolean newValue)
Specified by:
setBooleanField in interface StateManager

setCharField

public void setCharField(PersistenceCapable pc,
                         int field,
                         char currentValue,
                         char newValue)
Specified by:
setCharField in interface StateManager

setByteField

public void setByteField(PersistenceCapable pc,
                         int field,
                         byte currentValue,
                         byte newValue)
Specified by:
setByteField in interface StateManager

setShortField

public void setShortField(PersistenceCapable pc,
                          int field,
                          short currentValue,
                          short newValue)
Specified by:
setShortField in interface StateManager

setIntField

public void setIntField(PersistenceCapable pc,
                        int field,
                        int currentValue,
                        int newValue)
Specified by:
setIntField in interface StateManager

setLongField

public void setLongField(PersistenceCapable pc,
                         int field,
                         long currentValue,
                         long newValue)
Specified by:
setLongField in interface StateManager

setFloatField

public void setFloatField(PersistenceCapable pc,
                          int field,
                          float currentValue,
                          float newValue)
Specified by:
setFloatField in interface StateManager

setDoubleField

public void setDoubleField(PersistenceCapable pc,
                           int field,
                           double currentValue,
                           double newValue)
Specified by:
setDoubleField in interface StateManager

setStringField

public void setStringField(PersistenceCapable pc,
                           int field,
                           String currentValue,
                           String newValue)
Specified by:
setStringField in interface StateManager

setObjectField

public void setObjectField(PersistenceCapable pc,
                           int field,
                           Object currentValue,
                           Object newValue)
Specified by:
setObjectField in interface StateManager

providedBooleanField

public void providedBooleanField(PersistenceCapable pc,
                                 int field,
                                 boolean currentValue)
Specified by:
providedBooleanField in interface StateManager

providedCharField

public void providedCharField(PersistenceCapable pc,
                              int field,
                              char currentValue)
Specified by:
providedCharField in interface StateManager

providedByteField

public void providedByteField(PersistenceCapable pc,
                              int field,
                              byte currentValue)
Specified by:
providedByteField in interface StateManager

providedShortField

public void providedShortField(PersistenceCapable pc,
                               int field,
                               short currentValue)
Specified by:
providedShortField in interface StateManager

providedIntField

public void providedIntField(PersistenceCapable pc,
                             int field,
                             int currentValue)
Specified by:
providedIntField in interface StateManager

providedLongField

public void providedLongField(PersistenceCapable pc,
                              int field,
                              long currentValue)
Specified by:
providedLongField in interface StateManager

providedFloatField

public void providedFloatField(PersistenceCapable pc,
                               int field,
                               float currentValue)
Specified by:
providedFloatField in interface StateManager

providedDoubleField

public void providedDoubleField(PersistenceCapable pc,
                                int field,
                                double currentValue)
Specified by:
providedDoubleField in interface StateManager

providedStringField

public void providedStringField(PersistenceCapable pc,
                                int field,
                                String currentValue)
Specified by:
providedStringField in interface StateManager

providedObjectField

public void providedObjectField(PersistenceCapable pc,
                                int field,
                                Object currentValue)
Specified by:
providedObjectField in interface StateManager

replacingBooleanField

public boolean replacingBooleanField(PersistenceCapable pc,
                                     int field)
Specified by:
replacingBooleanField in interface StateManager

replacingCharField

public char replacingCharField(PersistenceCapable pc,
                               int field)
Specified by:
replacingCharField in interface StateManager

replacingByteField

public byte replacingByteField(PersistenceCapable pc,
                               int field)
Specified by:
replacingByteField in interface StateManager

replacingShortField

public short replacingShortField(PersistenceCapable pc,
                                 int field)
Specified by:
replacingShortField in interface StateManager

replacingIntField

public int replacingIntField(PersistenceCapable pc,
                             int field)
Specified by:
replacingIntField in interface StateManager

replacingLongField

public long replacingLongField(PersistenceCapable pc,
                               int field)
Specified by:
replacingLongField in interface StateManager

replacingFloatField

public float replacingFloatField(PersistenceCapable pc,
                                 int field)
Specified by:
replacingFloatField in interface StateManager

replacingDoubleField

public double replacingDoubleField(PersistenceCapable pc,
                                   int field)
Specified by:
replacingDoubleField in interface StateManager

replacingStringField

public String replacingStringField(PersistenceCapable pc,
                                   int field)
Specified by:
replacingStringField in interface StateManager

replacingObjectField

public Object replacingObjectField(PersistenceCapable pc,
                                   int field)
Specified by:
replacingObjectField in interface StateManager

getStatusName

public final String getStatusName()

isDirty

public boolean isDirty()

setDirty

public void setDirty(boolean value)

isTransactional

public boolean isTransactional()

setTransactional

public void setTransactional(boolean value)

isPersistent

public boolean isPersistent()

setPersistent

public void setPersistent(boolean value)

isNew

public boolean isNew()

setNew

public void setNew(boolean value)

isDeleted

public boolean isDeleted()

setDeleted

public void setDeleted(boolean value)

isHollow

public boolean isHollow()

setHollow

public void setHollow(boolean value)

setStatus

public void setStatus(byte status)

getStatus

public byte getStatus()

setProxy

public void setProxy(Object proxy)

getProxy

public Object getProxy()


$Header: /cvsroot/xorm/xorm/docs/api/org/xorm/StateManagerImpl.html,v 1.6 2004/05/30 08:55:03 wbiggs Exp $