Annotation Type Audit


  • @Retention(RUNTIME)
    @Target(FIELD)
    public @interface Audit

    Instructions:

    1. Extend AuditListener
    2. Declare that listener as EntityListeners on your entity.
    3. Put Audit annotation on column of interest.
    4. Profit.

    Usage example:

     @Entity
     @EntityListeners(YourAuditListener.class)
     public class YourEntity extends BaseEntity<Long> {
    
         @Audit
         @Column
         private String email;
    
         // ...
     }
     
    Author:
    Bauke Scholtz