Package com.querydsl.jpa.hibernate.sql
Class AbstractHibernateSQLQuery<T,Q extends AbstractHibernateSQLQuery<T,Q>>
- java.lang.Object
-
- com.querydsl.core.support.QueryBase<Q>
-
- com.querydsl.core.support.FetchableQueryBase<T,Q>
-
- com.querydsl.core.support.FetchableSubQueryBase<T,Q>
-
- com.querydsl.sql.ProjectableSQLQuery<T,Q>
-
- com.querydsl.jpa.AbstractSQLQuery<T,Q>
-
- com.querydsl.jpa.hibernate.sql.AbstractHibernateSQLQuery<T,Q>
-
- Type Parameters:
T- result typeQ- concrete subtype
- All Implemented Interfaces:
Fetchable<T>,FetchableQuery<T,Q>,FilteredClause<Q>,Query<Q>,SimpleQuery<Q>,ExtendedSubQuery<T>,Expression<T>,SubQueryExpression<T>,SQLCommonQuery<Q>,java.io.Serializable
- Direct Known Subclasses:
HibernateSQLQuery
public abstract class AbstractHibernateSQLQuery<T,Q extends AbstractHibernateSQLQuery<T,Q>> extends AbstractSQLQuery<T,Q>
AbstractHibernateSQLQueryis the base class for Hibernate Native SQL queries- Author:
- tiwe
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description protected java.lang.Booleancacheableprotected java.lang.StringcacheRegionprotected intfetchSizeprotected java.lang.BooleanreadOnlyprotected inttimeout-
Fields inherited from class com.querydsl.sql.ProjectableSQLQuery
configuration, firstUnionSubQuery, union, unionAll
-
Fields inherited from class com.querydsl.core.support.QueryBase
MDC_PARAMETERS, MDC_QUERY, queryMixin
-
-
Constructor Summary
Constructors Constructor Description AbstractHibernateSQLQuery(SessionHolder session, Configuration conf, QueryMetadata metadata)AbstractHibernateSQLQuery(org.hibernate.Session session, Configuration conf)AbstractHibernateSQLQuery(org.hibernate.StatelessSession session, Configuration conf)
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description Qclone()protected abstract Qclone(SessionHolder session)Qclone(org.hibernate.Session session)Qclone(org.hibernate.StatelessSession statelessSession)protected voidclone(Q query)org.hibernate.query.QuerycreateQuery()protected SQLSerializercreateSerializer()java.util.List<T>fetch()TfetchOne()QueryResults<T>fetchResults()com.mysema.commons.lang.CloseableIterator<T>iterate()protected voidlogQuery(java.lang.String queryString)protected voidreset()QsetCacheable(boolean cacheable)Enable caching of this query result set.QsetCacheRegion(java.lang.String cacheRegion)Set the name of the cache region.QsetFetchSize(int fetchSize)Set a fetchJoin size for the underlying JDBC query.QsetReadOnly(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.QsetTimeout(int timeout)Set a timeout for the underlying JDBC query.java.util.stream.Stream<T>stream()-
Methods inherited from class com.querydsl.jpa.AbstractSQLQuery
extractEntityExpression, isEntityExpression
-
Methods inherited from class com.querydsl.sql.ProjectableSQLQuery
accept, addFlag, addFlag, addFlag, addFlag, addJoinFlag, addJoinFlag, fetchCount, from, from, from, from, from, fullJoin, fullJoin, fullJoin, fullJoin, fullJoin, getSQL, getSQL, innerJoin, innerJoin, innerJoin, innerJoin, innerJoin, join, join, join, join, join, leftJoin, leftJoin, leftJoin, leftJoin, leftJoin, on, on, rightJoin, rightJoin, rightJoin, rightJoin, rightJoin, serialize, toString, union, union, union, unionAll, unionAll, unionAll, with, with, with, withRecursive, withRecursive, withRecursive
-
Methods inherited from class com.querydsl.core.support.FetchableSubQueryBase
contains, contains, eq, eq, exists, getMetadata, getType, goe, goe, gt, gt, hashCode, in, in, isNotNull, isNull, loe, loe, lt, lt, ne, ne, notExists
-
Methods inherited from class com.querydsl.core.support.FetchableQueryBase
equals, fetchFirst, transform, uniqueResult
-
Methods inherited from class com.querydsl.core.support.QueryBase
distinct, groupBy, groupBy, having, having, limit, offset, orderBy, orderBy, restrict, set, where, where
-
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface com.querydsl.core.Fetchable
fetchFirst
-
Methods inherited from interface com.querydsl.core.FetchableQuery
select, select, transform
-
Methods inherited from interface com.querydsl.core.FilteredClause
where
-
-
-
-
Constructor Detail
-
AbstractHibernateSQLQuery
public AbstractHibernateSQLQuery(org.hibernate.Session session, Configuration conf)
-
AbstractHibernateSQLQuery
public AbstractHibernateSQLQuery(org.hibernate.StatelessSession session, Configuration conf)
-
AbstractHibernateSQLQuery
public AbstractHibernateSQLQuery(SessionHolder session, Configuration conf, QueryMetadata metadata)
-
-
Method Detail
-
createQuery
public org.hibernate.query.Query createQuery()
-
createSerializer
protected SQLSerializer createSerializer()
- Specified by:
createSerializerin classProjectableSQLQuery<T,Q extends AbstractHibernateSQLQuery<T,Q>>
-
fetch
public java.util.List<T> fetch()
- Specified by:
fetchin interfaceFetchable<T>- Overrides:
fetchin classFetchableQueryBase<T,Q extends AbstractHibernateSQLQuery<T,Q>>
-
iterate
public com.mysema.commons.lang.CloseableIterator<T> iterate()
-
stream
public java.util.stream.Stream<T> stream()
-
fetchResults
public QueryResults<T> fetchResults()
-
logQuery
protected void logQuery(java.lang.String queryString)
-
reset
protected void reset()
-
fetchOne
public T fetchOne() throws NonUniqueResultException
- Specified by:
fetchOnein interfaceFetchable<T>- Overrides:
fetchOnein classProjectableSQLQuery<T,Q extends AbstractHibernateSQLQuery<T,Q>>- Throws:
NonUniqueResultException
-
setCacheable
public Q setCacheable(boolean cacheable)
Enable caching of this query result set.- Parameters:
cacheable- Should the query results be cacheable?
-
setCacheRegion
public Q setCacheRegion(java.lang.String cacheRegion)
Set the name of the cache region.- Parameters:
cacheRegion- the name of a query cache region, ornullfor the default query cache
-
setFetchSize
public Q setFetchSize(int fetchSize)
Set a fetchJoin size for the underlying JDBC query.- Parameters:
fetchSize- the fetchJoin size
-
setReadOnly
public 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.
-
setTimeout
public Q setTimeout(int timeout)
Set a timeout for the underlying JDBC query.- Parameters:
timeout- the timeout in seconds
-
clone
protected void clone(Q query)
- Overrides:
clonein classProjectableSQLQuery<T,Q extends AbstractHibernateSQLQuery<T,Q>>
-
clone
protected abstract Q clone(SessionHolder session)
-
clone
public Q clone(org.hibernate.Session session)
-
clone
public Q clone(org.hibernate.StatelessSession statelessSession)
-
clone
public Q clone()
- Specified by:
clonein classProjectableSQLQuery<T,Q extends AbstractHibernateSQLQuery<T,Q>>
-
-