|
||||||||||
| 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>
@Repository public abstract class CdmEntityDaoBase<T extends CdmBase>
| Field Summary | |
|---|---|
protected IBeanInitializer |
defaultBeanInitializer
|
protected int |
flushAfterNo
|
protected Class<T> |
type
|
protected org.apache.lucene.util.Version |
version
|
| Constructor Summary | |
|---|---|
CdmEntityDaoBase(Class<T> type)
|
|
| Method Summary | |
|---|---|
protected void |
addCriteria(org.hibernate.Criteria criteria,
List<org.hibernate.criterion.Criterion> criterion)
|
protected void |
addExample(org.hibernate.Criteria criteria,
T example,
Set<String> includeProperties)
|
protected void |
addGroups(org.hibernate.Criteria criteria,
List<Grouping> groups)
|
protected void |
addOrder(org.hibernate.search.FullTextQuery fullTextQuery,
List<OrderHint> orderHints)
|
void |
clear()
|
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. |
protected int |
countByParam(Class<? extends T> clazz,
String param,
String queryString,
MatchMode matchmode,
List<org.hibernate.criterion.Criterion> criterion)
|
protected void |
countGroups(org.hibernate.criterion.DetachedCriteria criteria,
List<Grouping> groups)
|
UUID |
delete(T persistentObject)
|
Boolean |
exists(UUID uuid)
|
T |
findById(int id)
|
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)
|
org.hibernate.Session |
getSession()
|
Class<T> |
getType()
Convenience method which makes it easy to discover what type of object this DAO returns at runtime |
List<Object[]> |
group(Class<? extends T> clazz,
Integer limit,
Integer start,
List<Grouping> groups,
List<String> propertyPaths)
Returns a sublist of objects matching the grouping projections supplied using the groups parameter It would be nice to have an equivalent countGroups method, but for the moment hibernate doesn't seem to support this (HHH-3238 - impossible to get the rowcount for a criteria that has projections) |
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> type,
Integer limit,
Integer start,
List<OrderHint> orderHints)
|
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(Collection<UUID> uuids,
Integer pageSize,
Integer pageNumber,
List<OrderHint> orderHints,
List<String> propertyPaths)
|
List<T> |
list(Integer limit,
Integer start)
Returns a sublist of CdmBase instances stored in the database. |
List<T> |
list(Integer limit,
Integer start,
List<OrderHint> orderHints)
Returns a sublist of CdmBase instances stored in the database. |
List<T> |
list(Integer limit,
Integer start,
List<OrderHint> orderHints,
List<String> propertyPaths)
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. |
List<T> |
listByIds(Collection<Integer> ids,
Integer pageSize,
Integer pageNumber,
List<OrderHint> orderHints,
List<String> propertyPaths)
|
T |
load(int id,
List<String> propertyPaths)
Finds the cdm entity specified by the id parameter and recursively initializes all bean properties given in the propertyPaths parameter. |
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. |
void |
lock(T t,
org.hibernate.LockMode lockMode)
Obtains the specified LockMode on the supplied object |
T |
merge(T transientObject)
|
UUID |
refresh(T persistentObject)
|
void |
refresh(T t,
org.hibernate.LockMode lockMode,
List<String> propertyPaths)
Refreshes the state of the supplied object using the given LockMode (e.g. |
T |
replace(T x,
T y)
Globally replace all references to instance t1 with t2 (including NOTE: This replaces all non-bidirectional relationships where type T is on the "owning" side of the relationship (since the "owned" objects are, in theory, sub-components of the entity and this kind of global replace doesn't really make sense Consequently it is a good idea to either map such owned relationships with cascading semantics (i.e. |
List<T> |
rows(String tableName,
int limit,
int start)
|
UUID |
save(T newInstance)
|
Map<UUID,T> |
saveAll(Collection<T> cdmObjCollection)
|
UUID |
saveCdmObj(CdmBase cdmObj)
|
UUID |
saveOrUpdate(T transientObject)
|
Map<UUID,T> |
saveOrUpdateAll(Collection<T> cdmObjCollection)
|
void |
setDefaultBeanInitializer(IBeanInitializer defaultBeanInitializer)
|
protected void |
setPagingParameter(org.hibernate.envers.query.AuditQuery query,
Integer pageSize,
Integer pageNumber)
|
protected void |
setPagingParameter(org.hibernate.Query query,
Integer pageSize,
Integer pageNumber)
|
UUID |
update(T transientObject)
|
| 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 |
|---|
flush |
| Field Detail |
|---|
protected int flushAfterNo
protected Class<T extends CdmBase> type
protected org.apache.lucene.util.Version version
@Autowired protected IBeanInitializer defaultBeanInitializer
| Constructor Detail |
|---|
public CdmEntityDaoBase(Class<T> type)
| Method Detail |
|---|
public void setDefaultBeanInitializer(IBeanInitializer defaultBeanInitializer)
public void lock(T t,
org.hibernate.LockMode lockMode)
ICdmEntityDao
lock in interface ICdmEntityDao<T extends CdmBase>
public void refresh(T t,
org.hibernate.LockMode lockMode,
List<String> propertyPaths)
ICdmEntityDaopropertyPaths parameter are recursively initialized.
For detailed description and examples please refer to:
IBeanInitializer.initialize(Object, List)
refresh in interface ICdmEntityDao<T extends CdmBase>
public UUID saveCdmObj(CdmBase cdmObj)
throws org.springframework.dao.DataAccessException
org.springframework.dao.DataAccessExceptionpublic Map<UUID,T> saveAll(Collection<T> cdmObjCollection)
saveAll in interface ICdmEntityDao<T extends CdmBase>public Map<UUID,T> saveOrUpdateAll(Collection<T> cdmObjCollection)
saveOrUpdateAll in interface ICdmEntityDao<T extends CdmBase>
public T replace(T x,
T y)
ICdmEntityDao
replace in interface ICdmEntityDao<T extends CdmBase>x - the object to replace, must not be nully - the object that will replace. If y is null, then x will be removed from all collections
and all properties that refer to x will be replaced with null
public org.hibernate.Session getSession()
throws org.springframework.dao.DataAccessException
getSession in interface ICdmEntityDao<T extends CdmBase>getSession in class DaoBaseorg.springframework.dao.DataAccessException
public void clear()
throws org.springframework.dao.DataAccessException
clear in interface ICdmEntityDao<T extends CdmBase>org.springframework.dao.DataAccessException
public T merge(T transientObject)
throws org.springframework.dao.DataAccessException
merge in interface ICdmEntityDao<T extends CdmBase>org.springframework.dao.DataAccessException
public UUID saveOrUpdate(T transientObject)
throws org.springframework.dao.DataAccessException
saveOrUpdate in interface ICdmEntityDao<T extends CdmBase>org.springframework.dao.DataAccessException
public UUID save(T newInstance)
throws org.springframework.dao.DataAccessException
save in interface ICdmEntityDao<T extends CdmBase>org.springframework.dao.DataAccessException
public UUID update(T transientObject)
throws org.springframework.dao.DataAccessException
update in interface ICdmEntityDao<T extends CdmBase>org.springframework.dao.DataAccessException
public UUID refresh(T persistentObject)
throws org.springframework.dao.DataAccessException
refresh in interface ICdmEntityDao<T extends CdmBase>org.springframework.dao.DataAccessException
public UUID delete(T persistentObject)
throws org.springframework.dao.DataAccessException
delete in interface ICdmEntityDao<T extends CdmBase>org.springframework.dao.DataAccessException
public T findById(int id)
throws org.springframework.dao.DataAccessException
findById in interface ICdmEntityDao<T extends CdmBase>org.springframework.dao.DataAccessException
public T findByUuid(UUID uuid)
throws org.springframework.dao.DataAccessException
findByUuid in interface ICdmEntityDao<T extends CdmBase>org.springframework.dao.DataAccessException
public List<T> listByIds(Collection<Integer> ids,
Integer pageSize,
Integer pageNumber,
List<OrderHint> orderHints,
List<String> propertyPaths)
throws org.springframework.dao.DataAccessException
listByIds in interface ICdmEntityDao<T extends CdmBase>org.springframework.dao.DataAccessException
public List<T> list(Collection<UUID> uuids,
Integer pageSize,
Integer pageNumber,
List<OrderHint> orderHints,
List<String> propertyPaths)
throws org.springframework.dao.DataAccessException
list in interface ICdmEntityDao<T extends CdmBase>org.springframework.dao.DataAccessException
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)
public T load(UUID uuid)
ICdmEntityDaouuid parameter and
initializes all its *ToOne relations.
load in interface ICdmEntityDao<T extends CdmBase>
public T load(int id,
List<String> propertyPaths)
ICdmEntityDaopropertyPaths parameter.
For detailed description and examples please refer to:
IBeanInitializer.initialize(Object, List)
load in interface ICdmEntityDao<T extends CdmBase>propertyPaths - properties to be initialized
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 CdmBase>propertyPaths - properties to be initialized
public Boolean exists(UUID uuid)
exists in interface ICdmEntityDao<T extends CdmBase>public int count()
count in interface ICdmEntityDao<T extends CdmBase>public int count(Class<? extends T> clazz)
ICdmEntityDao
count in interface ICdmEntityDao<T extends CdmBase>
public List<T> list(Integer limit,
Integer start)
ICdmEntityDao
list in interface ICdmEntityDao<T extends CdmBase>limit - the maximum number of entities returned (can be null to return all entities)
public List<Object[]> group(Class<? extends T> clazz,
Integer limit,
Integer start,
List<Grouping> groups,
List<String> propertyPaths)
ICdmEntityDao
group in interface ICdmEntityDao<T extends CdmBase>clazz - Restrict the query to objects of a certain class, or null for all objects of type T or subclasseslimit - the maximum number of entities returned (can be null to return
all entities)start - The (0-based) offset from the start of the recordsetgroups - The grouping objects representing a projection, plus an optional ordering on that projected propertypropertyPaths - paths initialized on the returned objects - only applied to the objects returned from the first grouping
protected void countGroups(org.hibernate.criterion.DetachedCriteria criteria,
List<Grouping> groups)
protected void addGroups(org.hibernate.Criteria criteria,
List<Grouping> groups)
protected void addCriteria(org.hibernate.Criteria criteria,
List<org.hibernate.criterion.Criterion> criterion)
protected void addOrder(org.hibernate.search.FullTextQuery fullTextQuery,
List<OrderHint> orderHints)
public List<T> list(Integer limit,
Integer start,
List<OrderHint> orderHints)
ICdmEntityDao
list in interface ICdmEntityDao<T extends CdmBase>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
public List<T> list(Integer limit,
Integer start,
List<OrderHint> orderHints,
List<String> propertyPaths)
ICdmEntityDaopropertyPaths
and recursively initialized for each of the entities in the resultset
For detailed description and examples redarding
propertyPaths please refer to:
IBeanInitializer.initialize(Object, List)
list in interface ICdmEntityDao<T extends CdmBase>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
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 CdmBase>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
public List<T> list(Class<? extends T> type,
Integer limit,
Integer start,
List<OrderHint> orderHints)
public List<T> list(Class<? extends T> type,
Integer limit,
Integer start)
ICdmEntityDao
list in interface ICdmEntityDao<T extends CdmBase>limit - the maximum number of entities returned (can be null to return all entities)
public List<T> rows(String tableName,
int limit,
int start)
rows in interface ICdmEntityDao<T extends CdmBase>public Class<T> getType()
ICdmEntityDao
getType in interface ICdmEntityDao<T extends CdmBase>
protected void setPagingParameter(org.hibernate.Query query,
Integer pageSize,
Integer pageNumber)
protected void setPagingParameter(org.hibernate.envers.query.AuditQuery query,
Integer pageSize,
Integer pageNumber)
public int count(T example,
Set<String> includeProperties)
ICdmEntityDao
count in interface ICdmEntityDao<T extends CdmBase>
protected void addExample(org.hibernate.Criteria criteria,
T example,
Set<String> includeProperties)
protected int countByParam(Class<? extends T> clazz,
String param,
String queryString,
MatchMode matchmode,
List<org.hibernate.criterion.Criterion> criterion)
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 CdmBase>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 | |||||||||