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:
Ray Greenwell
2011-05-13 16:43:31 +00:00
parent 5d9a584e4c
commit eb6d48d054
@@ -358,8 +358,7 @@ public class Query<T extends PersistentRecord>
public int selectCount ()
{
checkState(_groupBy == null, "Do you mean to select(Funcs.countStar())?");
_fromOverride = new FromOverride(_pclass);
return _repo.load(CountRecord.class, _cache, getClauseArray()).count;
return _repo.load(CountRecord.class, _cache, override(_pclass).getClauseArray()).count;
}
/**