Package lumis.portal.dao.hibernate
Class QueryUtil
- java.lang.Object
-
- lumis.portal.dao.hibernate.QueryUtil
-
public class QueryUtil extends Object
Utility methods for manipulating JPA and Hibernate query objects.- Since:
- 14.2.0
- Version:
- $Revision: 24985 $ $Date: 2022-05-02 23:04:30 -0300 (Mon, 02 May 2022) $
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static Query
addDummyQuerySpace(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 Query
createNativeQueryWithDQS(String sqlString)
Creates a JPA native query using the current transaction and adds a dummy query space to it.static Query
createNativeQueryWithDQS(EntityManager em, 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(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, String sqlString)
Creates aSQLQuery
using the given session and adds a dummy query space to it.
-
-
-
Method Detail
-
addDummyQuerySpace
public static Query addDummyQuerySpace(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(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, 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 Query createNativeQueryWithDQS(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 Query createNativeQueryWithDQS(EntityManager em, 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
-
-