org.hibernate.envers.query
Class AuditQueryCreator
java.lang.Object
org.hibernate.envers.query.AuditQueryCreator
public class AuditQueryCreator
- extends Object
- Author:
- Adam Warski (adam at warski dot org)
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
AuditQueryCreator
public AuditQueryCreator(AuditConfiguration auditCfg,
AuditReaderImplementor auditReaderImplementor)
forEntitiesAtRevision
public AuditQuery forEntitiesAtRevision(Class<?> c,
Number revision)
- Creates a query, which will return entities satisfying some conditions (specified later),
at a given revision.
- Parameters:
c - Class of the entities for which to query.revision - Revision number at which to execute the query.
- Returns:
- A query for entities at a given revision, to which conditions can be added and which
can then be executed. The result of the query will be a list of entities (beans), unless a
projection is added.
forRevisionsOfEntity
public AuditQuery forRevisionsOfEntity(Class<?> c,
boolean selectEntitiesOnly,
boolean selectDeletedEntities)
- Creates a query, which selects the revisions, at which the given entity was modified.
Unless an explicit projection is set, the result will be a list of three-element arrays, containing:
- the entity instance
- revision entity, corresponding to the revision at which the entity was modified. If no custom
revision entity is used, this will be an instance of
DefaultRevisionEntity
- type of the revision (an enum instance of class
RevisionType) .
Additional conditions that the results must satisfy may be specified.
- Parameters:
c - Class of the entities for which to query.selectEntitiesOnly - If true, instead of a list of three-element arrays, a list of entites will be
returned as a result of executing this query.selectDeletedEntities - If true, also revisions where entities were deleted will be returned. The additional
entities will have revision type "delete", and contain no data (all fields null), except for the id field.
- Returns:
- A query for revisions at which instances of the given entity were modified, to which
conditions can be added (for example - a specific id of an entity of class
c), and which
can then be executed. The results of the query will be sorted in ascending order by the revision number,
unless an order or projection is added.
Copyright © 2002-2009 Red Hat Middleware, LLC. All Rights Reserved