mirror of
https://github.com/querydsl/querydsl.git
synced 2026-07-09 21:13:03 +08:00
refactor: change the name for intuition query to countQuery
This commit is contained in:
parent
db7f0528c2
commit
90b6fe90f4
@ -255,11 +255,11 @@ public abstract class AbstractJPASQLQuery<T, Q extends AbstractJPASQLQuery<T, Q>
|
||||
public QueryResults<T> fetchResults() {
|
||||
// TODO : handle entity projections as well
|
||||
try {
|
||||
Query query = createQuery(true);
|
||||
long total = ((Number) query.getSingleResult()).longValue();
|
||||
Query countQuery = createQuery(true);
|
||||
long total = ((Number) countQuery.getSingleResult()).longValue();
|
||||
if (total > 0) {
|
||||
QueryModifiers modifiers = queryMixin.getMetadata().getModifiers();
|
||||
query = createQuery(false);
|
||||
Query query = createQuery(false);
|
||||
@SuppressWarnings("unchecked")
|
||||
List<T> list = (List<T>) getResultList(query);
|
||||
return new QueryResults<T>(list, modifiers, total);
|
||||
|
||||
Loading…
Reference in New Issue
Block a user