One recorded change to an audited record, holding what changed, who changed it and the record's previous state so the change can be reverted. A row is written for every create, update and delete of an entity that implements Auditable. For updates and deletes the recordState column holds the serialised state of the record as it was before the change, which is what a revert reads back; a create has no previous state to store. The record is referred to loosely by class name and row id rather than by a foreign key, so the history outlives the record and may name a row that no longer exists. Reverting a delete creates a new record with a new id, and that id is written into revertNewId so the history can be followed across the gap. The opSource and opId columns record which request or job made the change, so every change from one operation can be listed together.

Group: Database Entities

Implements: Serializable, Relational


Properties

PropertyReturnsDescription
actionDateDateWhen the change was made. Audit listings are sorted by this, most recent first. Required.
actionUserProfileThe profile that made the change. Null when the change came from a system process rather than a signed in user. Lazily loaded.
changeTypeChangeTypeWhether this row records a CREATE, an UPDATE or a DELETE of the entity.
descriptionStringShort readable summary of what changed, up to 10000 characters, supplied by the entity being audited and shown in audit listings.
entityClassNameStringSimple class name of the entity this change was made to, for example Profile. It is stored as plain text rather than a foreign key so the audit history survives the record itself being deleted.
entityIdLongRow id of the entity this change was made to. Together with the class name it identifies the record, but there is no foreign key, so for a delete the row it names no longer exists.
idlongThe database-assigned unique identifier for this audit row. Audit rows for one record are also ordered by this, since a higher id always means a later change.
opIdStringIdentifier of the particular operation that caused this change, such as the request id or the async job id, up to 2000 characters. Use it together with opSource to list every change made by one operation.
opSourceStringWhat kind of operation caused this change, such as an HTTP request URL or an async job task name, up to 200 characters.
recordStateStringThe serialised state of the record as it was before this change, up to 100000 characters, which is what a revert restores from. Null for a create, which had no previous state.
revertDateDateWhen this change was reverted, or null if it has not been reverted.
revertNewIdLongWhen a delete has been reverted, the row id of the newly created record that took the deleted one's place. It is also what marks a delete as already reverted, so it is null for any change that has not been reverted.
revertUserProfileThe profile that reverted this change, or null if it has not been reverted. Lazily loaded.

Methods

getId() · getEntityClassName() · getEntityId() · getChangeType() · getActionDate() · getActionUser() · getRevertDate() · getRevertUser() · getRevertNewId() · getRecordState() · getDescription() · getOpId() · getOpSource()

getId()

Returns: long

The database-assigned unique identifier for this audit row. Audit rows for one record are also ordered by this, since a higher id always means a later change.

getEntityClassName()

Returns: String

Simple class name of the entity this change was made to, for example Profile. It is stored as plain text rather than a foreign key so the audit history survives the record itself being deleted.

getEntityId()

Returns: Long

Row id of the entity this change was made to. Together with the class name it identifies the record, but there is no foreign key, so for a delete the row it names no longer exists.

getChangeType()

Returns: ChangeType

Whether this row records a CREATE, an UPDATE or a DELETE of the entity.

getActionDate()

Returns: Date

When the change was made. Audit listings are sorted by this, most recent first. Required.

getActionUser()

Returns: Profile

The profile that made the change. Null when the change came from a system process rather than a signed in user. Lazily loaded.

getRevertDate()

Returns: Date

When this change was reverted, or null if it has not been reverted.

getRevertUser()

Returns: Profile

The profile that reverted this change, or null if it has not been reverted. Lazily loaded.

getRevertNewId()

Returns: Long

When a delete has been reverted, the row id of the newly created record that took the deleted one's place. It is also what marks a delete as already reverted, so it is null for any change that has not been reverted.

getRecordState()

Returns: String

The serialised state of the record as it was before this change, up to 100000 characters, which is what a revert restores from. Null for a create, which had no previous state.

getDescription()

Returns: String

Short readable summary of what changed, up to 10000 characters, supplied by the entity being audited and shown in audit listings.

getOpId()

Returns: String

Identifier of the particular operation that caused this change, such as the request id or the async job id, up to 2000 characters. Use it together with opSource to list every change made by one operation.

getOpSource()

Returns: String

What kind of operation caused this change, such as an HTTP request URL or an async job task name, up to 200 characters.

To get full access to the Kademi Hub existing customers can login here, or new customers can register here.