Class AvgWithCastFunction
java.lang.Object
org.datanucleus.store.rdbms.sql.method.SimpleNumericAggregateMethod
org.datanucleus.store.rdbms.sql.method.AvgFunction
org.datanucleus.store.rdbms.sql.method.AvgWithCastFunction
- All Implemented Interfaces:
SQLMethod
Some databases will use the same type for the return value as the argument, which can be an issue
when averaging on integral types since it will drop the decimals.
This class will convert the arg to a "CAST({arg} AS double)"
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected SQLExpression
getAggregateExpression
(SQLStatement stmt, List<SQLExpression> args, JavaTypeMapping m) Methods inherited from class org.datanucleus.store.rdbms.sql.method.AvgFunction
getClassForMapping, getExpression, getFunctionName
-
Constructor Details
-
AvgWithCastFunction
public AvgWithCastFunction()
-
-
Method Details
-
getAggregateExpression
protected SQLExpression getAggregateExpression(SQLStatement stmt, List<SQLExpression> args, JavaTypeMapping m) - Overrides:
getAggregateExpression
in classAvgFunction
-