Top Description Inners Constructors Methods
org.hibernate.dialect.function

public Class StandardAnsiSqlAggregationFunctions

extends Object
Class Inheritance
Imports
java.sql.Types, java.util.Iterator, .List, .Map, org.hibernate.MappingException, .QueryException, org.hibernate.dialect.Dialect, org.hibernate.engine.spi.Mapping, .SessionFactoryImplementor, org.hibernate.type.StandardBasicTypes, .Type

Centralized definition of standard ANSI SQL aggregation functions
Author
Steve Ebersole

Nested and Inner Type Summary

Modifier and TypeClass and Description
public static class
StandardAnsiSqlAggregationFunctions.AvgFunction

Definition of a standard ANSI SQL compliant AVG function

public static class
StandardAnsiSqlAggregationFunctions.CountFunction

Definition of a standard ANSI SQL compliant COUNT function

public static class
StandardAnsiSqlAggregationFunctions.MaxFunction

Definition of a standard ANSI SQL compliant MAX function

public static class
StandardAnsiSqlAggregationFunctions.MinFunction

Definition of a standard ANSI SQL compliant MIN function

public static class
StandardAnsiSqlAggregationFunctions.SumFunction

Definition of a standard ANSI SQL compliant SUM function

Constructor Summary

AccessConstructor and Description
private

Method Summary

Modifier and TypeMethod and Description
public static void
primeFunctionMap(Map<String, SQLFunction>
The map of functions to push to
functionMap
)

Push the functions defined on StandardAnsiSqlAggregationFunctions into the given map

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Constructor Detail

StandardAnsiSqlAggregationFunctionsback to summary
private StandardAnsiSqlAggregationFunctions()

Method Detail

primeFunctionMapback to summary
public static void primeFunctionMap(Map<String, SQLFunction> functionMap)

Push the functions defined on StandardAnsiSqlAggregationFunctions into the given map

Parameters
functionMap:Map<String, SQLFunction>

The map of functions to push to

org.hibernate.dialect.function back to summary

public Class StandardAnsiSqlAggregationFunctions.AvgFunction

extends StandardSQLFunction
Class Inheritance
Known Direct Subclasses
org.hibernate.dialect.function.AvgWithArgumentCastFunction

Definition of a standard ANSI SQL compliant AVG function

Field Summary

Modifier and TypeField and Description
public static final StandardAnsiSqlAggregationFunctions.AvgFunction
INSTANCE

Singleton access

Constructor Summary

AccessConstructor and Description
protected

Method Summary

Modifier and TypeMethod and Description
protected final int
determineJdbcTypeCode(Type firstArgumentType, SessionFactoryImplementor factory)

Deprecated as a consequence of SessionFactoryImplementor being deprecated.
public String
render(Type
The type of the first argument
firstArgumentType
,
List<E>
The function arguments
arguments
,
SessionFactoryImplementor
The SessionFactory
factory
)

Overrides org.hibernate.dialect.function.StandardSQLFunction.render.

Implements org.hibernate.dialect.function.SQLFunction.render.

Deprecated as a consequence of SessionFactoryImplementor being deprecated.
Render the function call as SQL fragment.
protected String
render(int firstArgumentJdbcType, String argument, SessionFactoryImplementor factory)

Deprecated as a consequence of SessionFactoryImplementor being deprecated.
protected String
renderArgument(String argument, int firstArgumentJdbcType)

Inherited from org.hibernate.dialect.function.StandardSQLFunction:
getNamegetRenderedNamegetReturnTypegetTypehasArgumentshasParenthesesIfNoArgumentstoString

Field Detail

INSTANCEback to summary
public static final StandardAnsiSqlAggregationFunctions.AvgFunction INSTANCE

Singleton access

Constructor Detail

AvgFunctionback to summary
protected AvgFunction()

Method Detail

determineJdbcTypeCodeback to summary
protected final int determineJdbcTypeCode(Type firstArgumentType, SessionFactoryImplementor factory) throws QueryException

Deprecated

as a consequence of SessionFactoryImplementor being deprecated. See corresponding docs for further information.

renderback to summary
public String render(Type firstArgumentType, List<E> arguments, SessionFactoryImplementor factory) throws QueryException

Overrides org.hibernate.dialect.function.StandardSQLFunction.render.

Implements org.hibernate.dialect.function.SQLFunction.render.

Doc from org.hibernate.dialect.function.SQLFunction.render.

Deprecated

as a consequence of SessionFactoryImplementor being deprecated. See corresponding docs for further information.

Render the function call as SQL fragment.

Note, the 'firstArgumentType' parameter should match the one passed into getReturnType

Parameters
firstArgumentType:Type

The type of the first argument

arguments:List<E>

The function arguments

factory:SessionFactoryImplementor

The SessionFactory

Returns:String

The rendered function call

Annotations
@Override
Exceptions
QueryException:
Indicates a problem rendering the function call.
renderback to summary
protected String render(int firstArgumentJdbcType, String argument, SessionFactoryImplementor factory)

Deprecated

as a consequence of SessionFactoryImplementor being deprecated. See corresponding docs for further information.

Annotations
@SuppressWarnings:UnusedParameters
renderArgumentback to summary
protected String renderArgument(String argument, int firstArgumentJdbcType)
org.hibernate.dialect.function back to summary

public Class StandardAnsiSqlAggregationFunctions.CountFunction

extends StandardSQLFunction
Class Inheritance

Definition of a standard ANSI SQL compliant COUNT function

Field Summary

Modifier and TypeField and Description
public static final StandardAnsiSqlAggregationFunctions.CountFunction
INSTANCE

Singleton access

Constructor Summary

AccessConstructor and Description
protected

Method Summary

Modifier and TypeMethod and Description
public String
render(Type
The type of the first argument
firstArgumentType
,
List<E>
The function arguments
arguments
,
SessionFactoryImplementor
The SessionFactory
factory
)

Overrides org.hibernate.dialect.function.StandardSQLFunction.render.

Implements org.hibernate.dialect.function.SQLFunction.render.

Deprecated as a consequence of SessionFactoryImplementor being deprecated.
Render the function call as SQL fragment.
private String
renderCountDistinct(List<E> arguments, Dialect dialect)

Inherited from org.hibernate.dialect.function.StandardSQLFunction:
getNamegetRenderedNamegetReturnTypegetTypehasArgumentshasParenthesesIfNoArgumentstoString

Field Detail

INSTANCEback to summary
public static final StandardAnsiSqlAggregationFunctions.CountFunction INSTANCE

Singleton access

Constructor Detail

CountFunctionback to summary
protected CountFunction()

Method Detail

renderback to summary
public String render(Type firstArgumentType, List<E> arguments, SessionFactoryImplementor factory)

Overrides org.hibernate.dialect.function.StandardSQLFunction.render.

Implements org.hibernate.dialect.function.SQLFunction.render.

Doc from org.hibernate.dialect.function.SQLFunction.render.

Deprecated

as a consequence of SessionFactoryImplementor being deprecated. See corresponding docs for further information.

Render the function call as SQL fragment.

Note, the 'firstArgumentType' parameter should match the one passed into getReturnType

Parameters
firstArgumentType:Type

The type of the first argument

arguments:List<E>

The function arguments

factory:SessionFactoryImplementor

The SessionFactory

Returns:String

The rendered function call

Annotations
@Override
renderCountDistinctback to summary
private String renderCountDistinct(List<E> arguments, Dialect dialect)
org.hibernate.dialect.function back to summary

public Class StandardAnsiSqlAggregationFunctions.MaxFunction

extends StandardSQLFunction
Class Inheritance

Definition of a standard ANSI SQL compliant MAX function

Field Summary

Modifier and TypeField and Description
public static final StandardAnsiSqlAggregationFunctions.MaxFunction
INSTANCE

Singleton access

Constructor Summary

AccessConstructor and Description
protected

Method Summary

Inherited from org.hibernate.dialect.function.StandardSQLFunction:
getNamegetRenderedNamegetReturnTypegetTypehasArgumentshasParenthesesIfNoArgumentsrendertoString

Field Detail

INSTANCEback to summary
public static final StandardAnsiSqlAggregationFunctions.MaxFunction INSTANCE

Singleton access

Constructor Detail

MaxFunctionback to summary
protected MaxFunction()
org.hibernate.dialect.function back to summary

public Class StandardAnsiSqlAggregationFunctions.MinFunction

extends StandardSQLFunction
Class Inheritance

Definition of a standard ANSI SQL compliant MIN function

Field Summary

Modifier and TypeField and Description
public static final StandardAnsiSqlAggregationFunctions.MinFunction
INSTANCE

Singleton access

Constructor Summary

AccessConstructor and Description
protected

Method Summary

Inherited from org.hibernate.dialect.function.StandardSQLFunction:
getNamegetRenderedNamegetReturnTypegetTypehasArgumentshasParenthesesIfNoArgumentsrendertoString

Field Detail

INSTANCEback to summary
public static final StandardAnsiSqlAggregationFunctions.MinFunction INSTANCE

Singleton access

Constructor Detail

MinFunctionback to summary
protected MinFunction()
org.hibernate.dialect.function back to summary

public Class StandardAnsiSqlAggregationFunctions.SumFunction

extends StandardSQLFunction
Class Inheritance

Definition of a standard ANSI SQL compliant SUM function

Field Summary

Modifier and TypeField and Description
public static final StandardAnsiSqlAggregationFunctions.SumFunction
INSTANCE

Singleton access

Constructor Summary

AccessConstructor and Description
protected

Method Summary

Modifier and TypeMethod and Description
protected final int
public Type
getReturnType(Type
The type of the first argument
firstArgumentType
,
Mapping
The mapping source.
mapping
)

Overrides org.hibernate.dialect.function.StandardSQLFunction.getReturnType.

Implements org.hibernate.dialect.function.SQLFunction.getReturnType.

The return type of the function.
Inherited from org.hibernate.dialect.function.StandardSQLFunction:
getNamegetRenderedNamegetTypehasArgumentshasParenthesesIfNoArgumentsrendertoString

Field Detail

INSTANCEback to summary
public static final StandardAnsiSqlAggregationFunctions.SumFunction INSTANCE

Singleton access

Constructor Detail

SumFunctionback to summary
protected SumFunction()

Method Detail

determineJdbcTypeCodeback to summary
protected final int determineJdbcTypeCode(Type type, Mapping mapping) throws QueryException
getReturnTypeback to summary
public Type getReturnType(Type firstArgumentType, Mapping mapping)

Overrides org.hibernate.dialect.function.StandardSQLFunction.getReturnType.

Implements org.hibernate.dialect.function.SQLFunction.getReturnType.

Doc from org.hibernate.dialect.function.SQLFunction.getReturnType.

The return type of the function. May be either a concrete type which is preset, or variable depending upon the type of the first function argument.

Note, the 'firstArgumentType' parameter should match the one passed into render

Parameters
firstArgumentType:Type

The type of the first argument

mapping:Mapping

The mapping source.

Returns:Type

The type to be expected as a return.

Annotations
@Override