Prevent confusion if someone uses selectCount() (which returns int) on a

grouped query. They should be using select(Funcs.count(Exps.literal("*")))
(which returns List<Integer>) in such cases.
This commit is contained in:
Michael Bayne
2010-12-13 17:50:50 +00:00
parent 881a36bdca
commit 90b04e68b8
@@ -359,6 +359,7 @@ public class Query<T extends PersistentRecord>
*/
public int selectCount ()
{
checkState(_groupBy == null, "You surely mean to select(Funcs.count(Exps.literal(\"*\"))).");
_fromOverride = new FromOverride(_pclass);
return _repo.load(CountRecord.class, _cache, getClauseArray()).count;
}