-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 
Author Message
 Post subject: envers: How to get revision from historical entity
PostPosted: Wed Sep 18, 2013 9:07 am 
Newbie

Joined: Wed Feb 27, 2013 6:52 am
Posts: 1
Hello,

I must be missing something obvious; however I am struggling to find an answer to a problem I am having with envers.

Let's say that I have entity class called MyObject that is audited using envers.

If I get the current copy of an instance of MyObject doing something like:

Code:
Session session = sessionFactory.getCurrentSession();
MyObject myobject1 = (MyObject) session.get(MyObject.class, 1234);


And I get an historical copy (from revision 2) of the same instance:

Code:
Session session = sessionFactory.getCurrentSession();
AuditReader reader = AuditReaderFactory.get(session);
MyObject myobject2 = reader.find(MyObject.class, 1234, 1);


How would I know that myobject1 was the current copy and myobject2 was from revsion 2?


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.