Package org.hibernate.dialect.function
Class AvgWithArgumentCastFunction
java.lang.Object
org.hibernate.dialect.function.StandardSQLFunction
org.hibernate.dialect.function.StandardAnsiSqlAggregationFunctions.AvgFunction
org.hibernate.dialect.function.AvgWithArgumentCastFunction
- All Implemented Interfaces:
SQLFunction
Some databases strictly return the type of the of the aggregation value for AVG which is
problematic in the case of averaging integers because the decimals will be dropped. The usual workaround
is to cast the integer argument as some form of double/decimal.
-
Field Summary
Fields inherited from class org.hibernate.dialect.function.StandardAnsiSqlAggregationFunctions.AvgFunction
INSTANCE -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected StringrenderArgument(String argument, int firstArgumentJdbcType) Methods inherited from class org.hibernate.dialect.function.StandardAnsiSqlAggregationFunctions.AvgFunction
determineJdbcTypeCode, render, renderMethods inherited from class org.hibernate.dialect.function.StandardSQLFunction
getName, getReturnType, getType, hasArguments, hasParenthesesIfNoArguments, toString
-
Constructor Details
-
AvgWithArgumentCastFunction
-
-
Method Details
-
renderArgument
- Overrides:
renderArgumentin classStandardAnsiSqlAggregationFunctions.AvgFunction
-