|
|||||||||
| Home >> All >> org >> objectstyle >> [ cayenne overview ] | PREV CLASS NEXT CLASS | ||||||||
SUMMARY: JAVADOC | SOURCE | DOWNLOAD | NESTED | FIELD | CONSTR | METHOD |
DETAIL: FIELD | CONSTR | METHOD | ||||||||
org.objectstyle.cayenne
Class PersistenceState

java.lang.Objectorg.objectstyle.cayenne.PersistenceState
- public class PersistenceState
- extends java.lang.Object
Defines a set of persistence states for DataObjects. PersistenceState describes the state of data stored in a DataObject relative to the external persistence store. If an object's state matches the state of the persistence store, the object is COMMITTED. If object is not intended to be persistent or is not explicitly made persistent, the state is TRANSIENT, and so on.
DataObject persistence states should not be modified directly. Rather it is a responsibility of a DataContext to maintain correct state of the objects that it manages.
| Field Summary | |
static int |
COMMITTED
Describes a state of an object registered with DataContext, whose fields exactly match the state of a corresponding database row. |
static int |
DELETED
Describes a state of an object registered with DataContext, that will be deleted from the database on the next commit. |
static int |
HOLLOW
Describes a state of an object registered with DataContext, and having a corresponding database row. |
static int |
MODIFIED
Describes a state of an object registered with DataContext, and having a corresponding database row. |
static int |
NEW
Describes a state of an object freshly registered with DataContext, but not committed to the database yet. |
static int |
TRANSIENT
Describes a state of an object not registered with DataContext, and therefore having no persistence features. |
| Constructor Summary | |
PersistenceState()
|
|
| Method Summary | |
static java.lang.String |
persistenceStateName(int persistenceState)
Returns String label for persistence state. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
TRANSIENT
public static final int TRANSIENT
- Describes a state of an object not registered with DataContext,
and therefore having no persistence features.
- See Also:
- Constant Field Values
NEW
public static final int NEW
- Describes a state of an object freshly registered with DataContext,
but not committed to the database yet. So there is no corresponding
database record for this object just yet.
- See Also:
- Constant Field Values
COMMITTED
public static final int COMMITTED
- Describes a state of an object registered with DataContext,
whose fields exactly match the state of a corresponding database row.
This state is not fully "clean", since database record
may have been externally modified.
- See Also:
- Constant Field Values
MODIFIED
public static final int MODIFIED
- Describes a state of an object registered with DataContext,
and having a corresponding database row. This object state
is known to be locally modified and different from the database
state.
- See Also:
- Constant Field Values
HOLLOW
public static final int HOLLOW
- Describes a state of an object registered with DataContext,
and having a corresponding database row. This object does not
store any fields except for its id (it is "hollow"), so next
time it is accessed, it will be populated from the database
by the context. In this respect this is a real "clean"
object.
- See Also:
- Constant Field Values
DELETED
public static final int DELETED
- Describes a state of an object registered with DataContext,
that will be deleted from the database on the next commit.
- See Also:
- Constant Field Values
| Constructor Detail |
PersistenceState
public PersistenceState()
| Method Detail |
persistenceStateName
public static java.lang.String persistenceStateName(int persistenceState)
- Returns String label for persistence state.
Used for debugging.
|
|||||||||
| Home >> All >> org >> objectstyle >> [ cayenne overview ] | PREV CLASS NEXT CLASS | ||||||||
SUMMARY: JAVADOC | SOURCE | DOWNLOAD | NESTED | FIELD | CONSTR | METHOD |
DETAIL: FIELD | CONSTR | METHOD | ||||||||
JAVADOC
org.objectstyle.cayenne.PersistenceState