public interface ICdmEntityDao<T extends CdmBase>
Modifier and Type | Method and Description |
---|---|
void |
clear() |
long |
count() |
long |
count(java.lang.Class<? extends T> clazz)
Returns the number of objects of type
|
long |
count(java.lang.Class<? extends T> type,
java.util.List<Restriction<?>> restrictions)
Counts the Cdm entities matching the restrictions defined by
the
parameters propertyName , value and matchMode . |
long |
count(T example,
java.util.Set<java.lang.String> includeProperties)
Method that counts the number of objects matching the example provided.
|
long |
countByParam(java.lang.Class<? extends T> clazz,
java.lang.String param,
java.lang.String queryString,
MatchMode matchmode,
java.util.List<org.hibernate.criterion.Criterion> criterion) |
long |
countByParamWithRestrictions(java.lang.Class<? extends T> clazz,
java.lang.String param,
java.lang.String queryString,
MatchMode matchmode,
java.util.List<Restriction<?>> restrictions) |
java.util.UUID |
delete(T persistentObject) |
java.lang.Boolean |
exists(java.util.UUID uuid) |
T |
findById(int id) |
<S extends T> |
findByParam(java.lang.Class<S> clazz,
java.util.Set<java.lang.String> params,
java.lang.String queryString,
MatchMode matchmode,
java.util.List<org.hibernate.criterion.Criterion> criterion,
java.lang.Integer pageSize,
java.lang.Integer pageNumber,
java.util.List<OrderHint> orderHints,
java.util.List<java.lang.String> propertyPaths) |
<S extends T> |
findByParam(java.lang.Class<S> clazz,
java.lang.String param,
java.lang.String queryString,
MatchMode matchmode,
java.util.List<org.hibernate.criterion.Criterion> criterion,
java.lang.Integer pageSize,
java.lang.Integer pageNumber,
java.util.List<OrderHint> orderHints,
java.util.List<java.lang.String> propertyPaths) |
<S extends T> |
findByParamWithRestrictions(java.lang.Class<S> clazz,
java.lang.String param,
java.lang.String queryString,
MatchMode matchmode,
java.util.List<Restriction<?>> restrictions,
java.lang.Integer pageSize,
java.lang.Integer pageNumber,
java.util.List<OrderHint> orderHints,
java.util.List<java.lang.String> propertyPaths) |
T |
findByUuid(java.util.UUID Uuid) |
T |
findByUuidWithoutFlush(java.util.UUID uuid)
Method to find CDM Entity by Uuid, by making sure that the underlying
hibernate session is not flushed (Session.FLUSH_MODE set to MANUAL temporarily)
when performing the read query.
|
void |
flush()
FIXME Should this method exist : I would expect flushing of a session to be
something that a DAO should hide?
|
org.hibernate.Session |
getSession() |
java.lang.Class<T> |
getType()
Convenience method which makes it easy to discover what type of object this DAO returns at runtime
|
java.util.List<java.lang.Object[]> |
group(java.lang.Class<? extends T> clazz,
java.lang.Integer limit,
java.lang.Integer start,
java.util.List<Grouping> groups,
java.util.List<java.lang.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)
|
<S extends T> |
list(java.lang.Class<S> clazz,
java.util.Collection<java.util.UUID> uuids,
java.lang.Integer pageSize,
java.lang.Integer pageNumber,
java.util.List<OrderHint> orderHints,
java.util.List<java.lang.String> propertyPaths) |
<S extends T> |
list(java.lang.Class<S> type,
java.lang.Integer limit,
java.lang.Integer start)
Returns a sublist of CdmBase instances of type
|
<S extends T> |
list(java.lang.Class<S> type,
java.lang.Integer limit,
java.lang.Integer start,
java.util.List<OrderHint> orderHints,
java.util.List<java.lang.String> propertyPaths)
Returns a sublist of CdmBase instances stored in the database.
|
<S extends T> |
list(java.lang.Class<S> type,
java.util.List<Restriction<?>> restrictions,
java.lang.Integer limit,
java.lang.Integer start,
java.util.List<OrderHint> orderHints,
java.util.List<java.lang.String> propertyPaths)
Returns a list of Cdm entities stored in the database filtered by the restrictions defined by
the
parameters propertyName , value and matchMode
A maximum
of 'limit' objects are returned, starting at object with index 'start'. |
java.util.List<T> |
list(java.util.Collection<java.util.UUID> uuids,
java.lang.Integer pageSize,
java.lang.Integer pageNumber,
java.util.List<OrderHint> orderHints,
java.util.List<java.lang.String> propertyPaths) |
java.util.List<T> |
list(java.lang.Integer limit,
java.lang.Integer start)
Returns a sublist of CdmBase instances stored in the database.
|
java.util.List<T> |
list(java.lang.Integer limit,
java.lang.Integer start,
java.util.List<OrderHint> orderHints)
Returns a sublist of CdmBase instances stored in the database.
|
java.util.List<T> |
list(java.lang.Integer limit,
java.lang.Integer start,
java.util.List<OrderHint> orderHints,
java.util.List<java.lang.String> propertyPaths)
Returns a sublist of CdmBase instances stored in the database.
|
<S extends T> |
list(S example,
java.util.Set<java.lang.String> includeProperties,
java.lang.Integer limit,
java.lang.Integer start,
java.util.List<OrderHint> orderHints,
java.util.List<java.lang.String> propertyPaths)
Method that lists the objects matching the example provided.
|
T |
load(int id,
java.util.List<java.lang.String> propertyPaths)
Finds the cdm entity specified by the id parameter and
recursively initializes all bean properties given in the
propertyPaths parameter. |
T |
load(java.util.UUID uuid)
Finds the cdm entity specified by the
uuid parameter and
initializes all its *ToOne relations. |
T |
load(java.util.UUID uuid,
java.util.List<java.lang.String> propertyPaths)
Finds the cdm entity specified by the
uuid parameter and
recursively initializes all bean properties given in the
propertyPaths parameter. |
java.util.List<T> |
loadList(java.util.Collection<java.lang.Integer> ids,
java.util.List<OrderHint> orderHints,
java.util.List<java.lang.String> propertyPaths) |
void |
lock(T t,
org.hibernate.LockOptions lockOptions)
Obtains the specified LockMode on the supplied object
|
T |
merge(T transientObject) |
MergeResult<T> |
merge(T transientObject,
boolean returnTransientEntity)
This method allows for the possibility of returning the input transient
entity instead of the merged persistent entity
WARNING : This method should never be used when the objective of the merge
is to attach to an existing session which is the standard use case.
|
java.util.UUID |
refresh(T persistentObject) |
void |
refresh(T t,
org.hibernate.LockOptions lockOptions,
java.util.List<java.lang.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.
|
T |
save(T newOrManagedObject) |
java.util.Map<java.util.UUID,T> |
saveAll(java.util.Collection<T> cdmObjCollection) |
java.util.UUID |
saveOrUpdate(T transientObject) |
java.util.Map<java.util.UUID,T> |
saveOrUpdateAll(java.util.Collection<T> cdmObjCollection) |
java.util.UUID |
update(T transientObject) |
java.util.UUID saveOrUpdate(T transientObject) throws org.springframework.dao.DataAccessException
transientObject
- org.springframework.dao.DataAccessException
T save(T newOrManagedObject) throws org.springframework.dao.DataAccessException
newOrManagedObject
- org.springframework.dao.DataAccessException
T merge(T transientObject) throws org.springframework.dao.DataAccessException
org.springframework.dao.DataAccessException
MergeResult<T> merge(T transientObject, boolean returnTransientEntity) throws org.springframework.dao.DataAccessException
transientObject
- returnTransientEntity
- org.springframework.dao.DataAccessException
void lock(T t, org.hibernate.LockOptions lockOptions) throws org.springframework.dao.DataAccessException
t
- lockOptions
- org.springframework.dao.DataAccessException
T replace(T x, T y)
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 nullvoid refresh(T t, org.hibernate.LockOptions lockOptions, java.util.List<java.lang.String> propertyPaths) throws org.springframework.dao.DataAccessException
propertyPaths
parameter are recursively initialized.
For detailed description and examples please refer to:
IBeanInitializer.initialize(Object, List)
t
- lockMode
- propertyPaths
- org.springframework.dao.DataAccessException
void clear() throws org.springframework.dao.DataAccessException
org.springframework.dao.DataAccessException
org.hibernate.Session getSession() throws org.springframework.dao.DataAccessException
org.springframework.dao.DataAccessException
java.util.Map<java.util.UUID,T> saveAll(java.util.Collection<T> cdmObjCollection) throws org.springframework.dao.DataAccessException
org.springframework.dao.DataAccessException
java.util.Map<java.util.UUID,T> saveOrUpdateAll(java.util.Collection<T> cdmObjCollection)
java.util.UUID update(T transientObject) throws org.springframework.dao.DataAccessException
transientObject
- org.springframework.dao.DataAccessException
java.util.UUID refresh(T persistentObject) throws org.springframework.dao.DataAccessException
persistentObject
- org.springframework.dao.DataAccessException
java.util.UUID delete(T persistentObject) throws org.springframework.dao.DataAccessException
persistentObject
- org.springframework.dao.DataAccessException
java.util.List<T> list(java.lang.Integer limit, java.lang.Integer start) throws org.springframework.dao.DataAccessException
limit
- the maximum number of entities returned (can be null to return all entities)start
- org.springframework.dao.DataAccessException
java.util.List<T> list(java.lang.Integer limit, java.lang.Integer start, java.util.List<OrderHint> orderHints)
limit
- the maximum number of entities returned (can be null to return
all entities)start
- orderHints
- Supports path like orderHints.propertyNames
which
include *-to-one properties like createdBy.username or
authorTeam.persistentTitleCacheorg.springframework.dao.DataAccessException
<S extends T> java.util.List<S> list(java.lang.Class<S> type, java.lang.Integer limit, java.lang.Integer start, java.util.List<OrderHint> orderHints, java.util.List<java.lang.String> propertyPaths)
type
- limit
- the maximum number of entities returned (can be null to return
all entities)start
- orderHints
- Supports path like orderHints.propertyNames
which
include *-to-one properties like createdBy.username or
authorTeam.persistentTitleCacheorg.springframework.dao.DataAccessException
java.util.List<T> list(java.lang.Integer limit, java.lang.Integer start, java.util.List<OrderHint> orderHints, java.util.List<java.lang.String> propertyPaths)
propertyPaths
and recursively initialized for each of the entities in the resultset
For detailed description and examples regarding
propertyPaths
please refer to:
IBeanInitializer.initialize(Object, List)
limit
- the maximum number of entities returned (can be null to return
all entities)start
- orderHints
- Supports path like orderHints.propertyNames
which
include *-to-one properties like createdBy.username or
authorTeam.persistentTitleCachepropertyPaths
- org.springframework.dao.DataAccessException
<S extends T> java.util.List<S> list(java.lang.Class<S> type, java.util.List<Restriction<?>> restrictions, java.lang.Integer limit, java.lang.Integer start, java.util.List<OrderHint> orderHints, java.util.List<java.lang.String> propertyPaths)
parameters
propertyName
, value and matchMode
A maximum
of 'limit' objects are returned, starting at object with index 'start'.
The bean properties specified by the parameter propertyPaths
and recursively initialized for each of the entities in the resultset
For detailed description and examples regarding
propertyPaths
please refer to:
IBeanInitializer.initialize(Object, List)
type
- Restrict the query to objects of a certain class, or null for
all objects of type T or subclassesrestrictions
- This defines a filter for multiple properties represented by the map keys. Sine the keys are of the type
Restriction
for each property a single MatchMode is defined. Multiple alternative values
can be supplied per property, that is the values per property are combined with OR. The per property
restrictions are combined with AND.
NOTE: For non string type properties you must use
MatchMode.EXACT
. If set null
MatchMode.EXACT
will be used
as default.limit
- the maximum number of entities returned (can be null to return
all entities)start
- The list of criterion objects representing the restriction to be applied.orderHints
- Supports path like orderHints.propertyNames
which
include *-to-one properties like createdBy.username or
authorTeam.persistentTitleCachepropertyPaths
- org.springframework.dao.DataAccessException
long count(java.lang.Class<? extends T> type, java.util.List<Restriction<?>> restrictions)
parameters
propertyName
, value and matchMode
.type
- Restrict the query to objects of a certain class, or null for
all objects of type T or subclassesrestrictions
- This defines a filter for multiple properties represented by the map keys. Sine the keys are of the type
Restriction
for each property a single MatchMode is defined. Multiple alternative values
can be supplied per property, that is the values per property are combined with OR. The per property
restrictions are combined with AND.
NOTE: For non string type properties you must use
MatchMode.EXACT
. If set null
MatchMode.EXACT
will be used
as default.criteria
- The list of criterion objects representing the restriction to be applied.<S extends T> java.util.List<S> list(java.lang.Class<S> type, java.lang.Integer limit, java.lang.Integer start) throws org.springframework.dao.DataAccessException
limit
- the maximum number of entities returned (can be null to return all entities)start
- org.springframework.dao.DataAccessException
java.util.List<java.lang.Object[]> group(java.lang.Class<? extends T> clazz, java.lang.Integer limit, java.lang.Integer start, java.util.List<Grouping> groups, java.util.List<java.lang.String> propertyPaths)
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 groupingT findById(int id) throws org.springframework.dao.DataAccessException
id
- org.springframework.dao.DataAccessException
T load(int id, java.util.List<java.lang.String> propertyPaths)
propertyPaths
parameter.
For detailed description and examples please refer to:
IBeanInitializer.initialize(Object, List)
id
- propertyPaths
- properties to be initializedjava.util.List<T> loadList(java.util.Collection<java.lang.Integer> ids, java.util.List<OrderHint> orderHints, java.util.List<java.lang.String> propertyPaths) throws org.springframework.dao.DataAccessException
ids
- propertyPaths
- org.springframework.dao.DataAccessException
T findByUuid(java.util.UUID Uuid) throws org.springframework.dao.DataAccessException
Uuid
- org.springframework.dao.DataAccessException
T findByUuidWithoutFlush(java.util.UUID uuid) throws org.springframework.dao.DataAccessException
Uuid
- org.springframework.dao.DataAccessException
java.util.List<T> list(java.util.Collection<java.util.UUID> uuids, java.lang.Integer pageSize, java.lang.Integer pageNumber, java.util.List<OrderHint> orderHints, java.util.List<java.lang.String> propertyPaths) throws org.springframework.dao.DataAccessException
uuids
- pageSize
- pageNumber
- orderHints
- propertyPaths
- org.springframework.dao.DataAccessException
<S extends T> java.util.List<S> list(java.lang.Class<S> clazz, java.util.Collection<java.util.UUID> uuids, java.lang.Integer pageSize, java.lang.Integer pageNumber, java.util.List<OrderHint> orderHints, java.util.List<java.lang.String> propertyPaths) throws org.springframework.dao.DataAccessException
clazz
- uuids
- pageSize
- pageNumber
- orderHints
- propertyPaths
- org.springframework.dao.DataAccessException
T load(java.util.UUID uuid)
uuid
parameter and
initializes all its *ToOne relations.uuid
- T load(java.util.UUID uuid, java.util.List<java.lang.String> propertyPaths)
uuid
parameter and
recursively initializes all bean properties given in the
propertyPaths
parameter.
For detailed description and examples please refer to:
IBeanInitializer.initialize(Object, List)
uuid
- propertyPaths
- properties to be initializedjava.lang.Boolean exists(java.util.UUID uuid) throws org.springframework.dao.DataAccessException
uuid
- org.springframework.dao.DataAccessException
long count()
long count(java.lang.Class<? extends T> clazz)
T
- clazz
- void flush()
java.lang.Class<T> getType()
long count(T example, java.util.Set<java.lang.String> includeProperties)
example
- includeProperties
- <S extends T> java.util.List<S> list(S example, java.util.Set<java.lang.String> includeProperties, java.lang.Integer limit, java.lang.Integer start, java.util.List<OrderHint> orderHints, java.util.List<java.lang.String> propertyPaths)
example
- includeProperties
- 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<S extends T> java.util.List<S> findByParamWithRestrictions(java.lang.Class<S> clazz, java.lang.String param, java.lang.String queryString, MatchMode matchmode, java.util.List<Restriction<?>> restrictions, java.lang.Integer pageSize, java.lang.Integer pageNumber, java.util.List<OrderHint> orderHints, java.util.List<java.lang.String> propertyPaths)
long countByParamWithRestrictions(java.lang.Class<? extends T> clazz, java.lang.String param, java.lang.String queryString, MatchMode matchmode, java.util.List<Restriction<?>> restrictions)
long countByParam(java.lang.Class<? extends T> clazz, java.lang.String param, java.lang.String queryString, MatchMode matchmode, java.util.List<org.hibernate.criterion.Criterion> criterion)
<S extends T> java.util.List<S> findByParam(java.lang.Class<S> clazz, java.lang.String param, java.lang.String queryString, MatchMode matchmode, java.util.List<org.hibernate.criterion.Criterion> criterion, java.lang.Integer pageSize, java.lang.Integer pageNumber, java.util.List<OrderHint> orderHints, java.util.List<java.lang.String> propertyPaths)
<S extends T> java.util.List<S> findByParam(java.lang.Class<S> clazz, java.util.Set<java.lang.String> params, java.lang.String queryString, MatchMode matchmode, java.util.List<org.hibernate.criterion.Criterion> criterion, java.lang.Integer pageSize, java.lang.Integer pageNumber, java.util.List<OrderHint> orderHints, java.util.List<java.lang.String> propertyPaths)
clazz
- params
- queryString
- matchmode
- criterion
- pageSize
- pageNumber
- orderHints
- propertyPaths
- Copyright © 2007-2020 EDIT. All Rights Reserved.