|
Oracle Fusion Middleware Java API Reference for Oracle ADF Model 11g Release 1 (11.1.1.4.0) E10653-05 |
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface Entity
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.XMLInterface |
---|
XML_IGNORE_DEPTH_COUNT, XML_OPT_ALL_ROWS, XML_OPT_ASSOC_CONSISTENT, XML_OPT_CHANGES_ONLY, XML_OPT_LIMIT_RANGE, XML_PASSIVATION_USE |
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 |
---|
getAttributeHints, getAttributeHints, getAttributeSecurityHints, getAttributeSecurityHints, getEffectiveDateMode, getKey, getSecurityHints, getStructureDef, isAttributeUpdateable, isDead, lock, refresh, remove, removeAndRetain, removeFromCollection, setAttributeValues, setEffectiveDateMode, 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 |
---|
static final byte STATUS_UNMODIFIED
static final byte STATUS_MODIFIED
static final byte STATUS_DELETED
static final byte STATUS_DEAD
Method Detail |
---|
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.Key getPrimaryKey()
Typically, this method should not be overridden.
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.byte getEntityState()
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.
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)
void addTransactionPostListener(TransactionPostListener listener)
void addTransactionPostListenerNoCheck(TransactionPostListener listener)
void removeTransactionPostListener(TransactionPostListener listener)
|
Oracle Fusion Middleware Java API Reference for Oracle ADF Model 11g Release 1 (11.1.1.4.0) E10653-05 |
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |