I am using JPA-2.0 with Hibernate in my data access layer.
For audit logging purposes, I am using Hibernate\'s EmptyInterceptor by configuring below property in persiste
I am considering persistenceManager
initiated successfully in your Abstract class. You may Have a class AuditLogDAO
which extends your AbstractDao
. Inject AuditLogDAO class into your interceptor and call auditLogDAO.save(entity);
and other methods.
Or write a Util
class which perform DB operations and inject the util class to your interceptor.