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, that is, 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 derived from the time in seconds since an epoch, and increases each time a row is
changed. int64_t result = [customer replayCounter]; |
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). int64_t result = [customer 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. int64_t result = [customer replayFailure]; |