|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objecteu.etaxonomy.cdm.persistence.dao.hibernate.common.DaoBase
eu.etaxonomy.cdm.persistence.dao.hibernate.common.CdmEntityDaoBase<T>
eu.etaxonomy.cdm.persistence.dao.hibernate.common.VersionableDaoBase<T>
public abstract class VersionableDaoBase<T extends VersionableEntity>
| Field Summary |
|---|
| Fields inherited from class eu.etaxonomy.cdm.persistence.dao.hibernate.common.CdmEntityDaoBase |
|---|
defaultBeanInitializer, flushAfterNo, type, version |
| Constructor Summary | |
|---|---|
VersionableDaoBase(Class<T> type)
|
|
| Method Summary | |
|---|---|
protected void |
addCriteria(org.hibernate.envers.query.AuditQuery query,
List<org.hibernate.envers.query.criteria.AuditCriterion> criteria)
|
protected void |
addOrder(org.hibernate.envers.query.AuditQuery query,
List<OrderHint> orderHints)
|
protected void |
checkNotInPriorView(String message)
|
int |
count()
|
int |
count(Class<? extends T> clazz)
Returns the number of objects of type |
int |
count(T example,
Set<String> includeProperties)
Method that counts the number of objects matching the example provided. |
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. |
protected int |
countByParam(Class<? extends T> clazz,
String param,
String queryString,
MatchMode matchmode,
List<org.hibernate.criterion.Criterion> criterion)
|
Boolean |
exists(UUID uuid)
|
protected List<T> |
findByParam(Class<? extends T> clazz,
String param,
String queryString,
MatchMode matchmode,
List<org.hibernate.criterion.Criterion> criterion,
Integer pageSize,
Integer pageNumber,
List<OrderHint> orderHints,
List<String> propertyPaths)
|
T |
findByUuid(UUID uuid)
|
protected AuditEvent |
getAuditEventFromContext()
|
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. |
protected org.hibernate.envers.AuditReader |
getAuditReader()
|
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. |
List<T> |
list(Class<? extends T> type,
Integer limit,
Integer start)
Returns a sublist of CdmBase instances of type |
List<T> |
list(Class<? extends T> clazz,
Integer limit,
Integer start,
List<OrderHint> orderHints,
List<String> propertyPaths)
Returns a sublist of CdmBase instances stored in the database. |
List<T> |
list(Integer limit,
Integer start)
Returns a sublist of CdmBase instances stored in the database. |
List<T> |
list(T example,
Set<String> includeProperties,
Integer limit,
Integer start,
List<OrderHint> orderHints,
List<String> propertyPaths)
Method that lists the objects matching the example provided. |
T |
load(UUID uuid)
Finds the cdm entity specified by the uuid parameter and
initializes all its *ToOne relations. |
T |
load(UUID uuid,
List<String> propertyPaths)
Finds the cdm entity specified by the uuid parameter and
recursively initializes all bean properties given in the
propertyPaths parameter. |
| Methods inherited from class eu.etaxonomy.cdm.persistence.dao.hibernate.common.CdmEntityDaoBase |
|---|
addCriteria, addExample, addGroups, addOrder, clear, countGroups, delete, findById, getSession, getType, group, list, list, list, list, listByIds, load, lock, merge, refresh, refresh, replace, rows, save, saveAll, saveCdmObj, saveOrUpdate, saveOrUpdateAll, setDefaultBeanInitializer, setPagingParameter, setPagingParameter, update |
| Methods inherited from class eu.etaxonomy.cdm.persistence.dao.hibernate.common.DaoBase |
|---|
addOrder, flush, getSessionFactory, setSessionFactory |
| 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.persistence.dao.common.ICdmEntityDao |
|---|
clear, delete, findById, flush, getSession, getType, group, list, list, list, listByIds, load, lock, merge, refresh, refresh, replace, rows, save, saveAll, saveOrUpdate, saveOrUpdateAll, update |
| Constructor Detail |
|---|
public VersionableDaoBase(Class<T> type)
| Method Detail |
|---|
protected org.hibernate.envers.AuditReader getAuditReader()
protected AuditEvent getAuditEventFromContext()
protected void checkNotInPriorView(String message)
public T findByUuid(UUID uuid)
findByUuid in interface ICdmEntityDao<T extends VersionableEntity>findByUuid in class CdmEntityDaoBase<T extends VersionableEntity>
protected List<T> findByParam(Class<? extends T> clazz,
String param,
String queryString,
MatchMode matchmode,
List<org.hibernate.criterion.Criterion> criterion,
Integer pageSize,
Integer pageNumber,
List<OrderHint> orderHints,
List<String> propertyPaths)
findByParam in class CdmEntityDaoBase<T extends VersionableEntity>public T load(UUID uuid)
ICdmEntityDaouuid parameter and
initializes all its *ToOne relations.
load in interface ICdmEntityDao<T extends VersionableEntity>load in class CdmEntityDaoBase<T extends VersionableEntity>
public T load(UUID uuid,
List<String> propertyPaths)
ICdmEntityDaouuid parameter and
recursively initializes all bean properties given in the
propertyPaths parameter.
For detailed description and examples please refer to:
IBeanInitializer.initialize(Object, List)
load in interface ICdmEntityDao<T extends VersionableEntity>load in class CdmEntityDaoBase<T extends VersionableEntity>propertyPaths - properties to be initialized
public Boolean exists(UUID uuid)
exists in interface ICdmEntityDao<T extends VersionableEntity>exists in class CdmEntityDaoBase<T extends VersionableEntity>public int count()
count in interface ICdmEntityDao<T extends VersionableEntity>count in class CdmEntityDaoBase<T extends VersionableEntity>public int count(Class<? extends T> clazz)
ICdmEntityDao
count in interface ICdmEntityDao<T extends VersionableEntity>count in class CdmEntityDaoBase<T extends VersionableEntity>
public List<T> list(Integer limit,
Integer start)
ICdmEntityDao
list in interface ICdmEntityDao<T extends VersionableEntity>list in class CdmEntityDaoBase<T extends VersionableEntity>limit - the maximum number of entities returned (can be null to return all entities)
public List<T> list(Class<? extends T> type,
Integer limit,
Integer start)
ICdmEntityDao
list in interface ICdmEntityDao<T extends VersionableEntity>list in class CdmEntityDaoBase<T extends VersionableEntity>limit - the maximum number of entities returned (can be null to return all entities)
public List<T> list(Class<? extends T> clazz,
Integer limit,
Integer start,
List<OrderHint> orderHints,
List<String> propertyPaths)
ICdmEntityDao
list in interface ICdmEntityDao<T extends VersionableEntity>list in class CdmEntityDaoBase<T extends VersionableEntity>limit - the maximum number of entities returned (can be null to return
all entities)orderHints - Supports path like orderHints.propertyNames which
include *-to-one properties like createdBy.username or
authorTeam.persistentTitleCache
protected void addOrder(org.hibernate.envers.query.AuditQuery query,
List<OrderHint> orderHints)
public List<AuditEventRecord<T>> getAuditEvents(T t,
Integer pageSize,
Integer pageNumber,
AuditEventSort sort,
List<String> propertyPaths)
IVersionableDao
getAuditEvents in interface IVersionableDao<T extends VersionableEntity>t - The versionable entity which was affected by the audit eventspageSize - 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
public int countAuditEvents(T t,
AuditEventSort sort)
IVersionableDao
countAuditEvents in interface IVersionableDao<T extends VersionableEntity>t - The versionable entity which was affected by the audit eventssort - should the events considered start now and go forward in time (AuditEventSort.FORWARDS) or backwards (AuditEventSort.BACKWARDS)
public AuditEventRecord<T> getNextAuditEvent(T t)
IVersionableDao
getNextAuditEvent in interface IVersionableDao<T extends VersionableEntity>t - The versionable entity affected by these audit events
public AuditEventRecord<T> getPreviousAuditEvent(T t)
IVersionableDao
getPreviousAuditEvent in interface IVersionableDao<T extends VersionableEntity>t - The versionable entity affected by these audit events
public int countAuditEvents(Class<? extends T> clazz,
AuditEvent from,
AuditEvent to,
List<org.hibernate.envers.query.criteria.AuditCriterion> criteria)
IVersionableDao
countAuditEvents in interface IVersionableDao<T extends VersionableEntity>clazz - Restrict the results returned to objects of this classfrom - 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
protected void addCriteria(org.hibernate.envers.query.AuditQuery query,
List<org.hibernate.envers.query.criteria.AuditCriterion> criteria)
public 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)
IVersionableDao
getAuditEvents in interface IVersionableDao<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)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 timepropertyPaths - properties to be initialized
protected int countByParam(Class<? extends T> clazz,
String param,
String queryString,
MatchMode matchmode,
List<org.hibernate.criterion.Criterion> criterion)
countByParam in class CdmEntityDaoBase<T extends VersionableEntity>
public int count(T example,
Set<String> includeProperties)
ICdmEntityDao
count in interface ICdmEntityDao<T extends VersionableEntity>count in class CdmEntityDaoBase<T extends VersionableEntity>
public List<T> list(T example,
Set<String> includeProperties,
Integer limit,
Integer start,
List<OrderHint> orderHints,
List<String> propertyPaths)
ICdmEntityDao
list in interface ICdmEntityDao<T extends VersionableEntity>list in class CdmEntityDaoBase<T extends VersionableEntity>limit - the maximum number of entities returned (can be null to return
all entities)start - The (0-based) offset from the start of the recordsetorderHints - Supports path like orderHints.propertyNames which
include *-to-one properties like createdBy.username orpropertyPaths - paths initialized on the returned objects - only applied to the objects returned from the first grouping
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||