Class ByObjectStatic
java.lang.Object
edu.internet2.middleware.grouper.hibernate.ByObjectStatic
for simple object 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.
-
Method Summary
Modifier and TypeMethodDescriptionprotected void
copyFieldsTo
(edu.internet2.middleware.grouper.hibernate.ByQueryBase byQueryBase) copy field to, better by a ByObject...void
call hibernate method "delete" on a list of objects HibernateSession.byObjectStatic().delete(Rosetta.getDAO(_f));void
delete
(Collection<?> collection) call hibernate method "delete" on a list of objects HibernateSession.byObjectStatic().delete(collection);void
deleteBatch
(Collection<?> collection) call hibernate method "delete" on a list of objects HibernateSession.byObjectStatic().deleteBatch(Rosetta.getDAO(_f));protected HibernateSession
boolean
if we should ignore hooks<T> T
load
(Class<T> theClass, Serializable id) call hibernate "load" method on an objectstatic void
call hibernate method "save" on an object HibernateSession.byObjectStatic().save(dao);void
save
(Collection<?> collection) call hibernate method "save" on a list of objects HibernateSession.byObjectStatic().save(collection);void
saveBatch
(Collection<?> collection) call hibernate method "save" on a collection of objects in batchvoid
saveOrUpdate
(Object object) call hibernate "saveOrUpdate" method on an objectvoid
saveOrUpdate
(Collection<?> collection) call hibernate method "saveOrUpdate" on a list of objects HibernateSession.byObjectStatic().saveOrUpdate(collection);protected edu.internet2.middleware.grouper.hibernate.ByQueryBase
set
(HibernateSession theHibernateSession2) set the hibernate session to re-use, or null for a new one byCriteriaStatic().set(hibernateSession2).select(...)setCacheable
(Boolean cacheable) assign if this query is cacheable or not.setCacheRegion
(String cacheRegion) cache region for cachesetEntityName
(String theEntityName) entity name if the object is mapped to more than one tablesetGrouperTransactionType
(GrouperTransactionType theGrouperTransactionType) assign a different grouperTransactionType (e.g.setIgnoreHooks
(boolean theIgnoreHooks) if we should ignore hookstoString()
string value for error handlingvoid
call hibernate "update" method on an objectvoid
update
(Collection<?> collection) call hibernate method "update" on a list of objects HibernateSession.byObjectStatic().update(collection);void
updateBatch
(Collection<?> collection) call hibernate method "updateBatch" on a list of objects HibernateSession.byObjectStatic().updateBatch(collection);
-
Method Details
-
setGrouperTransactionType
assign a different grouperTransactionType (e.g. for autonomous transactions)- Parameters:
theGrouperTransactionType
-- Returns:
- the same object for chaining
-
setCacheable
assign if this query is cacheable or not.- Parameters:
cacheable
- the cacheable to set- Returns:
- this object for chaining
-
toString
string value for error handling -
setCacheRegion
cache region for cache- Parameters:
cacheRegion
- the cacheRegion to set- Returns:
- this object for chaining
-
setEntityName
entity name if the object is mapped to more than one table- Parameters:
theEntityName
- the entity name of the object- Returns:
- this object for chaining
-
update
call hibernate method "update" on a list of objects HibernateSession.byObjectStatic().update(collection);
- Parameters:
collection
- is collection of objects to update in one transaction. If null or empty just ignore- Throws:
GrouperDAOException
-
update
call hibernate "update" method on an object- Parameters:
object
- to update- Throws:
GrouperDAOException
-
load
call hibernate "load" method on an object- Type Parameters:
T
-- Parameters:
theClass
- to loadid
-- Returns:
- the object
- Throws:
GrouperDAOException
-
saveOrUpdate
call hibernate method "saveOrUpdate" on a list of objects HibernateSession.byObjectStatic().saveOrUpdate(collection);
- Parameters:
collection
- is collection of objects to saveOrUpdate in one transaction. If null or empty just ignore- Throws:
GrouperDAOException
-
saveOrUpdate
call hibernate "saveOrUpdate" method on an object- Parameters:
object
- to update- Throws:
GrouperDAOException
-
save
call hibernate method "save" on a list of objects HibernateSession.byObjectStatic().save(collection);
- Parameters:
collection
- is collection of objects to save in one transaction. If null or empty just ignore- Throws:
GrouperDAOException
-
save
call hibernate method "save" on an object HibernateSession.byObjectStatic().save(dao);
- Parameters:
object
- to save- Returns:
- the id
- Throws:
GrouperDAOException
-
saveBatch
call hibernate method "save" on a collection of objects in batch
- Parameters:
collection
- of objects- Throws:
GrouperDAOException
-
delete
call hibernate method "delete" on a list of objects HibernateSession.byObjectStatic().delete(collection);
- Parameters:
collection
- is collection of objects to delete in one transaction. If null or empty just ignore- Throws:
GrouperDAOException
-
copyFieldsTo
protected void copyFieldsTo(edu.internet2.middleware.grouper.hibernate.ByQueryBase byQueryBase) copy field to, better by a ByObject... -
delete
call hibernate method "delete" on a list of objects HibernateSession.byObjectStatic().delete(Rosetta.getDAO(_f));
- Parameters:
object
- is an object (if collection will still work), if null, will probably throw exception- Throws:
GrouperDAOException
-
deleteBatch
call hibernate method "delete" on a list of objects HibernateSession.byObjectStatic().deleteBatch(Rosetta.getDAO(_f));
- Parameters:
collection
- is an object (if collection will still work), if null, will probably throw exception- Throws:
GrouperDAOException
-
setIgnoreHooks
if we should ignore hooks- Returns:
- if we should ignore hooks
- See Also:
-
ByQueryBase.setIgnoreHooks(boolean)
-
updateBatch
call hibernate method "updateBatch" on a list of objects HibernateSession.byObjectStatic().updateBatch(collection);
- Parameters:
collection
- is collection of objects to update in one transaction. If null or empty just ignore- Throws:
GrouperDAOException
-
isIgnoreHooks
public boolean isIgnoreHooks()if we should ignore hooks- Returns:
- if we should ignore hooks
-
getHibernateSession
- Returns:
- Returns the hibernateSession.
-
set
protected edu.internet2.middleware.grouper.hibernate.ByQueryBase set(HibernateSession theHibernateSession2) set the hibernate session to re-use, or null for a new one byCriteriaStatic().set(hibernateSession2).select(...)- Parameters:
theHibernateSession2
- is the session to reuse- Returns:
- this for chaining
-
main
- Parameters:
args
-
-