org.apache.ojb.otm.states
Class State

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

public abstract class State
extends java.lang.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
serialVersionUID
 
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).
 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 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

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



Authors: Thomas Mahler and others. (C) 2000 - 2003 Apache Software Foundation
All rights reserved. Published under the Apache License.
http://db.apache.org/ojb
Version: 1.0.rc5, 2003-12-14