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:
@@ -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);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user