The object state APIs provide methods for returning information about entities in the database.
All entities that support pending state have the following attributes:
Name | Type | Description |
---|---|---|
isNew | boolean | Returns true if this entity is new, but has not yet been created in the client database. |
isCreated | boolean | Returns true if this entity has been newly created in the client database, and one of the following is true:
|
isDirty | boolean | Returns true if this entity has been changed in memory, but the change has not yet been saved to the client database. |
isDeleted | boolean | Returns true if this entity was loaded from the database and subsequently deleted. |
isPending | boolean | Checks if the object's pending flag is turned on or not, that is, has pending change or not. Returns true if there is a pending change, returns false if there is no pending change. |
isUpdated | boolean | Returns true if this entity has been updated or changed in the database, and one of the following is true:
|
pending | boolean | Returns true for any row that represents a pending create, update, or delete operation, or a row that has cascading children with a pending operation. |
pendingChange | char | If pending is true, this attribute's value is 'C' (create), 'U' (update), 'D' (delete), or 'P' (to indicate that this MBO is a parent in a cascading relationship for one or more pending child objects, but this MBO itself has no pending create, update or delete operations). If pending is false, this attribute's value is 'N'. |
replayCounter | long | Returns a long value that is updated each time a row is created or modified by the client. This value is a unique value obtained from KeyGenerator.generateID method. Note that the value increases every time it is retrieved. |
replayPending | long | Returns a long value. When a pending row is submitted to the server, the value of replayCounter is copied to replayPending. This allows the client code to detect if a row has been changed since it was submitted to the server (that is, if the value of replayCounter is greater than replayPending). |
replayFailure | long | Returns a long value. When the server responds with a replayFailure message for a row that was submitted to the server, the value of replayCounter is copied to replayFailure, and replayPending is set to 0. |