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