int[] sqlTypes;
try {
sqlTypes = columnType.sqlTypes( mapping );
}
catch ( MappingException me ) {
throw new QueryException( me );
}
if ( sqlTypes.length != 1 ) throw new QueryException( "multi-column type in avg()" );
int sqlType = sqlTypes[0];
if ( sqlType == Types.INTEGER || sqlType == Types.BIGINT || sqlType == Types.TINYINT ) {
return Hibernate.FLOAT;
}
else {
return columnType;
}