refactor: change the name for intuition query to countQuery

This commit is contained in:
heesuk 2020-05-07 14:39:25 +09:00
parent db7f0528c2
commit 90b6fe90f4

View File

@ -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);