T
- result typeQ
- concrete subclasspublic abstract class AbstractSQLQuery<T,Q extends AbstractSQLQuery<T,Q>> extends ProjectableSQLQuery<T,Q>
SQLQuery
implementationsModifier and Type | Field and Description |
---|---|
protected boolean |
detach |
protected @Nullable javax.jdo.PersistenceManager |
persistenceManager |
protected @Nullable FactoryExpression<?> |
projection |
protected java.util.List<javax.jdo.Query> |
queries |
protected QueryMixin<Q> |
queryMixin |
configuration, firstUnionSubQuery, union, unionAll
MDC_PARAMETERS, MDC_QUERY
Constructor and Description |
---|
AbstractSQLQuery(QueryMetadata metadata,
Configuration conf,
javax.jdo.PersistenceManager persistenceManager,
boolean detach) |
Modifier and Type | Method and Description |
---|---|
void |
close()
Close the query and related resources
|
java.util.List<T> |
fetch()
Get the projection as a typed List
|
long |
fetchCount()
Get the count of matched elements
Note: not all QueryDSL modules might optimize fetchCount using a count query.
|
T |
fetchOne()
Get the projection as a unique result or null if no result is found
|
QueryResults<T> |
fetchResults()
Get the projection in
QueryResults form. |
boolean |
isDetach() |
com.mysema.commons.lang.CloseableIterator<T> |
iterate()
Get the projection as a typed closeable Iterator
|
java.lang.String |
toString() |
accept, addFlag, addFlag, addFlag, addFlag, addJoinFlag, addJoinFlag, clone, clone, createSerializer, 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, union, union, union, unionAll, unionAll, unionAll, with, with, with, withRecursive, withRecursive, withRecursive
contains, contains, eq, eq, exists, getMetadata, getType, goe, goe, gt, gt, hashCode, in, in, isNotNull, isNull, loe, loe, lt, lt, ne, ne, notExists
equals, fetchFirst, transform, uniqueResult
distinct, groupBy, groupBy, having, having, limit, offset, orderBy, orderBy, restrict, set, where, where
finalize, getClass, notify, notifyAll, wait, wait, wait
distinct, limit, offset, orderBy, restrict, set
where
select, select, transform
fetchFirst, stream
protected final boolean detach
@Nullable protected final @Nullable javax.jdo.PersistenceManager persistenceManager
protected java.util.List<javax.jdo.Query> queries
@Nullable protected @Nullable FactoryExpression<?> projection
protected final QueryMixin<Q extends AbstractSQLQuery<T,Q>> queryMixin
public AbstractSQLQuery(QueryMetadata metadata, Configuration conf, javax.jdo.PersistenceManager persistenceManager, boolean detach)
public void close()
public long fetchCount()
Fetchable
fetch().size()
.fetchCount
in interface Fetchable<T>
fetchCount
in class ProjectableSQLQuery<T,Q extends AbstractSQLQuery<T,Q>>
public boolean isDetach()
public com.mysema.commons.lang.CloseableIterator<T> iterate()
Fetchable
public java.util.List<T> fetch()
Fetchable
fetch
in interface Fetchable<T>
fetch
in class FetchableQueryBase<T,Q extends AbstractSQLQuery<T,Q>>
public QueryResults<T> fetchResults()
Fetchable
QueryResults
form.
Make sure to use Fetchable.fetch()
instead if you do not rely on the QueryResults.getOffset()
or
QueryResults.getLimit()
, because it will be more performant. Also, count queries cannot be
properly generated for all dialects. For example: in JPA count queries can't be generated for queries
that have multiple group by expressions or a having clause.
Get the projection in QueryResults
form.
Use Fetchable.fetch()
instead if you do not need the total count of rows in the query result.Fetchable.fetch()
public java.lang.String toString()
toString
in class ProjectableSQLQuery<T,Q extends AbstractSQLQuery<T,Q>>
@Nullable public T fetchOne() throws NonUniqueResultException
Fetchable
fetchOne
in interface Fetchable<T>
fetchOne
in class ProjectableSQLQuery<T,Q extends AbstractSQLQuery<T,Q>>
NonUniqueResultException
- if there is more than one matching resultCopyright © 2007–2021 Querydsl. All rights reserved.