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
public class AvgWithCastFunction extends AvgFunction
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 Constructor Description AvgWithCastFunction()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected SQLExpression
getAggregateExpression(SQLStatement stmt, List args, JavaTypeMapping m)
-
Methods inherited from class org.datanucleus.store.rdbms.sql.method.AvgFunction
getClassForMapping, getExpression, getFunctionName
-
-
-
-
Method Detail
-
getAggregateExpression
protected SQLExpression getAggregateExpression(SQLStatement stmt, List args, JavaTypeMapping m)
- Overrides:
getAggregateExpression
in classAvgFunction
-
-