Changed selectCount() to not alter the state of the Query,
so that I can select a count of matching rows and then go on to add an ordering and limit and select a particular page of results.
This commit is contained in:
@@ -358,8 +358,7 @@ public class Query<T extends PersistentRecord>
|
|||||||
public int selectCount ()
|
public int selectCount ()
|
||||||
{
|
{
|
||||||
checkState(_groupBy == null, "Do you mean to select(Funcs.countStar())?");
|
checkState(_groupBy == null, "Do you mean to select(Funcs.countStar())?");
|
||||||
_fromOverride = new FromOverride(_pclass);
|
return _repo.load(CountRecord.class, _cache, override(_pclass).getClauseArray()).count;
|
||||||
return _repo.load(CountRecord.class, _cache, getClauseArray()).count;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
Reference in New Issue
Block a user