| Method and Description |
|---|
com.querydsl.jpa.impl.AbstractJPAQuery.fetchCount()
fetchCount 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 In order to support For very specific domain models where |
com.querydsl.jpa.impl.AbstractJPAQuery.fetchResults()
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 In order to support For very specific domain models where Mind that for any scenario where the count is not strictly needed separately, we
recommend to use |
| com.querydsl.jpa.JPQLTemplates.isEnumInPathSupported() |
Copyright © 2007–2023 OpenFeign. All rights reserved.