|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.sqlproc.engine.hibernate.HibernateQuery
public class HibernateQuery
The Hibernate stack implementation of the SQL Engine query contract. In fact it's an adapter the internal Hibernate stuff.
For more info please see the Tutorials.
| Nested Class Summary | |
|---|---|
(package private) static class |
HibernateQuery.BatchResultHolder
|
| Field Summary | |
|---|---|
(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 Summary | |
|---|---|
HibernateQuery(org.hibernate.Session session,
org.hibernate.SQLQuery query)
Creates a new instance of this adapter. |
|
| Method Summary | |
|---|---|
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()
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
final org.slf4j.Logger logger
org.hibernate.Session session
org.hibernate.SQLQuery query
List<String> identities
Map<String,IdentitySetter> identitySetters
Map<String,Object> identityTypes
boolean logError
| Constructor Detail |
|---|
public HibernateQuery(org.hibernate.Session session,
org.hibernate.SQLQuery query)
session - the Hibernate Session instancequery - the Hibernate SQLQuery instance| Method Detail |
|---|
public Object getQuery()
getQuery in interface SqlQuerypublic 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 SqlQuery
public List list()
throws SqlProcessorException
list in interface SqlQuerySqlProcessorException
public Object unique()
throws SqlProcessorException
unique in interface SqlQuerySqlProcessorException
public 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 addScalar(String columnAlias)
addScalar in interface SqlQuery
public SqlQuery addScalar(String columnAlias,
Object type)
addScalar in interface SqlQuery
public SqlQuery setParameter(String name,
Object val)
throws SqlProcessorException
setParameter in interface SqlQuerySqlProcessorException
public SqlQuery setParameter(String name,
Object val,
Object type)
throws SqlProcessorException
setParameter in interface SqlQuerySqlProcessorException
public SqlQuery setParameterList(String name,
Object[] vals)
throws SqlProcessorException
setParameterList in interface SqlQuerySqlProcessorException
public SqlQuery setParameterList(String name,
Object[] vals,
Object type)
throws SqlProcessorException
setParameterList in interface SqlQuerySqlProcessorException
public List callList()
throws SqlProcessorException
callList in interface SqlQuerySqlProcessorException
public Object callUnique()
throws SqlProcessorException
callUnique in interface SqlQuerySqlProcessorException
public int callUpdate()
throws SqlProcessorException
callUpdate in interface SqlQuerySqlProcessorException
public Object callFunction()
throws SqlProcessorException
callFunction in interface SqlQuerySqlProcessorException
public int[] executeBatch(String[] statements)
throws SqlProcessorException
executeBatch in interface SqlQuerySqlProcessorException
protected 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 logged
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||