org.apache.ojb.otm.states
Class State

java.lang.Object
  extended by org.apache.ojb.otm.states.State
All Implemented Interfaces:
Serializable, ObjectModification
Direct Known Subclasses:
Hollow, PersistentClean, PersistentDeleted, PersistentDirty, PersistentNew, PersistentNewDeleted, Transient

public abstract class State
extends Object
implements ObjectModification

Represents the state of object.

See Also:
Serialized Form

Field Summary
static State HOLLOW
           
static State PERSISTENT_CLEAN
           
static State PERSISTENT_DELETED
           
static State PERSISTENT_DIRTY
           
static State PERSISTENT_NEW
           
static State PERSISTENT_NEW_DELETED
           
static State TRANSIENT
           
 
Fields inherited from interface org.apache.ojb.broker.util.ObjectModification
INSERT, serialVersionUID, UPDATE
 
Constructor Summary
State()
           
 
Method Summary
 State commit()
          Describes the state transition on commit()
 State deletePersistent()
          Describes the state transition on deletePersistent()
 State getObject()
          Describes the state transition when object is gotten from the cache or is loaded from database (once per transaction).
 boolean isDeleted()
          returns true is this state means that the object has been deleted
 State makePersistent()
          Describes the state transition on makePersistent()
 State markDirty()
          Describes the state transition when user modifies object
 boolean needsDelete()
          returns true is this state requires DELETE
 boolean needsInsert()
          returns true is this state requires INSERT
 boolean needsUpdate()
          returns true is this state requires UPDATE
 State refresh()
          Describes the state transition on refresh()
 State rollback()
          Describes the state transition on rollback()
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

TRANSIENT

public static final State TRANSIENT

PERSISTENT_CLEAN

public static final State PERSISTENT_CLEAN

PERSISTENT_DIRTY

public static final State PERSISTENT_DIRTY

PERSISTENT_NEW

public static final State PERSISTENT_NEW

PERSISTENT_DELETED

public static final State PERSISTENT_DELETED

PERSISTENT_NEW_DELETED

public static final State PERSISTENT_NEW_DELETED

HOLLOW

public static final State HOLLOW
Constructor Detail

State

public State()
Method Detail

getObject

public State getObject()
                throws IllegalObjectStateException
Describes the state transition when object is gotten from the cache or is loaded from database (once per transaction).

Throws:
IllegalObjectStateException

markDirty

public State markDirty()
                throws IllegalObjectStateException
Describes the state transition when user modifies object

Throws:
IllegalObjectStateException

makePersistent

public State makePersistent()
                     throws IllegalObjectStateException
Describes the state transition on makePersistent()

Throws:
IllegalObjectStateException

deletePersistent

public State deletePersistent()
                       throws IllegalObjectStateException
Describes the state transition on deletePersistent()

Throws:
IllegalObjectStateException

commit

public State commit()
             throws IllegalObjectStateException
Describes the state transition on commit()

Throws:
IllegalObjectStateException

rollback

public State rollback()
               throws IllegalObjectStateException
Describes the state transition on rollback()

Throws:
IllegalObjectStateException

refresh

public State refresh()
              throws IllegalObjectStateException
Describes the state transition on refresh()

Throws:
IllegalObjectStateException

needsInsert

public boolean needsInsert()
returns true is this state requires INSERT

Specified by:
needsInsert in interface ObjectModification

needsUpdate

public boolean needsUpdate()
returns true is this state requires UPDATE

Specified by:
needsUpdate in interface ObjectModification

needsDelete

public boolean needsDelete()
returns true is this state requires DELETE


isDeleted

public boolean isDeleted()
returns true is this state means that the object has been deleted



Copyright © 2004-2012 The Kuali Foundation. All Rights Reserved.