public class ByCriteriaStatic extends Object
Modifier and Type | Field and Description |
---|---|
static int |
queryCountQueries
query count exec queries, used for testing
|
Modifier and Type | Method and Description |
---|---|
<T> List<T> |
list(Class<T> returnType,
org.hibernate.criterion.Criterion theCriterions)
call hql unique result (returns one or null)
e.g.
|
<K,V> Map<K,V> |
listMap(Class<K> keyClass,
Class<V> valueClass,
org.hibernate.criterion.Criterion theCriterions,
String keyPropertyName)
call criteria list result, and put the results in map with the key as one of the fields
|
<S> Set<S> |
listSet(Class<S> returnType,
org.hibernate.criterion.Criterion theCriterions)
call hql list result, and put the results in an ordered set
e.g.
|
ByCriteriaStatic |
options(QueryOptions queryOptions1)
add a paging/sorting/resultSetSize, etc to the query
|
ByCriteriaStatic |
setAlias(String theAlias)
alias for queried class
|
ByCriteriaStatic |
setCacheable(Boolean cacheable)
assign if this query is cacheable or not.
|
ByCriteriaStatic |
setCacheRegion(String cacheRegion)
cache region for cache
|
ByCriteriaStatic |
setEntityName(String theEntityName)
entity name if the object is mapped to more than one table
|
ByCriteriaStatic |
setGrouperTransactionType(GrouperTransactionType theGrouperTransactionType)
assign a different grouperTransactionType (e.g.
|
String |
toString()
string value for error handling
|
<T> T |
uniqueResult(Class<T> returnType,
org.hibernate.criterion.Criterion theCriterions)
call hql unique result (returns one or null)
e.g.
|
public static int queryCountQueries
public ByCriteriaStatic setGrouperTransactionType(GrouperTransactionType theGrouperTransactionType)
theGrouperTransactionType
- public ByCriteriaStatic setCacheable(Boolean cacheable)
cacheable
- the cacheable to setpublic <S> Set<S> listSet(Class<S> returnType, org.hibernate.criterion.Criterion theCriterions) throws GrouperDAOException
call hql list result, and put the results in an ordered set e.g. SetgroupTypeTupleDTOs = HibernateSession.byHqlStatic() .createQuery("from Hib3GroupTypeTupleDAO as gtt where gtt.groupUuid = :group") .setCacheable(false).setString("group", uuid).listSet(Hib3GroupTypeTupleDAO.class);
S
- is the templatereturnType
- type of the result (can typecast)theCriterions
- GrouperDAOException
public <K,V> Map<K,V> listMap(Class<K> keyClass, Class<V> valueClass, org.hibernate.criterion.Criterion theCriterions, String keyPropertyName) throws GrouperDAOException
call criteria list result, and put the results in map with the key as one of the fields
K
- is the template of the key of the mapV
- is the template of the value of the mapvalueClass
- type of the result (can typecast)theCriterions
- are the criteria for the querykeyClass
- is the type of the key of the mapkeyPropertyName
- name of the javabeans property for the key in the mapGrouperDAOException
public String toString()
public ByCriteriaStatic options(QueryOptions queryOptions1)
queryOptions1
- public ByCriteriaStatic setCacheRegion(String cacheRegion)
cacheRegion
- the cacheRegion to setpublic ByCriteriaStatic setAlias(String theAlias)
theAlias
- the cacheRegion to setpublic <T> T uniqueResult(Class<T> returnType, org.hibernate.criterion.Criterion theCriterions) throws GrouperDAOException
call hql unique result (returns one or null) e.g. Hib3GroupDAO hib3GroupDAO = HibernateSession.byHqlStatic() .createQuery("from Hib3GroupDAO as g where g.uuid = :uuid") .setCacheable(false) .setCacheRegion(KLASS + ".Exists") .setString("uuid", uuid).uniqueResult(Hib3GroupDAO.class);
T
- is the templatereturnType
- type of the result (in future can use this for typecasting)theCriterions
- are the criterions to use (pack multiple with HibUtils.listCrit())GrouperDAOException
public <T> List<T> list(Class<T> returnType, org.hibernate.criterion.Criterion theCriterions) throws GrouperDAOException
call hql unique result (returns one or null) e.g. Listhib3GroupTypeTupleDAOs = HibernateSession.byHqlStatic() .createQuery("from Hib3GroupTypeTupleDAO as gtt where gtt.groupUuid = :group") .setCacheable(false).setString("group", uuid).list(Hib3GroupTypeTupleDAO.class);
T
- is the templatereturnType
- type of the result (can typecast)theCriterions
- are the criterions to use (pack multiple with HibUtils.listCrit())GrouperDAOException
public ByCriteriaStatic setEntityName(String theEntityName)
theEntityName
- the entity name of the objectCopyright © 2016 Internet2. All rights reserved.