Q
- public abstract class AbstractHibernateSQLQuery<Q extends AbstractHibernateSQLQuery<Q> & Query> extends AbstractSQLQuery<Q>
Modifier and Type | Field and Description |
---|---|
protected java.lang.Boolean |
cacheable |
protected java.lang.String |
cacheRegion |
protected Configuration |
configuration |
protected int |
fetchSize |
protected java.lang.Boolean |
readOnly |
protected int |
timeout |
queryMixin, union, unionAll
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 |
---|---|
org.hibernate.Query |
createQuery(Expression<?>... args) |
com.mysema.commons.lang.CloseableIterator<Tuple> |
iterate(Expression<?>... args)
iterate over the results for the given projection
|
<RT> com.mysema.commons.lang.CloseableIterator<RT> |
iterate(Expression<RT> projection)
iterate over the results for the given projection
|
java.util.List<Tuple> |
list(Expression<?>... projection)
list the results for the given projection
An empty list is returned for no results.
|
<RT> java.util.List<RT> |
list(Expression<RT> projection)
list the results for the given projection
An empty list is returned for no results.
|
SearchResults<Tuple> |
listResults(Expression<?>... args)
list the results for the given projection
|
<RT> SearchResults<RT> |
listResults(Expression<RT> projection)
list the results for the given projection
|
protected void |
logQuery(java.lang.String queryString) |
protected void |
reset() |
Q |
setCacheable(boolean cacheable)
Enable caching of this query result set.
|
Q |
setCacheRegion(java.lang.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.
|
protected java.lang.String |
toCountRowsString() |
protected java.lang.String |
toQueryString() |
Tuple |
uniqueResult(Expression<?>... args)
return a unique result for the given projection or null if no result is found
|
<RT> RT |
uniqueResult(Expression<RT> expr)
return a unique result for the given projection or null if no result is found
|
addFlag, addFlag, addFlag, addJoinFlag, addJoinFlag, count, exists, from, from, from, fullJoin, fullJoin, fullJoin, fullJoin, getMetadata, innerJoin, innerJoin, innerJoin, innerJoin, innerUnion, join, join, join, join, leftJoin, leftJoin, leftJoin, leftJoin, on, on, rightJoin, rightJoin, rightJoin, rightJoin, union, union, union, union, unionAll, unionAll, unionAll, unionAll
map, notExists, singleResult, singleResult, transform, uniqueResult
protected java.lang.Boolean cacheable
protected java.lang.Boolean readOnly
protected java.lang.String cacheRegion
protected int fetchSize
protected final Configuration configuration
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)
public java.util.List<Tuple> list(Expression<?>... projection)
Projectable
list
in interface Projectable
list
in class ProjectableQuery<Q extends AbstractHibernateSQLQuery<Q> & Query>
public <RT> java.util.List<RT> list(Expression<RT> projection)
Projectable
list
in interface Projectable
list
in class ProjectableQuery<Q extends AbstractHibernateSQLQuery<Q> & Query>
RT
- generic type of the Listpublic com.mysema.commons.lang.CloseableIterator<Tuple> iterate(Expression<?>... args)
Projectable
public <RT> com.mysema.commons.lang.CloseableIterator<RT> iterate(Expression<RT> projection)
Projectable
RT
- generic type of the Iteratorpublic SearchResults<Tuple> listResults(Expression<?>... args)
Projectable
public <RT> SearchResults<RT> listResults(Expression<RT> projection)
Projectable
protected void logQuery(java.lang.String queryString)
protected void reset()
protected java.lang.String toCountRowsString()
protected java.lang.String toQueryString()
public Tuple uniqueResult(Expression<?>... args)
Projectable
There is some ambiguity for missing results and null valued results, for disambiguation use the list or iterate methods instead.
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.
RT
- return typepublic Q setCacheable(boolean cacheable)
cacheable
- Should the query results be cacheable?public Q setCacheRegion(java.lang.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 secondsCopyright © 2007-2013 Mysema Ltd. All Rights Reserved.