Class AuditableExtension
java.lang.Object
nl.datasteel.crudcraft.runtime.extensions.AuditableExtension
AuditableExtension is an embeddable class that provides auditing capabilities
for entities, tracking creation and update timestamps.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionGets the createdAt timestamp.Gets the updatedAt timestamp.protected void
onCreate()
Hooks into the JPA lifecycle to set the createdAt and updatedAt timestamps when the entity is first persisted.protected void
onUpdate()
Hooks into the JPA lifecycle to update the updatedAt timestamp whenever the entity is updated.
-
Constructor Details
-
AuditableExtension
public AuditableExtension()
-
-
Method Details
-
onCreate
protected void onCreate()Hooks into the JPA lifecycle to set the createdAt and updatedAt timestamps when the entity is first persisted. -
onUpdate
protected void onUpdate()Hooks into the JPA lifecycle to update the updatedAt timestamp whenever the entity is updated. -
getCreatedAt
Gets the createdAt timestamp.- Returns:
- the createdAt timestamp
-
getUpdatedAt
Gets the updatedAt timestamp.- Returns:
- the updatedAt timestamp
-