Class BySql
java.lang.Object
edu.internet2.middleware.grouper.hibernate.BySql
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.
-
Field Summary
Modifier and TypeFieldDescriptionstatic int
query count exec queries, used for testing -
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionprotected void
copyFieldsTo
(edu.internet2.middleware.grouper.hibernate.ByQueryBase byQueryBase) copy fields from this to the argumentcreateQuery
(String theHqlQuery) set the query to runint
executeSql
(String sql, List<Object> params) Deprecated.doesnt work with postgres, need to pass in param types explicitly since cant determine them if nullint
executeSql
(String sql, List<Object> params, List<org.hibernate.type.Type> types) execute some sqlprotected HibernateSession
boolean
if we should ignore hooksstatic void
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(...)setGrouperTransactionType
(GrouperTransactionType theGrouperTransactionType) assign a different grouperTransactionType (e.g.edu.internet2.middleware.grouper.hibernate.ByQueryBase
setIgnoreHooks
(boolean theIgnoreHooks) if we should ignore hookstoString()
string value for error handling
-
Field Details
-
queryCountQueries
public static int queryCountQueriesquery count exec queries, used for testing
-
-
Constructor Details
-
BySql
- Parameters:
theHibernateSession
-
-
-
Method Details
-
setGrouperTransactionType
assign a different grouperTransactionType (e.g. for autonomous transactions)- Parameters:
theGrouperTransactionType
-- Returns:
- the same object for chaining
-
toString
string value for error handling -
createQuery
set the query to run- Parameters:
theHqlQuery
-- Returns:
- this object for chaining
-
executeSql
Deprecated.doesnt work with postgres, need to pass in param types explicitly since cant determine them if nullexecute some sql- Parameters:
sql
- can be insert, update, delete, or ddlparams
- prepared statement params- Returns:
- the number of rows affected or 0 for ddl
-
executeSql
execute some sql- Parameters:
sql
- can be insert, update, delete, or ddlparams
- prepared statement paramstypes
-- Returns:
- the number of rows affected or 0 for ddl
-
setIgnoreHooks
public edu.internet2.middleware.grouper.hibernate.ByQueryBase setIgnoreHooks(boolean theIgnoreHooks) if we should ignore hooks- Parameters:
theIgnoreHooks
-- Returns:
- if we should ignore hooks
-
isIgnoreHooks
public boolean isIgnoreHooks()if we should ignore hooks- Returns:
- if we should ignore hooks
-
copyFieldsTo
protected void copyFieldsTo(edu.internet2.middleware.grouper.hibernate.ByQueryBase byQueryBase) copy fields from this to the argument- Parameters:
byQueryBase
-
-
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
-
-