eu.etaxonomy.cdm.persistence.dao.common
Interface IVersionableDao<T extends VersionableEntity>

All Superinterfaces:
ICdmEntityDao<T>
All Known Subinterfaces:
IAgentDao, IAnnotatableDao<T>, IAnnotationDao, IClassificationDao, ICollectionDao, IDefinedTermDao, IDescriptionDao, IDescriptionElementDao, IEventBaseDao, IFeatureNodeDao, IFeatureTreeDao, IIdentifiableDao<T>, ILanguageStringBaseDao<T>, ILanguageStringDao, IMarkerDao, IMediaDao, IOccurrenceDao, IPolytomousKeyDao, IPolytomousKeyNodeDao, IReferenceDao, IRepresentationDao, ITaxonDao, ITaxonNameDao, ITaxonNodeDao, ITermVocabularyDao, IWorkingSetDao
All Known Implementing Classes:
AgentDaoImpl, AnnotatableDaoImpl, AnnotationDaoImpl, ClassificationDaoHibernateImpl, CollectionDaoHibernateImpl, DefinedTermDaoImpl, DescriptionDaoImpl, DescriptionElementDaoImpl, EventBaseDaoImpl, FeatureNodeDaoImpl, FeatureTreeDaoImpl, IdentifiableDaoBase, LanguageStringBaseDaoImpl, LanguageStringDaoImpl, MarkerDaoImpl, MediaDaoHibernateImpl, OccurrenceDaoHibernateImpl, PolytomousKeyDaoImpl, PolytomousKeyNodeDaoImpl, ReferenceDaoHibernateImpl, RepresentationDaoImpl, TaxonDaoHibernateImpl, TaxonNameDaoHibernateImpl, TaxonNodeDaoHibernateImpl, TermVocabularyDaoImpl, VersionableDaoBase, WorkingSetDao

public interface IVersionableDao<T extends VersionableEntity>
extends ICdmEntityDao<T>


Method Summary
 int countAuditEvents(Class<? extends T> clazz, AuditEvent from, AuditEvent to, List<org.hibernate.envers.query.criteria.AuditCriterion> criteria)
          Returns a count of the total number of audit events affecting objects of class T, optionally restricted to objects of class clazz, the AuditEvents from and to, inclusive, optionally filtered by other criteria
 int countAuditEvents(T t, AuditEventSort sort)
          Returns a count of audit events which affected the state of an entity t.
 List<AuditEventRecord<T>> getAuditEvents(Class<? extends T> clazz, AuditEvent from, AuditEvent to, List<org.hibernate.envers.query.criteria.AuditCriterion> criteria, Integer pageSize, Integer pageNumber, AuditEventSort sort, List<String> propertyPaths)
          Returns a list of all audit events occurring to objects of type T, optionally restricted to objects of type clazz between the AuditEvents from and to, inclusive, optionally filtered by other criteria
 List<AuditEventRecord<T>> getAuditEvents(T t, Integer pageSize, Integer pageNumber, AuditEventSort sort, List<String> propertyPaths)
          Returns a list of audit events (in order) which affected the state of an entity t.
 AuditEventRecord<T> getNextAuditEvent(T t)
          A convenience method which returns a record of the next (relative to the audit event in context) audit event to affect the entity t.
 AuditEventRecord<T> getPreviousAuditEvent(T t)
          A convenience method which returns a record of the previous (relative to the audit event in context) audit event to affect the entity t.
 
Methods inherited from interface eu.etaxonomy.cdm.persistence.dao.common.ICdmEntityDao
clear, count, count, count, delete, exists, findById, findByUuid, flush, getSession, getType, group, list, list, list, list, list, list, list, listByIds, load, load, load, lock, merge, refresh, refresh, replace, rows, save, saveAll, saveOrUpdate, saveOrUpdateAll, update
 

Method Detail

getAuditEvents

List<AuditEventRecord<T>> getAuditEvents(T t,
                                         Integer pageSize,
                                         Integer pageNumber,
                                         AuditEventSort sort,
                                         List<String> propertyPaths)
Returns a list of audit events (in order) which affected the state of an entity t. The events returned either start at the AuditEvent in context and go forward in time (AuditEventSort.FORWARDS) or backwards in time (AuditEventSort.BACKWARDS). If the AuditEventContext is set to null, or to AuditEvent.CURRENT_VIEW, then all relevant AuditEvents are returned.

Parameters:
t - The versionable entity which was affected by the audit events
pageSize - The maximum number of audit event records returned (can be null for all audit event records)
pageNumber - The offset (in pageSize chunks) from the start of the result set (0 - based)
sort - should the list be sorted going forward in time (AuditEventSort.FORWARDS) or backwards (AuditEventSort.BACKWARDS)
propertyPaths - paths initialized on the returned audited objects
Returns:
a list of AuditEventRecords, containing the AuditEvent, the state of the entity at that event, and the type of modification

countAuditEvents

int countAuditEvents(T t,
                     AuditEventSort sort)
Returns a count of audit events which affected the state of an entity t. The events either start at the AuditEvent in context and go forward in time (AuditEventSort.FORWARDS) or backwards in time (AuditEventSort.BACKWARDS). If the AuditEventContext is set to null, or to AuditEvent.CURRENT_VIEW, then all relevant AuditEvents are considered.

Parameters:
t - The versionable entity which was affected by the audit events
sort - should the events considered start now and go forward in time (AuditEventSort.FORWARDS) or backwards (AuditEventSort.BACKWARDS)
Returns:
a count of audit events

getNextAuditEvent

AuditEventRecord<T> getNextAuditEvent(T t)
A convenience method which returns a record of the next (relative to the audit event in context) audit event to affect the entity t.

Parameters:
t - The versionable entity affected by these audit events
Returns:
a record of the next audit event to affect t, or null if the current event is the last to affect t

getPreviousAuditEvent

AuditEventRecord<T> getPreviousAuditEvent(T t)
A convenience method which returns a record of the previous (relative to the audit event in context) audit event to affect the entity t.

Parameters:
t - The versionable entity affected by these audit events
Returns:
a record of the previous audit event to affect t, or null if the current event is the first to affect t

countAuditEvents

int countAuditEvents(Class<? extends T> clazz,
                     AuditEvent from,
                     AuditEvent to,
                     List<org.hibernate.envers.query.criteria.AuditCriterion> criteria)
Returns a count of the total number of audit events affecting objects of class T, optionally restricted to objects of class clazz, the AuditEvents from and to, inclusive, optionally filtered by other criteria

Parameters:
clazz - Restrict the results returned to objects of this class
from - The audit event to start from (or pass null to start from the beginning of the recordset)
to - The audit event to continue until (or pass null to return audit events up to the time of the query)
criteria - Extra criteria to filter by
Returns:
the count of audit events

getAuditEvents

List<AuditEventRecord<T>> getAuditEvents(Class<? extends T> clazz,
                                         AuditEvent from,
                                         AuditEvent to,
                                         List<org.hibernate.envers.query.criteria.AuditCriterion> criteria,
                                         Integer pageSize,
                                         Integer pageNumber,
                                         AuditEventSort sort,
                                         List<String> propertyPaths)
Returns a list of all audit events occurring to objects of type T, optionally restricted to objects of type clazz between the AuditEvents from and to, inclusive, optionally filtered by other criteria

Parameters:
clazz - Restrict the results returned to objects of this class
from - The audit event to start from (inclusive, or pass null to start from the beginning of the recordset)
to - The audit event to continue until (exclusive, or pass null to return audit events up to the time of the query)
criteria - Extra criteria to filter by
pageSize - The maximum number of objects returned (can be null for all matching objects)
pageNumber - The offset (in pageSize chunks) from the start of the result set (0 - based, can be null, equivalent of starting at the beginning of the recordset)
sort - Sort the events either forwards or backwards in time
propertyPaths - properties to be initialized
Returns:


Copyright © 2007-2013 EDIT. All Rights Reserved.