Q
- public abstract class AbstractHibernateSQLQuery<Q extends AbstractHibernateSQLQuery<Q>> extends AbstractSQLQuery<Q>
Modifier and Type | Field and Description |
---|---|
protected Boolean |
cacheable |
protected String |
cacheRegion |
protected int |
fetchSize |
protected Boolean |
readOnly |
protected int |
timeout |
configuration, firstUnionSubQuery, union, unionAll
MDC_PARAMETERS, MDC_QUERY, queryMixin
Constructor and Description |
---|
AbstractHibernateSQLQuery(org.hibernate.Session session,
Configuration conf) |
AbstractHibernateSQLQuery(SessionHolder session,
Configuration conf,
QueryMetadata metadata) |
AbstractHibernateSQLQuery(org.hibernate.StatelessSession session,
Configuration conf) |
Modifier and Type | Method and Description |
---|---|
protected void |
cleanupMDC() |
Q |
clone() |
protected void |
clone(Q query) |
Q |
clone(org.hibernate.Session session) |
protected abstract Q |
clone(SessionHolder session) |
Q |
clone(org.hibernate.StatelessSession statelessSession) |
org.hibernate.Query |
createQuery(Expression<?>... args) |
protected SQLSerializer |
createSerializer() |
<RT> com.mysema.commons.lang.CloseableIterator<RT> |
iterate(Expression<RT> projection)
iterate over the results for the given projection
|
<RT> List<RT> |
list(Expression<RT> projection)
list the results for the given projection
An empty list is returned for no results.
|
<RT> SearchResults<RT> |
listResults(Expression<RT> projection)
list the results for the given projection
|
protected void |
logQuery(String queryString,
Map<Object,String> parameters) |
protected void |
reset() |
Q |
setCacheable(boolean cacheable)
Enable caching of this query result set.
|
Q |
setCacheRegion(String cacheRegion)
Set the name of the cache region.
|
Q |
setFetchSize(int fetchSize)
Set a fetch size for the underlying JDBC query.
|
Q |
setReadOnly(boolean readOnly)
Entities retrieved by this query will be loaded in
a read-only mode where Hibernate will never dirty-check
them or make changes persistent.
|
Q |
setTimeout(int timeout)
Set a timeout for the underlying JDBC query.
|
<RT> RT |
uniqueResult(Expression<RT> expr)
return a unique result for the given projection or null if no result is found
|
extractEntityExpression, isEntityExpression
addFlag, addFlag, addFlag, addFlag, addJoinFlag, addJoinFlag, count, exists, from, from, from, fullJoin, fullJoin, fullJoin, fullJoin, getMetadata, getSQL, innerJoin, innerJoin, innerJoin, innerJoin, iterate, join, join, join, join, leftJoin, leftJoin, leftJoin, leftJoin, list, listResults, on, on, rightJoin, rightJoin, rightJoin, rightJoin, serialize, toString, union, union, union, union, unionAll, unionAll, unionAll, unionAll, uniqueResult, with, with, with, withRecursive, withRecursive, withRecursive
map, notExists, singleResult, singleResult, transform, uniqueResult
distinct, equals, groupBy, groupBy, hashCode, having, having, limit, offset, orderBy, orderBy, restrict, set, where, where
finalize, getClass, notify, notifyAll, wait, wait, wait
distinct, limit, offset, orderBy, restrict, set
where
protected Boolean cacheable
protected Boolean readOnly
protected String cacheRegion
protected int fetchSize
protected int timeout
public AbstractHibernateSQLQuery(org.hibernate.Session session, Configuration conf)
public AbstractHibernateSQLQuery(org.hibernate.StatelessSession session, Configuration conf)
public AbstractHibernateSQLQuery(SessionHolder session, Configuration conf, QueryMetadata metadata)
public org.hibernate.Query createQuery(Expression<?>... args)
protected SQLSerializer createSerializer()
createSerializer
in class ProjectableSQLQuery<Q extends AbstractHibernateSQLQuery<Q>>
public <RT> List<RT> list(Expression<RT> projection)
Projectable
list
in interface Projectable
list
in class ProjectableQuery<Q extends AbstractHibernateSQLQuery<Q>>
RT
- generic type of the Listpublic <RT> com.mysema.commons.lang.CloseableIterator<RT> iterate(Expression<RT> projection)
Projectable
RT
- generic type of the Iteratorpublic <RT> SearchResults<RT> listResults(Expression<RT> projection)
Projectable
protected void cleanupMDC()
protected void reset()
public <RT> RT uniqueResult(Expression<RT> expr)
Projectable
There is some ambiguity for missing results and null valued results, for disambiguation use the list or iterate methods instead.
uniqueResult
in interface Projectable
uniqueResult
in class ProjectableSQLQuery<Q extends AbstractHibernateSQLQuery<Q>>
RT
- return typepublic Q setCacheable(boolean cacheable)
cacheable
- Should the query results be cacheable?public Q setCacheRegion(String cacheRegion)
cacheRegion
- the name of a query cache region, or null
for the default query cachepublic Q setFetchSize(int fetchSize)
fetchSize
- the fetch sizepublic Q setReadOnly(boolean readOnly)
public Q setTimeout(int timeout)
timeout
- the timeout in secondsprotected void clone(Q query)
clone
in class ProjectableSQLQuery<Q extends AbstractHibernateSQLQuery<Q>>
protected abstract Q clone(SessionHolder session)
public Q clone(org.hibernate.Session session)
public Q clone(org.hibernate.StatelessSession statelessSession)
public Q clone()
clone
in class ProjectableSQLQuery<Q extends AbstractHibernateSQLQuery<Q>>
Copyright © 2007–2015 Mysema Ltd. All rights reserved.