Changed expressions that deal with count() results to Number because Postgres

in its burning desire to support the amazing four hundred billion rows, returns
a Long for count expressions.

Clients using selectCount() won't be impacted, but clients doing more complex
counting are going to have to sprinkle in some .intValue() calls.
This commit is contained in:
Michael Bayne
2011-02-28 22:58:38 +00:00
parent 677de3da03
commit ad4f2c9970
2 changed files with 4 additions and 4 deletions
@@ -57,7 +57,7 @@ public class Funcs
* Creates an aggregate expression that counts the number of rows that match the other clauses
* in this query.
*/
public static FluentExp<Integer> countStar ()
public static FluentExp<Number> countStar ()
{
return new Count(Exps.literal("*"));
}
@@ -66,7 +66,7 @@ public class Funcs
* Creates an aggregate expression that counts the number of rows from the supplied
* expression. This would usually be used in a FieldOverride and supplied with a ColumnExp.
*/
public static FluentExp<Integer> count (SQLExpression<?> expr)
public static FluentExp<Number> count (SQLExpression<?> expr)
{
return new Count(expr);
}
@@ -76,7 +76,7 @@ public class Funcs
* supplied expression. This would usually be used in a FieldOverride and supplied with a
* ColumnExp.
*/
public static FluentExp<Integer> countDistinct (SQLExpression<?> expr)
public static FluentExp<Number> countDistinct (SQLExpression<?> expr)
{
return new Count(expr, true);
}
@@ -41,7 +41,7 @@ public abstract class AggregateFun<T> extends OneArgFun<T>
}
}
public static class Count extends AggregateFun<Integer> {
public static class Count extends AggregateFun<Number> {
public Count (SQLExpression<?> argument) {
this(argument, false);
}