|
Oracle9i Business Components for Java API Reference Oracle9i Jdeveloper (9.0.4) B10391-01 | ||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
This interface is for BC4J Entity Objects. Entity Object is responsible for managing data (attribute) values, updates to them, and interacting with the persistence service, e.g., RDBMS.
An Entity Object provides an object-oriented representation of the data it caches from a persistence service (most commonly, RDBMS). For RDBMS, each database row is presented as individual Entity Object, in which attributes typically correspond to columns in the database table.
An Entity Object goes through different states based on client's actions. An Entity Object keeps two states: post-state and entity-state.
States are set to one of STATUS_INITIALIZED
, STATUS_NEW
, STATUS_UNMODIFIED
, STATUS_MODIFIED
, STATUS_DELETED
, or STATUS_DEAD
by various row manipulation operations, e.g., create, update, delete, and rollback. These operations can change the post-state and the entity-state.
The post-state indicates the state of the Entity Object relative to the last data posted row in the database. The entity-state indicates the state of the Entity Object relative to the transaction itself. See STATUS_...
constants for further discussions.
An Entity Object is owned by its container. A Entity Object container may be the Transaction
object or the master Entity Object. The latter is the case if this Entity Object is a child (detail) Entity in a composition association. In this case, the master Entity Object owns this Entity Object, and the master Entity Object is said to be the container. The Entity Object container plays the role of a TransactionManager
and ValidationManager
for its children (containees).
When an Entity Object attribute values are modified, the container is notified. The container registers the modified Entity Object in its transaction-post-listener list and validation-listener list. The transaction-post-listener list is a list of objects that need to be posted to the underlying persistence service. The validation-listener list is a list of objects that need to be validated before they are written (posted) to the persistence service.
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_UNMODIFIED Indicates that the Entity Object's row is unchanged or has been updated. |
Fields inherited from interface oracle.jbo.Row |
REFRESH_CONTAINEES, REFRESH_REMOVE_NEW_ROWS, REFRESH_UNDO_CHANGES, REFRESH_WITH_DB_FORGET_CHANGES, REFRESH_WITH_DB_ONLY_IF_UNCHANGED, STATUS_INITIALIZED, STATUS_NEW |
Fields inherited from interface oracle.jbo.XMLInterface |
XML_IGNORE_DEPTH_COUNT, XML_OPT_ALL_ROWS, XML_OPT_ASSOC_CONSISTENT, XML_OPT_CHANGES_ONLY, XML_OPT_LIMIT_RANGE |
Method Summary | |
void |
addTransactionPostListener(TransactionPostListener listener) |
void |
addTransactionPostListenerNoCheck(TransactionPostListener listener) |
byte |
getEntityState() Gets this Entity Object's current entity-state. |
byte |
getPostState() Gets this Entity Object's current post-state. |
Key |
getPrimaryKey() Returns the primay key for this Entity Object's row. |
boolean |
isLocked() Gets the status of the Entity Object's lock. |
boolean |
isValid() Returns the state of this Entity Object's validity flag. |
void |
removeTransactionPostListener(TransactionPostListener listener) |
void |
revert() Reverts this Entity Object's row to the database's values. |
Methods inherited from interface oracle.jbo.Row |
getKey, getStructureDef, isAttributeUpdateable, lock, refresh, remove, removeFromCollection, setNewRowState, validate |
Methods inherited from interface oracle.jbo.AttributeList |
getAttribute, getAttribute, getAttributeCount, getAttributeIndexOf, getAttributeNames, getAttributeValues, setAttribute, setAttribute |
Methods inherited from interface oracle.jbo.XMLInterface |
readXML, readXML, writeXML, writeXML, writeXML, writeXML |
Methods inherited from interface oracle.jbo.server.ValidationListener |
validate |
Methods inherited from interface oracle.jbo.server.ValidationManager |
addToValidationListeners, validate |
Methods inherited from interface oracle.jbo.server.TransactionListener |
afterCommit, afterRemove, afterRollback, beforeCommit, beforeRollback, isTransientTransactionListener |
Methods inherited from interface oracle.jbo.server.TransactionPostListener |
getTransPostHandle, isPostedToDB, isTransientTransactionPostListener, postChanges, setPostedToDB, setTransPostHandle |
Field Detail |
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()
An Entity Object is marked valid if it has been validated and not subsequently modified or set invalid.
isValid
in interface ValidationListener
true
if this Entity Object has been validated.public Key getPrimaryKey()
Typically, this method should not be overridden.
public boolean isLocked()
An Entity Object is locked if its corresponding database row is locked. This method should not be overridden.
true
if this Entity Object is locked.public byte getEntityState()
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()
Calling this method will either reset the attribute values to their database values or revert them to their default values. If the Entity Object is posted, all the attributes revert to the to unread state, so that a subsequent EntityImpl.getAttribute(int index)
call will refresh all attributes from the database.
EntityImpl.getAttribute(int index)
public void addTransactionPostListener(TransactionPostListener listener)
public void addTransactionPostListenerNoCheck(TransactionPostListener listener)
public void removeTransactionPostListener(TransactionPostListener listener)
|
Oracle9i Business Components for Java API Reference Oracle9i Jdeveloper (9.0.4) B10391-01 | ||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
Copyright © 1997, 2003, Oracle. All rights reserved.