Package | Description |
---|---|
com.querydsl.collections |
Java Bean collections support
|
com.querydsl.core |
Basic Query elements
|
com.querydsl.hibernate.search |
Hibernate Search support
|
com.querydsl.jdo |
JDO support
|
com.querydsl.jdo.sql |
SQL queries for JDO
|
com.querydsl.jpa.hibernate |
JPQL for Hibernate
|
com.querydsl.jpa.hibernate.sql |
Native queries for Hibernate
|
com.querydsl.jpa.impl |
JPQL for JPA
|
com.querydsl.jpa.sql |
Native queries for JPA
|
com.querydsl.lucene3 |
Lucene 3 support
|
com.querydsl.lucene4 |
Lucene 4 support
|
com.querydsl.lucene5 |
Lucene 5 support
|
com.querydsl.mongodb |
MongoDB support
|
com.querydsl.mongodb.document |
MongoDB Document API support.
|
com.querydsl.sql |
SQL/JDBC support
|
Modifier and Type | Method and Description |
---|---|
QueryResults<T> |
AbstractCollQuery.fetchResults() |
Modifier and Type | Method and Description |
---|---|
static <T> QueryResults<T> |
QueryResults.emptyResults() |
QueryResults<T> |
Fetchable.fetchResults()
Get the projection in
QueryResults form. |
Modifier and Type | Method and Description |
---|---|
QueryResults<T> |
AbstractSearchQuery.fetchResults() |
Modifier and Type | Method and Description |
---|---|
QueryResults<T> |
AbstractJDOQuery.fetchResults() |
Modifier and Type | Method and Description |
---|---|
QueryResults<T> |
AbstractSQLQuery.fetchResults() |
Modifier and Type | Method and Description |
---|---|
QueryResults<T> |
AbstractHibernateQuery.fetchResults() |
Modifier and Type | Method and Description |
---|---|
QueryResults<T> |
AbstractHibernateSQLQuery.fetchResults() |
Modifier and Type | Method and Description |
---|---|
QueryResults<T> |
AbstractJPAQuery.fetchResults()
Deprecated.
fetchResults requires a count query to be computed. In querydsl-sql , this is done
by wrapping the query in a subquery, like so: SELECT COUNT(*) FROM (<original query>) . Unfortunately,
JPQL - the query language of JPA - does not allow queries to project from subqueries. As a result there isn't a
universal way to express count queries in JPQL. Historically QueryDSL attempts at producing a modified query
to compute the number of results instead.
However, this approach only works for simple queries. Specifically
queries with multiple group by clauses and queries with a having clause turn out to be problematic. This is because
COUNT(DISTINCT a, b, c) , while valid SQL in most dialects, is not valid JPQL. Furthermore, a having
clause may refer select elements or aggregate functions and therefore cannot be emulated by moving the predicate
to the where clause instead.
In order to support fetchResults for queries with multiple group by elements or a having clause, we
generate the count in memory instead. This means that the method simply falls back to returning the size of
AbstractJPAQuery.fetch() . For large result sets this may come at a severe performance penalty.
For very specific domain models where AbstractJPAQuery.fetchResults() has to be used in conjunction with complex queries
containing multiple group by elements and/or a having clause, we recommend using the
Blaze-Persistence
integration for QueryDSL. Among other advanced query features, Blaze-Persistence makes it possible to select
from subqueries in JPQL. As a result the BlazeJPAQuery provided with the integration, implements
fetchResults properly and always executes a proper count query.
Mind that for any scenario where the count is not strictly needed separately, we recommend to use AbstractJPAQuery.fetch()
instead. |
Modifier and Type | Method and Description |
---|---|
QueryResults<T> |
AbstractJPASQLQuery.fetchResults() |
Modifier and Type | Method and Description |
---|---|
QueryResults<T> |
AbstractLuceneQuery.fetchResults() |
Modifier and Type | Method and Description |
---|---|
QueryResults<T> |
AbstractLuceneQuery.fetchResults() |
Modifier and Type | Method and Description |
---|---|
QueryResults<T> |
AbstractLuceneQuery.fetchResults() |
Modifier and Type | Method and Description |
---|---|
QueryResults<K> |
AbstractMongodbQuery.fetchResults() |
QueryResults<K> |
AbstractMongodbQuery.fetchResults(Path<?>... paths)
Fetch results with the specific fields
|
Modifier and Type | Method and Description |
---|---|
QueryResults<K> |
AbstractFetchableMongodbQuery.fetchResults() |
QueryResults<K> |
AbstractFetchableMongodbQuery.fetchResults(Path<?>... paths)
Fetch results with the specific fields
|
Modifier and Type | Method and Description |
---|---|
QueryResults<T> |
UnionImpl.fetchResults() |
QueryResults<T> |
AbstractSQLQuery.fetchResults() |
Copyright © 2007–2021 Querydsl. All rights reserved.