Package lumis.portal.dao.hibernate
Class QueryUtil
- java.lang.Object
-
- lumis.portal.dao.hibernate.QueryUtil
-
public class QueryUtil extends java.lang.Object
Utility methods for manipulating JPA and Hibernate query objects.- Since:
- 14.2.0
- Version:
- $Revision$ $Date$
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static javax.persistence.Query
addDummyQuerySpace(javax.persistence.Query query)
Adds a dummy query space to a JPA query created withEntityManager.createNativeQuery(java.lang.String)
.static org.hibernate.SQLQuery
addDummyQuerySpace(org.hibernate.SQLQuery query)
Adds a dummy query space to a SQLQuery.static javax.persistence.Query
createNativeQueryWithDQS(java.lang.String sqlString)
Creates a JPA native query using the current transaction and adds a dummy query space to it.static javax.persistence.Query
createNativeQueryWithDQS(javax.persistence.EntityManager em, java.lang.String sqlString)
Creates a JPA native query using the given entity manager and adds a dummy query space to it.static org.hibernate.SQLQuery
createSQLQueryWithDQS(java.lang.String sqlString)
Creates aSQLQuery
using the current transaction and adds a dummy query space to it.static org.hibernate.SQLQuery
createSQLQueryWithDQS(org.hibernate.Session session, java.lang.String sqlString)
Creates aSQLQuery
using the given session and adds a dummy query space to it.
-
-
-
Method Detail
-
addDummyQuerySpace
public static javax.persistence.Query addDummyQuerySpace(javax.persistence.Query query)
Adds a dummy query space to a JPA query created withEntityManager.createNativeQuery(java.lang.String)
. This is used to prevent the default behavior of the execution of a change SQL to invalidate all hibernate cache.- Parameters:
query
- the query object.- Returns:
- the query object given.
- Since:
- 14.2.0
-
addDummyQuerySpace
public static org.hibernate.SQLQuery addDummyQuerySpace(org.hibernate.SQLQuery query)
Adds a dummy query space to a SQLQuery. This is used to prevent the default behavior of the execution of a change SQL to invalidate all hibernate cache.- Parameters:
query
- the query object.- Returns:
- the query object given.
- Since:
- 14.2.0
-
createSQLQueryWithDQS
public static org.hibernate.SQLQuery createSQLQueryWithDQS(java.lang.String sqlString)
Creates aSQLQuery
using the current transaction and adds a dummy query space to it.This is used to create a bulk change query that will not invalidate all hibernate cache.
- Parameters:
sqlString
- the SQL.- Returns:
- the query.
- Since:
- 14.2.0
-
createSQLQueryWithDQS
public static org.hibernate.SQLQuery createSQLQueryWithDQS(org.hibernate.Session session, java.lang.String sqlString)
Creates aSQLQuery
using the given session and adds a dummy query space to it.This is used to create a bulk change query that will not invalidate all hibernate cache.
- Parameters:
session
- the Hibernate session.sqlString
- the SQL.- Returns:
- the query.
- Since:
- 14.2.0
-
createNativeQueryWithDQS
public static javax.persistence.Query createNativeQueryWithDQS(java.lang.String sqlString)
Creates a JPA native query using the current transaction and adds a dummy query space to it.This is used to create a bulk change query that will not invalidate all hibernate cache.
- Parameters:
sqlString
- the SQL.- Returns:
- the query.
- Since:
- 14.2.0
-
createNativeQueryWithDQS
public static javax.persistence.Query createNativeQueryWithDQS(javax.persistence.EntityManager em, java.lang.String sqlString)
Creates a JPA native query using the given entity manager and adds a dummy query space to it.This is used to create a bulk change query that will not invalidate all hibernate cache.
- Parameters:
em
- the entity manager.sqlString
- the SQL.- Returns:
- the query.
- Since:
- 14.2.0
-
-