|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectedu.internet2.middleware.grouper.hibernate.ByCriteriaStatic
public class ByCriteriaStatic
for simple criteria queries, use this instead of inverse of control. this will do proper error handling and descriptive exception handling. This will by default use the transaction modes GrouperTransactionType.READONLY_OR_USE_EXISTING, and GrouperTransactionType.READ_WRITE_OR_USE_EXISTING depending on if a transaction is needed.
Field Summary | |
---|---|
static int |
queryCountQueries
query count exec queries, used for testing |
Method Summary | ||
---|---|---|
|
list(java.lang.Class<T> returnType,
org.hibernate.criterion.Criterion theCriterions)
call hql unique result (returns one or null) e.g. |
|
|
listMap(java.lang.Class<K> keyClass,
java.lang.Class<V> valueClass,
org.hibernate.criterion.Criterion theCriterions,
java.lang.String keyPropertyName)
call criteria list result, and put the results in map with the key as one of the fields |
|
|
listSet(java.lang.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(java.lang.String theAlias)
alias for queried class |
|
ByCriteriaStatic |
setCacheable(java.lang.Boolean cacheable)
assign if this query is cacheable or not. |
|
ByCriteriaStatic |
setCacheRegion(java.lang.String cacheRegion)
cache region for cache |
|
ByCriteriaStatic |
setEntityName(java.lang.String theEntityName)
entity name if the object is mapped to more than one table |
|
ByCriteriaStatic |
setGrouperTransactionType(GrouperTransactionType theGrouperTransactionType)
assign a different grouperTransactionType (e.g. for autonomous transactions) |
|
java.lang.String |
toString()
string value for error handling |
|
|
uniqueResult(java.lang.Class<T> returnType,
org.hibernate.criterion.Criterion theCriterions)
call hql unique result (returns one or null) e.g. |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public static int queryCountQueries
Method Detail |
---|
public ByCriteriaStatic setGrouperTransactionType(GrouperTransactionType theGrouperTransactionType)
theGrouperTransactionType
-
public ByCriteriaStatic setCacheable(java.lang.Boolean cacheable)
cacheable
- the cacheable to set
public <S> java.util.Set<S> listSet(java.lang.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> java.util.Map<K,V> listMap(java.lang.Class<K> keyClass, java.lang.Class<V> valueClass, org.hibernate.criterion.Criterion theCriterions, java.lang.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 map
GrouperDAOException
public java.lang.String toString()
toString
in class java.lang.Object
public ByCriteriaStatic options(QueryOptions queryOptions1)
queryOptions1
-
public ByCriteriaStatic setCacheRegion(java.lang.String cacheRegion)
cacheRegion
- the cacheRegion to set
public ByCriteriaStatic setAlias(java.lang.String theAlias)
theAlias
- the cacheRegion to set
public <T> T uniqueResult(java.lang.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> java.util.List<T> list(java.lang.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(java.lang.String theEntityName)
theEntityName
- the entity name of the object
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |