From eb6d48d0546ca52f0b30a1a41fc74a4f1d24ea67 Mon Sep 17 00:00:00 2001 From: Ray Greenwell Date: Fri, 13 May 2011 16:43:31 +0000 Subject: [PATCH] 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. --- src/main/java/com/samskivert/depot/Query.java | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/main/java/com/samskivert/depot/Query.java b/src/main/java/com/samskivert/depot/Query.java index c134b8f..d0ab749 100644 --- a/src/main/java/com/samskivert/depot/Query.java +++ b/src/main/java/com/samskivert/depot/Query.java @@ -358,8 +358,7 @@ public class Query 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; } /**