-->
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 auditReader.createquery help needed
PostPosted: Thu Jul 08, 2010 5:10 am 
Newbie

Joined: Wed Jun 23, 2010 7:23 am
Posts: 8
Hi All,

I am working with hibernate 3.5.3 and Envers that comes with it. I am trying to make auditreader querries to coem up with results:

My RevisionEntity is customized and looks like this:
Code:
@RevisionEntity(LossShareEnversListener.class)
public class LossShareRevisionEntity  {
   

   
   @RevisionNumber
    private int id;

    @RevisionTimestamp
    private long timestamp;
     private String username;
   private String screenName;
/*getters setters follow for each*/


How can i get to make a query where I can list all the revisions made by a certain username

when i use
Code:

AuditQuery queryForEntities = auditreader.createQuery().forEntitiesAtRevision(MyEntity, revisionNumber);
         queryForEntities.add(AuditEntity.property("username").eq(userName));


It searches for username in the Audited Entity like Customer_aud so ofcourse it is going to throw exception. I tried to find something like "AuditEntity" in the same package but i couldnt find RevisionEntity to replace the part in the queryForEntities.add() method.

So how can I list all the revisions on the basis of username in _revision_info/revinfo table. It should be the same way if someone wants to find revision on the basis of timestamp but i didnt find any examples for that either or that would ahve helped.

Any help will be appreciated.
thanks.
Syed


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.