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 | bool | Returns true if this entity is new, but has not yet been created in the client database. |
IsCreated | bool | Returns true if this entity has been newly created in the client database, and one of the following is true:
|
IsDirty | bool | Returns true if this entity has been changed in memory, but the change has not yet been saved to the client database. |
IsDeleted | bool | Returns true if this entity was loaded from the database and subsequently deleted. |
IsPending | bool | Checks if the object's pending flag is turned on or not, i.e. has pending change or not. Returns true if there is a pending change, returns false if there is no pending change. |
IsUpdated | bool | Returns true if this entity has been updated or changed in the database, and one of the following is true:
|
Pending | bool | 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. |