|
Business Components | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
Defines the middle-tier representation of database rows.
An Entity Object provides an object-oriented representation of the data it caches from a database object, such as a table or view. Database rows are presented as individual Entity Objects, in which attributes typically correspond to columns in the corresponding table.
The status of an Entity Object, relative to the corresponding database data, is indicated by its current post-state and entity-state.
States are set to one of STATUS_NEW
, STATUS_MODIFIED
,
STATUS_DELETED
and STATUS_DEAD
by
create, update, delete, and rollback
operations, respectively. These operations can set both the post-state and the
entity-state.
Post-states indicate the state of the Entity Object's data relative to
the transaction's corresponding database data.
The post-state is reset to STATUS_UNMODIFIED
when a
post operation is invoked.
Entity-states indicate the state of the Entity Object's data relative to the
actual database data, and the state of the transaction itself.
The entity-state is reset
to STATUS_UNMODIFIED
by a commit or a rollback operation.
Field Summary | |
static byte |
STATUS_DEAD
Indicates that the Entity Object is a new row that has been discarded. |
static byte |
STATUS_DELETED
Indicates that the Entity Object's row has been deleted. |
static byte |
STATUS_MODIFIED
Indicates that the Entity Object's row is changed. |
static byte |
STATUS_NEW
Indicates that the Entity Object's row is newly created. |
static byte |
STATUS_UNMODIFIED
Indicates that the Entity Object's row is unchanged or has been updated. |
Method Summary | |
byte |
getEntityState()
Gets this Entity Object's current entity-state. |
byte |
getPostState()
Gets this Entity Object's current post-state. |
Key |
getPrimaryKey()
Gets the primay key for this Entity Object's row. |
boolean |
isLocked()
Gets the status of the Entity Object's lock. |
boolean |
isValid()
Gets the state of this Entity Object's validity flag. |
void |
revert()
Reverts this Entity Object's row to the database's values. |
Methods inherited from interface oracle.jbo.Row |
getKey,
isAttributeUpdateable,
lock,
remove,
validate |
Methods inherited from interface oracle.jbo.server.ValidationManager |
addToValidationListeners |
Methods inherited from interface oracle.jbo.server.TransactionManager |
addTransactionPostListener,
addTransactionPostListenerNoCheck,
removeTransactionPostListener |
Methods inherited from interface oracle.jbo.server.TransactionListener |
afterCommit,
afterRemove,
afterRollback,
beforeCommit,
beforeRollback,
isTransientTransactionListener |
Methods inherited from interface oracle.jbo.server.TransactionPostListener |
getTransPostHandle,
isTransientTransactionPostListener,
postChanges,
setTransPostHandle |
Methods inherited from interface oracle.jbo.AttributeList |
getAttribute,
getAttribute,
getAttributeCount,
getAttributeIndexOf,
setAttribute,
setAttribute |
Field Detail |
public static final byte STATUS_NEW
public static final byte STATUS_UNMODIFIED
public static final byte STATUS_MODIFIED
public static final byte STATUS_DELETED
public static final byte STATUS_DEAD
Method Detail |
public boolean isValid()
This predecate does not perform a validity test.
true
if this Entity Object has been validated.public Key getPrimaryKey()
public boolean isLocked()
An Entity Object is locked if its corresponding database row is locked.
true
if this Entity Object is locked.public byte getEntityState()
STATUS_UNMODIFIED
if this Entity Object originated in the database and is unmodified,
or if modifications have been committed to the database.
STATUS_MODIFIED
if this Entity Object originated in the database,
and has been modified in the current transaction.
STATUS_NEW
if this Entity Object is new in the current transaction.
STATUS_DELETED
if this Entity Object has been deleted in the current transaction.
STATUS_DEAD
if this Entity Object is new in the current transaction
and has been deleted.
public byte getPostState()
STATUS_UNMODIFIED
if this Entity Object has been queried from the database and is unchanged,
or if it has been posted to the database.
STATUS_MODIFIED
if this Entity Object has been queried from the database and has changed.
STATUS_NEW
if this Entity Object is new and not yet posted to the database.
STATUS_DELETED
if this Entity Object has been marked for deletion.
STATUS_DEAD
if this Entity Object is new, but has been deleted.
public void revert()
Attribute values are reverted to their database values, or if the row did not originate in the database, reset to default values.
|
Business Components | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |