SHARE
TWEET

Untitled

a guest Jun 25th, 2019 55 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. @RevisionEntity(YourCustomRevisionListener.class)
  2. public class CustomRevisionEntity {
  3.   ...
  4. }
  5.      
  6. org.hibernate.envers.revision_listener=com.company.envers.YourCustomRevisionListener
  7.      
  8. public class YourCustomRevisionListener implements RevisionListener {
  9.   @Override
  10.   public void newRevision(Object revisionEntity) {
  11.     // I am going to assume here you're using a custom revision entity.
  12.     // If you are not, you'll need to cast it to the appropriate class implementation.
  13.     final CustomRevisionEntity revisionEntityImpl = (CustomRevisionEntity) revisionEntity;
  14.     revisionEntityImpl.setTimestamp( resolveValidTimestampValue() );
  15.   }
  16.  
  17.   private long resolveValidTimestampValue() {
  18.     // implement your logic here.
  19.   }
  20. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top