Class AuditableExtension

java.lang.Object
nl.datasteel.crudcraft.runtime.extensions.AuditableExtension

@QueryExclude @Embeddable public class AuditableExtension extends Object
AuditableExtension is an embeddable class that provides auditing capabilities for entities, tracking creation and update timestamps.
  • 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

      public Instant getCreatedAt()
      Gets the createdAt timestamp.
      Returns:
      the createdAt timestamp
    • getUpdatedAt

      public Instant getUpdatedAt()
      Gets the updatedAt timestamp.
      Returns:
      the updatedAt timestamp