public class HibernateQuery extends Object implements SqlQuery
For more info please see the Tutorials.
| Modifier and Type | Class and Description |
|---|---|
(package private) static class |
HibernateQuery.BatchResultHolder |
| Modifier and Type | Field and Description |
|---|---|
(package private) List<String> |
identities
The collection of all (auto-generated) identities.
|
(package private) Map<String,IdentitySetter> |
identitySetters
The collection of all identities setters.
|
(package private) Map<String,Object> |
identityTypes
The collection of all identities types.
|
(package private) boolean |
logError
The failed SQL command should be logged.
|
(package private) org.slf4j.Logger |
logger
The internal slf4j logger.
|
(package private) org.hibernate.SQLQuery |
query
The Hibernate SQLQuery instance.
|
(package private) org.hibernate.Session |
session
The Hibernate Session instance.
|
| Constructor and Description |
|---|
HibernateQuery(org.hibernate.Session session,
org.hibernate.SQLQuery query)
Creates a new instance of this adapter.
|
| Modifier and Type | Method and Description |
|---|---|
SqlQuery |
addScalar(String columnAlias) |
SqlQuery |
addScalar(String columnAlias,
Object type) |
Object |
callFunction() |
List |
callList() |
Object |
callUnique() |
int |
callUpdate() |
private void |
doIdentitySelect(String identityName)
Runs the select to obtain the value of auto-generated identity.
|
int[] |
executeBatch(String[] statements) |
Object |
getQuery() |
private boolean |
isSetJDBCIdentity() |
List |
list() |
protected SqlProcessorException |
newSqlProcessorException(org.hibernate.HibernateException ex,
String query) |
SqlQuery |
setFirstResult(int firstResult) |
void |
setLogError(boolean logError)
Sets an indicator the failed SQL command should be logged
|
SqlQuery |
setMaxResults(int maxResults) |
SqlQuery |
setOrdered(boolean ordered) |
SqlQuery |
setParameter(String name,
Object val) |
SqlQuery |
setParameter(String name,
Object val,
Object type) |
SqlQuery |
setParameterList(String name,
Object[] vals) |
SqlQuery |
setParameterList(String name,
Object[] vals,
Object type) |
SqlQuery |
setTimeout(int timeout) |
Object |
unique() |
int |
update() |
final org.slf4j.Logger logger
org.hibernate.Session session
org.hibernate.SQLQuery query
Map<String,IdentitySetter> identitySetters
boolean logError
public HibernateQuery(org.hibernate.Session session,
org.hibernate.SQLQuery query)
session - the Hibernate Session instancequery - the Hibernate SQLQuery instancepublic SqlQuery setTimeout(int timeout)
setTimeout in interface SqlQuerypublic SqlQuery setFirstResult(int firstResult)
setFirstResult in interface SqlQuerypublic SqlQuery setMaxResults(int maxResults)
setMaxResults in interface SqlQuerypublic SqlQuery setOrdered(boolean ordered)
setOrdered in interface SqlQuerypublic List list() throws SqlProcessorException
list in interface SqlQuerySqlProcessorExceptionpublic Object unique() throws SqlProcessorException
unique in interface SqlQuerySqlProcessorExceptionpublic int update()
throws SqlProcessorException
update in interface SqlQuerySqlProcessorExceptionprivate boolean isSetJDBCIdentity()
private void doIdentitySelect(String identityName)
identityName - the identity name from the META SQL statementpublic SqlQuery setParameter(String name, Object val) throws SqlProcessorException
setParameter in interface SqlQuerySqlProcessorExceptionpublic SqlQuery setParameter(String name, Object val, Object type) throws SqlProcessorException
setParameter in interface SqlQuerySqlProcessorExceptionpublic SqlQuery setParameterList(String name, Object[] vals) throws SqlProcessorException
setParameterList in interface SqlQuerySqlProcessorExceptionpublic SqlQuery setParameterList(String name, Object[] vals, Object type) throws SqlProcessorException
setParameterList in interface SqlQuerySqlProcessorExceptionpublic List callList() throws SqlProcessorException
callList in interface SqlQuerySqlProcessorExceptionpublic Object callUnique() throws SqlProcessorException
callUnique in interface SqlQuerySqlProcessorExceptionpublic int callUpdate()
throws SqlProcessorException
callUpdate in interface SqlQuerySqlProcessorExceptionpublic Object callFunction() throws SqlProcessorException
callFunction in interface SqlQuerySqlProcessorExceptionpublic int[] executeBatch(String[] statements) throws SqlProcessorException
executeBatch in interface SqlQuerySqlProcessorExceptionprotected SqlProcessorException newSqlProcessorException(org.hibernate.HibernateException ex, String query)
public void setLogError(boolean logError)
setLogError in interface SqlQuerylogError - an indicator the failed SQL command should be loggedCopyright © 2014. All Rights Reserved.