|
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. |
Fields inherited from interface oracle.jbo.XMLInterface |
XML_OPT_CHANGES_ONLY,
XML_OPT_LIMIT_RANGE |
Method Summary | |
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 |
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 |
Methods inherited from interface oracle.jbo.XMLInterface |
readXML,
readXML,
writeXML,
writeXML |
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()
An Entity Object is marked valid if it has been validated and not subsequently modified or set invalid.
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)
|
Business Components | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |