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 int |
fetchSize |
protected java.lang.Boolean |
readOnly |
protected SQLTemplates |
templates |
protected int |
timeout |
protected Expression<?> |
union |
queryMixin
Constructor and Description |
---|
AbstractHibernateSQLQuery(SessionHolder session,
SQLTemplates sqlTemplates,
QueryMetadata metadata) |
AbstractHibernateSQLQuery(org.hibernate.Session session,
SQLTemplates sqlTemplates) |
AbstractHibernateSQLQuery(org.hibernate.StatelessSession session,
SQLTemplates sqlTemplates) |
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() |
<RT> Union<RT> |
union(ListSubQuery<RT>... sq) |
<RT> Q |
union(Path<?> alias,
ListSubQuery<RT>... sq) |
<RT> Q |
union(Path<?> alias,
SubQueryExpression<RT>... sq) |
<RT> Union<RT> |
union(SubQueryExpression<RT>... sq) |
<RT> Union<RT> |
unionAll(ListSubQuery<RT>... sq) |
<RT> Q |
unionAll(Path<?> alias,
ListSubQuery<RT>... sq) |
<RT> Q |
unionAll(Path<?> alias,
SubQueryExpression<RT>... sq) |
<RT> Union<RT> |
unionAll(SubQueryExpression<RT>... sq) |
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, join, join, join, join, leftJoin, leftJoin, leftJoin, leftJoin, on, on, rightJoin, rightJoin, rightJoin, rightJoin
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 SQLTemplates templates
protected int timeout
@Nullable protected Expression<?> union
public AbstractHibernateSQLQuery(org.hibernate.Session session, SQLTemplates sqlTemplates)
public AbstractHibernateSQLQuery(org.hibernate.StatelessSession session, SQLTemplates sqlTemplates)
public AbstractHibernateSQLQuery(SessionHolder session, SQLTemplates sqlTemplates, 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 <RT> Union<RT> union(ListSubQuery<RT>... sq)
public <RT> Union<RT> union(SubQueryExpression<RT>... sq)
public <RT> Union<RT> unionAll(ListSubQuery<RT>... sq)
public <RT> Union<RT> unionAll(SubQueryExpression<RT>... sq)
public <RT> Q union(Path<?> alias, ListSubQuery<RT>... sq)
public <RT> Q union(Path<?> alias, SubQueryExpression<RT>... sq)
public <RT> Q unionAll(Path<?> alias, ListSubQuery<RT>... sq)
public <RT> Q unionAll(Path<?> alias, SubQueryExpression<RT>... sq)
public 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.