|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.hibernate.envers.reader.AuditReaderImpl
public class AuditReaderImpl
| Constructor Summary | |
|---|---|
AuditReaderImpl(AuditConfiguration verCfg,
org.hibernate.Session session,
org.hibernate.engine.SessionImplementor sessionImplementor)
|
|
| Method Summary | ||
|---|---|---|
VersionsQueryCreator |
createQuery()
|
|
|
find(Class<T> cls,
Object primaryKey,
Number revision)
Find an entity by primary key at the given revision. |
|
|
findRevision(Class<T> revisionEntityClass,
Number revision)
A helper method; should be used only if a custom revision entity is used. |
|
FirstLevelCache |
getFirstLevelCache()
|
|
Date |
getRevisionDate(Number revision)
Get the date, at which a revision was created. |
|
Number |
getRevisionNumberForDate(Date date)
Gets the revision number, that corresponds to the given date. |
|
List<Number> |
getRevisions(Class<?> cls,
Object primaryKey)
Get a list of revision numbers, at which an entity was modified. |
|
org.hibernate.Session |
getSession()
|
|
org.hibernate.engine.SessionImplementor |
getSessionImplementor()
|
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public AuditReaderImpl(AuditConfiguration verCfg,
org.hibernate.Session session,
org.hibernate.engine.SessionImplementor sessionImplementor)
| Method Detail |
|---|
public org.hibernate.engine.SessionImplementor getSessionImplementor()
getSessionImplementor in interface AuditReaderImplementorpublic org.hibernate.Session getSession()
getSession in interface AuditReaderImplementorpublic FirstLevelCache getFirstLevelCache()
getFirstLevelCache in interface AuditReaderImplementor
public <T> T find(Class<T> cls,
Object primaryKey,
Number revision)
throws IllegalArgumentException,
NotAuditedException,
IllegalStateException
AuditReader
find in interface AuditReaderfind in interface VersionsReadercls - Class of the entity.primaryKey - Primary key of the entity.revision - Revision in which to get the entity.
IllegalArgumentException - If cls or primaryKey is null or revision is less or equal to 0.
NotAuditedException - When entities of the given class are not audited.
IllegalStateException - If the associated entity manager is closed.
public List<Number> getRevisions(Class<?> cls,
Object primaryKey)
throws IllegalArgumentException,
NotAuditedException,
IllegalStateException
AuditReader
getRevisions in interface AuditReadergetRevisions in interface VersionsReadercls - Class of the entity.primaryKey - Primary key of the entity.
IllegalArgumentException - If cls or primaryKey is null.
NotAuditedException - When entities of the given class are not audited.
IllegalStateException - If the associated entity manager is closed.
public Date getRevisionDate(Number revision)
throws IllegalArgumentException,
RevisionDoesNotExistException,
IllegalStateException
AuditReader
getRevisionDate in interface AuditReadergetRevisionDate in interface VersionsReaderrevision - Number of the revision for which to get the date.
IllegalArgumentException - If revision is less or equal to 0.
RevisionDoesNotExistException - If the revision does not exist.
IllegalStateException - If the associated entity manager is closed.public Number getRevisionNumberForDate(Date date)
AuditReadergetRevisionDate(getRevisionNumberForDate(date)) <= date and
getRevisionDate(getRevisionNumberForDate(date)+1) > date.
getRevisionNumberForDate in interface AuditReadergetRevisionNumberForDate in interface VersionsReaderdate - Date for which to get the revision.
public <T> T findRevision(Class<T> revisionEntityClass,
Number revision)
throws IllegalArgumentException,
RevisionDoesNotExistException,
IllegalStateException
AuditReaderRevisionEntity.
findRevision in interface AuditReaderfindRevision in interface VersionsReaderrevisionEntityClass - Class of the revision entity. Should be annotated with RevisionEntity.revision - Number of the revision for which to get the data.
IllegalArgumentException - If revision is less or equal to 0 or if the class of the revision entity
is invalid.
RevisionDoesNotExistException - If the revision does not exist.
IllegalStateException - If the associated entity manager is closed.public VersionsQueryCreator createQuery()
createQuery in interface AuditReadercreateQuery in interface VersionsReader
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||