Class DBQuery<T>
- 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.jpa.JPAQueryBase<T,Q>
-
- com.querydsl.jpa.impl.AbstractJPAQuery<T,DBQuery<T>>
-
- org.cyclos.impl.utils.persistence.DBQuery<T>
-
- All Implemented Interfaces:
com.querydsl.core.Fetchable<T>,com.querydsl.core.FetchableQuery<T,com.querydsl.jpa.JPQLQuery<T>>,com.querydsl.core.FilteredClause<com.querydsl.jpa.JPQLQuery<T>>,com.querydsl.core.Query<com.querydsl.jpa.JPQLQuery<T>>,com.querydsl.core.SimpleQuery<com.querydsl.jpa.JPQLQuery<T>>,com.querydsl.core.support.ExtendedSubQuery<T>,com.querydsl.core.types.Expression<T>,com.querydsl.core.types.SubQueryExpression<T>,com.querydsl.jpa.JPQLQuery<T>,Serializable
public class DBQuery<T> extends com.querydsl.jpa.impl.AbstractJPAQuery<T,DBQuery<T>>
Custom query for Querydsl- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description DBQuery(javax.persistence.EntityManager entityManager, com.querydsl.jpa.JPQLTemplates templates, ConversionHandler conversionHandler, SessionData sessionData)Creates a new EntityManager bound query
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description DBQuery<T>clone(javax.persistence.EntityManager entityManager)DBQuery<T>clone(javax.persistence.EntityManager entityManager, com.querydsl.jpa.JPQLTemplates templates)intcount()Deprecated.intcount(com.querydsl.core.types.dsl.NumberPath<?> path)Counts the number of rows using the id path as baseprotected javax.persistence.QuerycreateQuery(com.querydsl.core.QueryModifiers modifiers, boolean forCount)com.mysema.commons.lang.CloseableIterator<T>export()Iterates over results for exporting data.com.mysema.commons.lang.CloseableIterator<com.querydsl.core.Tuple>export(com.querydsl.core.types.Expression<?>... projections)Iterates over results for exporting data with a tuple projection.<RT> com.mysema.commons.lang.CloseableIterator<RT>export(com.querydsl.core.types.Expression<RT> projection)Iterates over results for exporting data with a given projection.<RT> com.mysema.commons.lang.CloseableIterator<RT>export(Class<RT> resultType, com.querydsl.core.types.Expression<?> projection)Iterates over results for exporting data converting each result.DBQuery<T>fetchJoin()Deprecated.Set<T>fetchSet()Returns the results with current projection as a setSessionDatagetSessionData()booleanhasEmptyResults()Returns whether the execution of this query yields zero rowsbooleanhasResults()Returns whether the execution of this query yields at least one rowDBQuery<T>ignoreMaxResults()Deprecated.This method will be removed in 4.17.DBQuery<T>innerFetchHint(com.querydsl.core.types.Path<?>... path)Set the hint to fetch relationships with inner joinbooleanisIgnoreMaxResults()Deprecated.This method will be removed in 4.17.com.mysema.commons.lang.CloseableIterator<T>iterate()Iterates over all results, without applying any limit.com.mysema.commons.lang.CloseableIterator<com.querydsl.core.Tuple>iterate(com.querydsl.core.types.Expression<?>... projections)Iterates over all results for a given tuple projection, without applying any limit.<RT> com.mysema.commons.lang.CloseableIterator<RT>iterate(com.querydsl.core.types.Expression<RT> projection)Iterates over all results with a given projection, without applying any limit.<RT> com.mysema.commons.lang.CloseableIterator<RT>iterate(Class<RT> resultType, com.querydsl.core.types.Expression<?> projection)Iterates over all results converting each result, without applying any limit.DBQuery<T>leftFetchHint(com.querydsl.core.types.Path<?>... path)Set the hint to fetch relationships with left joinList<com.querydsl.core.Tuple>list(com.querydsl.core.types.Expression<?>... projections)Returns a list of tuples<RT> List<RT>list(com.querydsl.core.types.Expression<RT> projection)Returns a list<RT> List<RT>list(Class<RT> resultType, com.querydsl.core.types.Expression<?> expr)Returns a list converted into the given type<K,V>
Map<K,V>map(com.querydsl.core.types.Expression<K> keyExpr, com.querydsl.core.types.Expression<V> valueExpr)Returns the results as a Map, with an expression as key and the other one as value<RT> Page<RT>page(Class<RT> resultType, Integer currentPage, Integer pageSize, boolean skipTotalCount, com.querydsl.core.types.Expression<?> expr)Executes a paged search, converted into the given type, based on the default page size<RT> Page<RT>page(Class<RT> resultType, QueryParameters queryParameters, com.querydsl.core.types.Expression<?> expr)Returns a paged search, getting page parameters from the givenQueryParameters, converting the result<RT> Page<RT>page(Integer currentPage, Integer pageSize, boolean skipTotalCount, com.querydsl.core.types.Expression<RT> expr)Executes a paged search<RT> Page<RT>page(QueryParameters queryParameters, com.querydsl.core.types.Expression<RT> expr)Returns a paged search, getting page parameters from the givenQueryParameters<RT> RTrequiredUniqueResult(com.querydsl.core.types.Expression<RT> expr)Makes sure that the result is unique.<RT> RTrequiredUniqueResult(Class<RT> resultType, com.querydsl.core.types.Expression<?> expr)Returns the result ofrequiredUniqueResult(Expression)converted into the given resultTypeDBQuery<com.querydsl.core.Tuple>select(com.querydsl.core.types.Expression<?>... exprs)<U> DBQuery<U>select(com.querydsl.core.types.Expression<U> expr)Set<com.querydsl.core.Tuple>set(com.querydsl.core.types.Expression<?>... projections)Returns a set of tuples<RT> Set<RT>set(com.querydsl.core.types.Expression<RT> projection)Returns a set<RT> Set<RT>set(Class<RT> resultType, com.querydsl.core.types.Expression<?> expr)Returns a set converted into the given typevoidsetIgnoreMaxResults(boolean ignoreMaxResults)Deprecated.This method will be removed in 4.17.com.querydsl.core.TuplesingleResult(com.querydsl.core.types.Expression<?>... exprs)Returns the first result as a Tuple<RT> RTsingleResult(com.querydsl.core.types.Expression<RT> expr)Returns the first result<RT> RTsingleResult(Class<RT> resultType, com.querydsl.core.types.Expression<?> expr)Returns the first result in the query, converted into the given type, or null if no records foundStream<T>stream()Returns the results with current projection as a streamStream<com.querydsl.core.Tuple>stream(com.querydsl.core.types.Expression<?>... projections)Returns a stream<RT> Stream<RT>stream(com.querydsl.core.types.Expression<RT> projection)Returns a stream-
Methods inherited from class com.querydsl.jpa.impl.AbstractJPAQuery
cleanupMDC, clone, clone, createQuery, createSerializer, fetch, fetchCount, fetchOne, fetchResults, logQuery, reset, setFlushMode, setHint, setLockMode
-
Methods inherited from class com.querydsl.jpa.JPAQueryBase
fetchAll, from, from, from, getTemplates, innerJoin, innerJoin, innerJoin, innerJoin, innerJoin, innerJoin, join, join, join, join, join, join, leftJoin, leftJoin, leftJoin, leftJoin, leftJoin, leftJoin, on, on, rightJoin, rightJoin, rightJoin, rightJoin, rightJoin, rightJoin, serialize, serialize, toString
-
Methods inherited from class com.querydsl.core.support.FetchableSubQueryBase
accept, 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.support.ExtendedSubQuery
contains, contains, eq, eq, exists, goe, goe, gt, gt, in, in, isNotNull, isNull, loe, loe, lt, lt, ne, ne, notExists
-
-
-
-
Constructor Detail
-
DBQuery
public DBQuery(javax.persistence.EntityManager entityManager, com.querydsl.jpa.JPQLTemplates templates, ConversionHandler conversionHandler, SessionData sessionData)Creates a new EntityManager bound query
-
-
Method Detail
-
clone
public DBQuery<T> clone(javax.persistence.EntityManager entityManager, com.querydsl.jpa.JPQLTemplates templates)
-
count
@Deprecated public int count()
Deprecated.Returns the number of results in the query. Usecount(NumberPath)instead, as future versions of QueryDSL will change the behavior ofcount(), making it very inefficient.
-
count
public int count(com.querydsl.core.types.dsl.NumberPath<?> path)
Counts the number of rows using the id path as base
-
export
public com.mysema.commons.lang.CloseableIterator<T> export()
Iterates over results for exporting data. Applies the max results in the configuration.
-
export
public <RT> com.mysema.commons.lang.CloseableIterator<RT> export(Class<RT> resultType, com.querydsl.core.types.Expression<?> projection)
Iterates over results for exporting data converting each result. Applies the max results in the configuration.
-
export
public com.mysema.commons.lang.CloseableIterator<com.querydsl.core.Tuple> export(com.querydsl.core.types.Expression<?>... projections)
Iterates over results for exporting data with a tuple projection. Applies the max results in the configuration.
-
export
public <RT> com.mysema.commons.lang.CloseableIterator<RT> export(com.querydsl.core.types.Expression<RT> projection)
Iterates over results for exporting data with a given projection. Applies the max results in the configuration.
-
fetchJoin
@Deprecated public DBQuery<T> fetchJoin()
Deprecated.EclipseLink (or JPA) doesn't support nested fetch joins. Instead, use eitherleftFetchHint(Path...)orinnerFetchHint(Path...).
-
getSessionData
public SessionData getSessionData()
-
hasEmptyResults
public boolean hasEmptyResults()
Returns whether the execution of this query yields zero rows
-
hasResults
public boolean hasResults()
Returns whether the execution of this query yields at least one row
-
ignoreMaxResults
@Deprecated public DBQuery<T> ignoreMaxResults()
Deprecated.This method will be removed in 4.17.No longer used. Only left during 4.16.x to avoid breaking scripts.
-
innerFetchHint
public DBQuery<T> innerFetchHint(com.querydsl.core.types.Path<?>... path)
Set the hint to fetch relationships with inner join
-
isIgnoreMaxResults
@Deprecated public boolean isIgnoreMaxResults()
Deprecated.This method will be removed in 4.17.No longer used. Only left during 4.16.x to avoid breaking scripts.
-
iterate
public com.mysema.commons.lang.CloseableIterator<T> iterate()
Iterates over all results, without applying any limit. Warning: this method may return a large number of results, and should be used with caution.
-
iterate
public <RT> com.mysema.commons.lang.CloseableIterator<RT> iterate(Class<RT> resultType, com.querydsl.core.types.Expression<?> projection)
Iterates over all results converting each result, without applying any limit. Warning: this method may return a large number of results, and should be used with caution.
-
iterate
public com.mysema.commons.lang.CloseableIterator<com.querydsl.core.Tuple> iterate(com.querydsl.core.types.Expression<?>... projections)
Iterates over all results for a given tuple projection, without applying any limit. Warning: this method may return a large number of results, and should be used with caution.
-
iterate
public <RT> com.mysema.commons.lang.CloseableIterator<RT> iterate(com.querydsl.core.types.Expression<RT> projection)
Iterates over all results with a given projection, without applying any limit. Warning: this method may return a large number of results, and should be used with caution.
-
leftFetchHint
public DBQuery<T> leftFetchHint(com.querydsl.core.types.Path<?>... path)
Set the hint to fetch relationships with left join
-
list
public <RT> List<RT> list(Class<RT> resultType, com.querydsl.core.types.Expression<?> expr)
Returns a list converted into the given type
-
list
public List<com.querydsl.core.Tuple> list(com.querydsl.core.types.Expression<?>... projections)
Returns a list of tuples
-
list
public <RT> List<RT> list(com.querydsl.core.types.Expression<RT> projection)
Returns a list
-
map
public <K,V> Map<K,V> map(com.querydsl.core.types.Expression<K> keyExpr, com.querydsl.core.types.Expression<V> valueExpr)
Returns the results as a Map, with an expression as key and the other one as value
-
page
public <RT> Page<RT> page(Class<RT> resultType, Integer currentPage, Integer pageSize, boolean skipTotalCount, com.querydsl.core.types.Expression<?> expr)
Executes a paged search, converted into the given type, based on the default page size
-
page
public <RT> Page<RT> page(Class<RT> resultType, QueryParameters queryParameters, com.querydsl.core.types.Expression<?> expr)
Returns a paged search, getting page parameters from the givenQueryParameters, converting the result
-
page
public <RT> Page<RT> page(Integer currentPage, Integer pageSize, boolean skipTotalCount, com.querydsl.core.types.Expression<RT> expr)
Executes a paged search
-
page
public <RT> Page<RT> page(QueryParameters queryParameters, com.querydsl.core.types.Expression<RT> expr)
Returns a paged search, getting page parameters from the givenQueryParameters
-
requiredUniqueResult
public <RT> RT requiredUniqueResult(Class<RT> resultType, com.querydsl.core.types.Expression<?> expr) throws EntityNotFoundException
Returns the result ofrequiredUniqueResult(Expression)converted into the given resultType- Throws:
EntityNotFoundException
-
requiredUniqueResult
public <RT> RT requiredUniqueResult(com.querydsl.core.types.Expression<RT> expr) throws EntityNotFoundExceptionMakes sure that the result is unique. InvokessingleResult(Expression)and throwsEntityNotFoundExceptionwhen the result is null- Throws:
EntityNotFoundException
-
select
public DBQuery<com.querydsl.core.Tuple> select(com.querydsl.core.types.Expression<?>... exprs)
-
select
public <U> DBQuery<U> select(com.querydsl.core.types.Expression<U> expr)
-
set
public <RT> Set<RT> set(Class<RT> resultType, com.querydsl.core.types.Expression<?> expr)
Returns a set converted into the given type
-
set
public Set<com.querydsl.core.Tuple> set(com.querydsl.core.types.Expression<?>... projections)
Returns a set of tuples
-
set
public <RT> Set<RT> set(com.querydsl.core.types.Expression<RT> projection)
Returns a set
-
setIgnoreMaxResults
@Deprecated public void setIgnoreMaxResults(boolean ignoreMaxResults)
Deprecated.This method will be removed in 4.17.No longer used. Only left during 4.16.x to avoid breaking scripts.
-
singleResult
public <RT> RT singleResult(Class<RT> resultType, com.querydsl.core.types.Expression<?> expr)
Returns the first result in the query, converted into the given type, or null if no records found
-
singleResult
public com.querydsl.core.Tuple singleResult(com.querydsl.core.types.Expression<?>... exprs)
Returns the first result as a Tuple
-
singleResult
public <RT> RT singleResult(com.querydsl.core.types.Expression<RT> expr)
Returns the first result
-
stream
public Stream<com.querydsl.core.Tuple> stream(com.querydsl.core.types.Expression<?>... projections)
Returns a stream
-
stream
public <RT> Stream<RT> stream(com.querydsl.core.types.Expression<RT> projection)
Returns a stream
-
-