|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectedu.internet2.middleware.grouper.hibernate.ByHqlStatic
public class ByHqlStatic
for simple HQL, 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.
Method Summary | ||
---|---|---|
ByHqlStatic |
assignConvertHqlColumnsToObject(boolean theConvert)
if use resulttransformer to change columns to object |
|
ByHqlStatic |
createQuery(java.lang.String theHqlQuery)
set the query to run |
|
void |
executeUpdate()
call hql executeUpdate, e.g. delete or update statement |
|
|
list(java.lang.Class<R> returnType)
call hql list result e.g. |
|
|
listMap(java.lang.Class<K> keyClass,
java.lang.Class<V> valueClass,
java.lang.String keyPropertyName)
call hql list result, and put the results in map with the key as one of the fields |
|
|
listSet(java.lang.Class<S> returnType)
call hql list result, and put the results in an ordered set e.g. |
|
ByHqlStatic |
options(QueryOptions queryOptions1)
add a paging/sorting/resultSetSize, etc to the query |
|
ByHqlStatic |
setCacheable(java.lang.Boolean cacheable)
assign if this query is cacheable or not. |
|
ByHqlStatic |
setCacheRegion(java.lang.String cacheRegion)
cache region for cache |
|
ByHqlStatic |
setCollectionInClause(java.lang.StringBuilder query,
java.util.Collection<?> params)
append a certain number of params, and commas, and attach the data. |
|
ByHqlStatic |
setDouble(java.lang.String bindVarName,
java.lang.Double value)
assign data to the bind var |
|
ByHqlStatic |
setGrouperTransactionType(GrouperTransactionType theGrouperTransactionType)
assign a different grouperTransactionType (e.g. for autonomous transactions) |
|
ByHqlStatic |
setInteger(java.lang.String bindVarName,
java.lang.Integer value)
assign data to the bind var |
|
ByHqlStatic |
setLong(java.lang.String bindVarName,
java.lang.Long value)
assign data to the bind var |
|
ByHqlStatic |
setScalar(java.lang.String bindVarName,
java.lang.Object value)
assign data to the bind var |
|
ByHqlStatic |
setString(java.lang.String bindVarName,
java.lang.String value)
assign data to the bind var |
|
ByHqlStatic |
setTimestamp(java.lang.String bindVarName,
java.util.Date value)
assign data to the bind var |
|
java.lang.String |
toString()
string value for error handling |
|
|
uniqueResult(java.lang.Class<Q> returnType)
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 |
Method Detail |
---|
public ByHqlStatic assignConvertHqlColumnsToObject(boolean theConvert)
theConvert
-
public ByHqlStatic setGrouperTransactionType(GrouperTransactionType theGrouperTransactionType)
theGrouperTransactionType
-
public ByHqlStatic setCacheable(java.lang.Boolean cacheable)
cacheable
- the cacheable to set
public java.lang.String toString()
toString
in class java.lang.Object
public ByHqlStatic createQuery(java.lang.String theHqlQuery)
theHqlQuery
-
public ByHqlStatic setCacheRegion(java.lang.String cacheRegion)
cacheRegion
- the cacheRegion to set
public ByHqlStatic setString(java.lang.String bindVarName, java.lang.String value)
setString
in interface HqlQuery
bindVarName
- value
-
public ByHqlStatic setTimestamp(java.lang.String bindVarName, java.util.Date value)
bindVarName
- value
-
public ByHqlStatic setLong(java.lang.String bindVarName, java.lang.Long value)
bindVarName
- value
- is long, primitive so not null
public ByHqlStatic setDouble(java.lang.String bindVarName, java.lang.Double value)
bindVarName
- value
- is double
public ByHqlStatic setInteger(java.lang.String bindVarName, java.lang.Integer value)
bindVarName
- value
- is long, primitive so not null
public ByHqlStatic setScalar(java.lang.String bindVarName, java.lang.Object value)
setScalar
in interface HqlQuery
bindVarName
- value
- is long, primitive so not null
public ByHqlStatic setCollectionInClause(java.lang.StringBuilder query, java.util.Collection<?> params)
query
- params
- collection of params, note, this is for an inclause, so it cant be null
public <Q> Q uniqueResult(java.lang.Class<Q> returnType) 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);
Q
- is the templatereturnType
- type of the result (in future can use this for typecasting)
GrouperDAOException
public <R> java.util.List<R> list(java.lang.Class<R> returnType) throws GrouperDAOException
call hql list result e.g. Listhib3GroupTypeTupleDAOs = HibernateSession.byHqlStatic() .createQuery("from Hib3GroupTypeTupleDAO as gtt where gtt.groupUuid = :group") .setCacheable(false).setString("group", uuid).list(Hib3GroupTypeTupleDAO.class);
R
- is the templatereturnType
- type of the result (can typecast)
GrouperDAOException
public <S> java.util.Set<S> listSet(java.lang.Class<S> returnType) 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)
GrouperDAOException
public <K,V> java.util.Map<K,V> listMap(java.lang.Class<K> keyClass, java.lang.Class<V> valueClass, java.lang.String keyPropertyName) throws GrouperDAOException
call hql 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)keyClass
- is the type of the key of the mapkeyPropertyName
- name of the javabeans property for the key in the map
GrouperDAOException
public void executeUpdate() throws GrouperDAOException
call hql executeUpdate, e.g. delete or update statement
GrouperDAOException
public ByHqlStatic options(QueryOptions queryOptions1)
queryOptions1
-
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |