public abstract class VersionableServiceBase<T extends VersionableEntity,DAO extends IVersionableDao<T>> extends ServiceBase<T,DAO> implements IVersionableService<T>
Modifier and Type | Field and Description |
---|---|
protected ICommonService |
commonService |
appContext, dao, INCLUDE_UNPUBLISHED, NO_UNPUBLISHED
Constructor and Description |
---|
VersionableServiceBase() |
Modifier and Type | Method and Description |
---|---|
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.
|
DeleteResult |
isDeletable(java.util.UUID baseUUID,
DeleteConfiguratorBase config)
the basic isDeletable method return false if the object is referenced from any other object.
|
Pager<AuditEventRecord<T>> |
pageAuditEvents(java.lang.Class<? extends T> clazz,
AuditEvent from,
AuditEvent to,
java.util.List<org.hibernate.envers.query.criteria.AuditCriterion> criteria,
java.lang.Integer pageSize,
java.lang.Integer pageNumber,
AuditEventSort sort,
java.util.List<java.lang.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,
java.lang.Integer pageSize,
java.lang.Integer pageNumber,
AuditEventSort sort,
java.util.List<java.lang.String> propertyPaths)
Returns a paged list of audit events (in order) which affected the state of an entity t.
|
checkPublished, clear, count, delete, delete, delete, exists, find, find, find, find, findById, findWithoutFlush, getSession, group, list, list, load, load, load, load, loadByIds, loadByIds, loadWithUpdate, lock, merge, merge, merge, merge, page, page, page, pageByParamWithRestrictions, refresh, refresh, save, save, saveOrUpdate, saveOrUpdate, setApplicationContext, setDao, update
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
clear, count, delete, delete, delete, exists, find, find, find, find, findById, findWithoutFlush, getSession, group, list, list, load, load, load, load, loadByIds, loadByIds, loadWithUpdate, lock, merge, merge, merge, merge, page, page, page, pageByParamWithRestrictions, refresh, refresh, save, save, saveOrUpdate, saveOrUpdate, update
@Autowired protected ICommonService commonService
@Transactional(readOnly=true) public Pager<AuditEventRecord<T>> pageAuditEvents(T t, java.lang.Integer pageSize, java.lang.Integer pageNumber, AuditEventSort sort, java.util.List<java.lang.String> propertyPaths)
IVersionableService
pageAuditEvents
in interface IVersionableService<T extends VersionableEntity>
propertyPaths
- paths initialized on the returned objects - only applied to the objects returned from the first grouping@Transactional(readOnly=true) public AuditEventRecord<T> getNextAuditEvent(T t)
IVersionableService
getNextAuditEvent
in interface IVersionableService<T extends VersionableEntity>
t
- The versionable entity affected by these audit events@Transactional(readOnly=true) public AuditEventRecord<T> getPreviousAuditEvent(T t)
IVersionableService
getPreviousAuditEvent
in interface IVersionableService<T extends VersionableEntity>
t
- The versionable entity affected by these audit events@Transactional(readOnly=true) public Pager<AuditEventRecord<T>> pageAuditEvents(java.lang.Class<? extends T> clazz, AuditEvent from, AuditEvent to, java.util.List<org.hibernate.envers.query.criteria.AuditCriterion> criteria, java.lang.Integer pageSize, java.lang.Integer pageNumber, AuditEventSort sort, java.util.List<java.lang.String> propertyPaths)
IVersionableService
pageAuditEvents
in interface IVersionableService<T extends VersionableEntity>
clazz
- Restrict the results returned to objects of this classfrom
- 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 bypageSize
- The maximum number of objects returned (can be null for all matching objects)sort
- Sort the events either forwards or backwards in timepropertyPaths
- properties to be initialized@Transactional(readOnly=true) public DeleteResult isDeletable(java.util.UUID baseUUID, DeleteConfiguratorBase config)
isDeletable
in interface IVersionableService<T extends VersionableEntity>
Copyright © 2007-2020 EDIT. All Rights Reserved.