eu.etaxonomy.cdm.api.service
Class VersionableServiceBase<T extends VersionableEntity,DAO extends IVersionableDao<T>>

java.lang.Object
  extended by eu.etaxonomy.cdm.api.service.ServiceBase<T,DAO>
      extended by eu.etaxonomy.cdm.api.service.VersionableServiceBase<T,DAO>
All Implemented Interfaces:
IService<T>, IVersionableService<T>, org.springframework.beans.factory.Aware, org.springframework.context.ApplicationContextAware
Direct Known Subclasses:
AnnotatableServiceBase, FeatureNodeServiceImpl, MarkerServiceImpl, PolytomousKeyNodeServiceImpl

public abstract class VersionableServiceBase<T extends VersionableEntity,DAO extends IVersionableDao<T>>
extends ServiceBase<T,DAO>
implements IVersionableService<T>


Field Summary
 
Fields inherited from class eu.etaxonomy.cdm.api.service.ServiceBase
appContext, dao
 
Constructor Summary
VersionableServiceBase()
           
 
Method Summary
 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.
 Pager<AuditEventRecord<T>> pageAuditEvents(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
 Pager<AuditEventRecord<T>> pageAuditEvents(T t, Integer pageSize, Integer pageNumber, AuditEventSort sort, List<String> propertyPaths)
          Returns a paged list of audit events (in order) which affected the state of an entity t.
 
Methods inherited from class eu.etaxonomy.cdm.api.service.ServiceBase
clear, count, delete, exists, find, find, find, findById, getSession, group, list, list, load, load, lock, merge, page, refresh, refresh, rows, save, save, saveOrUpdate, saveOrUpdate, setApplicationContext, setDao, update
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface eu.etaxonomy.cdm.api.service.IService
clear, count, delete, exists, find, find, find, findById, getSession, group, list, list, load, load, lock, merge, page, refresh, refresh, rows, save, save, saveOrUpdate, saveOrUpdate, update
 

Constructor Detail

VersionableServiceBase

public VersionableServiceBase()
Method Detail

pageAuditEvents

@Transactional(readOnly=true)
public Pager<AuditEventRecord<T>> pageAuditEvents(T t,
                                                                Integer pageSize,
                                                                Integer pageNumber,
                                                                AuditEventSort sort,
                                                                List<String> propertyPaths)
Description copied from interface: IVersionableService
Returns a paged 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.

Specified by:
pageAuditEvents in interface IVersionableService<T extends VersionableEntity>
propertyPaths - paths initialized on the returned objects - only applied to the objects returned from the first grouping
Returns:
a Pager containing audit event instances, plus metadata

getNextAuditEvent

@Transactional(readOnly=true)
public AuditEventRecord<T> getNextAuditEvent(T t)
Description copied from interface: IVersionableService
A convenience method which returns a record of the next (relative to the audit event in context) audit event to affect the entity t.

Specified by:
getNextAuditEvent in interface IVersionableService<T extends VersionableEntity>
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

@Transactional(readOnly=true)
public AuditEventRecord<T> getPreviousAuditEvent(T t)
Description copied from interface: IVersionableService
A convenience method which returns a record of the previous (relative to the audit event in context) audit event to affect the entity t.

Specified by:
getPreviousAuditEvent in interface IVersionableService<T extends VersionableEntity>
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

pageAuditEvents

@Transactional(readOnly=true)
public Pager<AuditEventRecord<T>> pageAuditEvents(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)
Description copied from interface: IVersionableService
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

Specified by:
pageAuditEvents in interface IVersionableService<T extends VersionableEntity>
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)
sort - Sort the events either forwards or backwards in time
propertyPaths - properties to be initialized
Returns:


Copyright © 2007-2013 EDIT. All Rights Reserved.