Top Description Inners Fields Constructors Methods
org.hibernate.query.criteria.internal.expression.function

public Class AggregationFunction<T>

extends ParameterizedFunctionExpression<T>
implements Serializable
Class Inheritance
All Implemented Interfaces
java.io.Serializable
Known Direct Subclasses
org.hibernate.query.criteria.internal.expression.function.AggregationFunction.COUNT, org.hibernate.query.criteria.internal.expression.function.AggregationFunction.AVG, org.hibernate.query.criteria.internal.expression.function.AggregationFunction.SUM, org.hibernate.query.criteria.internal.expression.function.AggregationFunction.MIN, org.hibernate.query.criteria.internal.expression.function.AggregationFunction.MAX, org.hibernate.query.criteria.internal.expression.function.AggregationFunction.LEAST, org.hibernate.query.criteria.internal.expression.function.AggregationFunction.GREATEST
Imports
java.io.Serializable, java.util.List, javax.persistence.criteria.Expression, .Root, org.hibernate.query.criteria.internal.CriteriaBuilderImpl, org.hibernate.query.criteria.internal.compile.RenderingContext, org.hibernate.query.criteria.internal.expression.LiteralExpression

Models SQL aggregation functions (MIN, MAX, COUNT, etc).
Author
Steve Ebersole

Nested and Inner Type Summary

Modifier and TypeClass and Description
public static class
AggregationFunction.AVG

Implementation of a AVG function providing convenience in construction.

public static class
AggregationFunction.COUNT

Implementation of a COUNT function providing convenience in construction.

public static class
AggregationFunction.GREATEST<X extends Comparable<X>>

Models the MAX function in terms of non-numeric expressions.

public static class
AggregationFunction.LEAST<X extends Comparable<X>>

Models the MIN function in terms of non-numeric expressions.

public static class
AggregationFunction.MAX<N extends Number>

Implementation of a MAX function providing convenience in construction.

public static class
AggregationFunction.MIN<N extends Number>

Implementation of a MIN function providing convenience in construction.

public static class
AggregationFunction.SUM<N extends Number>

Implementation of a SUM function providing convenience in construction.

Field Summary

Inherited from org.hibernate.query.criteria.internal.expression.function.ParameterizedFunctionExpression:
STANDARD_JPA_FUNCTION_NAMES

Constructor Summary

AccessConstructor and Description
public
AggregationFunction(CriteriaBuilderImpl
The query builder instance.
criteriaBuilder
,
Class<T>
The function return type.
returnType
,
String
The name of the function.
functionName
,
Object
The literal argument
argument
)

Constructs an aggregation function with a single literal argument.

public
AggregationFunction(CriteriaBuilderImpl
The query builder instance.
criteriaBuilder
,
Class<T>
The function return type.
returnType
,
String
The name of the function.
functionName
,
Expression<?>
The argument
argument
)

Constructs an aggregation function with a single literal argument.

Method Summary

Modifier and TypeMethod and Description
public boolean
protected boolean
Inherited from org.hibernate.query.criteria.internal.expression.function.ParameterizedFunctionExpression:
getArgumentExpressionsproperSizeregisterParametersrenderrenderArguments

Constructor Detail

AggregationFunctionback to summary
public AggregationFunction(CriteriaBuilderImpl criteriaBuilder, Class<T> returnType, String functionName, Object argument)

Constructs an aggregation function with a single literal argument.

Parameters
criteriaBuilder:CriteriaBuilderImpl

The query builder instance.

returnType:Class<T>

The function return type.

functionName:String

The name of the function.

argument:Object

The literal argument

Annotations
@SuppressWarnings:unchecked
AggregationFunctionback to summary
public AggregationFunction(CriteriaBuilderImpl criteriaBuilder, Class<T> returnType, String functionName, Expression<?> argument)

Constructs an aggregation function with a single literal argument.

Parameters
criteriaBuilder:CriteriaBuilderImpl

The query builder instance.

returnType:Class<T>

The function return type.

functionName:String

The name of the function.

argument:Expression<?>

The argument

Method Detail

isAggregationback to summary
public boolean isAggregation()

Overrides org.hibernate.query.criteria.internal.expression.function.BasicFunctionExpression.isAggregation.

Implements org.hibernate.query.criteria.internal.expression.function.FunctionExpression.isAggregation.

Doc from org.hibernate.query.criteria.internal.expression.function.FunctionExpression.isAggregation.

Is this function a value aggregator (like a COUNT or MAX function e.g.)?

Returns:boolean

True if this functions does aggregation.

Annotations
@Override
isStandardJpaFunctionback to summary
protected boolean isStandardJpaFunction()

Overrides org.hibernate.query.criteria.internal.expression.function.ParameterizedFunctionExpression.isStandardJpaFunction.

Annotations
@Override
org.hibernate.query.criteria.internal.expression.function back to summary

public Class AggregationFunction.AVG

extends AggregationFunction<Double>
Class Inheritance

Implementation of a AVG function providing convenience in construction.

Parameterized as Double because thats what JPA states that the return from AVG should be.

Field Summary

Modifier and TypeField and Description
public static final String

Constructor Summary

AccessConstructor and Description
public
AVG(CriteriaBuilderImpl criteriaBuilder, Expression<? extends Number> expression)

Method Summary

Inherited from org.hibernate.query.criteria.internal.expression.function.AggregationFunction:
isAggregationisStandardJpaFunction

Field Detail

NAMEback to summary
public static final String NAME

Constructor Detail

AVGback to summary
public AVG(CriteriaBuilderImpl criteriaBuilder, Expression<? extends Number> expression)
org.hibernate.query.criteria.internal.expression.function back to summary

public Class AggregationFunction.COUNT

extends AggregationFunction<Long>
Class Inheritance

Implementation of a COUNT function providing convenience in construction.

Parameterized as Long because thats what JPA states that the return from COUNT should be.

Field Summary

Modifier and TypeField and Description
private final boolean
public static final String

Constructor Summary

AccessConstructor and Description
public
COUNT(CriteriaBuilderImpl criteriaBuilder, Expression<?> expression, boolean distinct)

Method Summary

Modifier and TypeMethod and Description
public boolean
protected void
Inherited from org.hibernate.query.criteria.internal.expression.function.AggregationFunction:
isAggregationisStandardJpaFunction

Field Detail

distinctback to summary
private final boolean distinct
NAMEback to summary
public static final String NAME

Constructor Detail

COUNTback to summary
public COUNT(CriteriaBuilderImpl criteriaBuilder, Expression<?> expression, boolean distinct)

Method Detail

isDistinctback to summary
public boolean isDistinct()
renderArgumentsback to summary
protected void renderArguments(StringBuilder buffer, RenderingContext renderingContext)

Overrides org.hibernate.query.criteria.internal.expression.function.ParameterizedFunctionExpression.renderArguments.

Annotations
@Override
org.hibernate.query.criteria.internal.expression.function back to summary

public Class AggregationFunction.GREATEST<X extends java.lang.Comparable<X>>

extends AggregationFunction<X extends Comparable<X>>
Class Inheritance

Models the MAX function in terms of non-numeric expressions.
See Also
MAX

Field Summary

Modifier and TypeField and Description
public static final String

Constructor Summary

AccessConstructor and Description
public
GREATEST(CriteriaBuilderImpl criteriaBuilder, Expression<X> expression)

Method Summary

Inherited from org.hibernate.query.criteria.internal.expression.function.AggregationFunction:
isAggregationisStandardJpaFunction

Field Detail

NAMEback to summary
public static final String NAME

Constructor Detail

GREATESTback to summary
public GREATEST(CriteriaBuilderImpl criteriaBuilder, Expression<X> expression)
Annotations
@SuppressWarnings:unchecked
org.hibernate.query.criteria.internal.expression.function back to summary

public Class AggregationFunction.LEAST<X extends java.lang.Comparable<X>>

extends AggregationFunction<X extends Comparable<X>>
Class Inheritance

Models the MIN function in terms of non-numeric expressions.
See Also
MIN

Field Summary

Modifier and TypeField and Description
public static final String

Constructor Summary

AccessConstructor and Description
public
LEAST(CriteriaBuilderImpl criteriaBuilder, Expression<X> expression)

Method Summary

Inherited from org.hibernate.query.criteria.internal.expression.function.AggregationFunction:
isAggregationisStandardJpaFunction

Field Detail

NAMEback to summary
public static final String NAME

Constructor Detail

LEASTback to summary
public LEAST(CriteriaBuilderImpl criteriaBuilder, Expression<X> expression)
Annotations
@SuppressWarnings:unchecked
org.hibernate.query.criteria.internal.expression.function back to summary

public Class AggregationFunction.MAX<N extends java.lang.Number>

extends AggregationFunction<N extends Number>
Class Inheritance

Implementation of a MAX function providing convenience in construction.

Parameterized as N extends Number because thats what JPA states that the return from MAX should be.

Field Summary

Modifier and TypeField and Description
public static final String

Constructor Summary

AccessConstructor and Description
public
MAX(CriteriaBuilderImpl criteriaBuilder, Expression<N> expression)

Method Summary

Inherited from org.hibernate.query.criteria.internal.expression.function.AggregationFunction:
isAggregationisStandardJpaFunction

Field Detail

NAMEback to summary
public static final String NAME

Constructor Detail

MAXback to summary
public MAX(CriteriaBuilderImpl criteriaBuilder, Expression<N> expression)
Annotations
@SuppressWarnings:unchecked
org.hibernate.query.criteria.internal.expression.function back to summary

public Class AggregationFunction.MIN<N extends java.lang.Number>

extends AggregationFunction<N extends Number>
Class Inheritance

Implementation of a MIN function providing convenience in construction.

Parameterized as N extends Number because thats what JPA states that the return from MIN should be.

Field Summary

Modifier and TypeField and Description
public static final String

Constructor Summary

AccessConstructor and Description
public
MIN(CriteriaBuilderImpl criteriaBuilder, Expression<N> expression)

Method Summary

Inherited from org.hibernate.query.criteria.internal.expression.function.AggregationFunction:
isAggregationisStandardJpaFunction

Field Detail

NAMEback to summary
public static final String NAME

Constructor Detail

MINback to summary
public MIN(CriteriaBuilderImpl criteriaBuilder, Expression<N> expression)
Annotations
@SuppressWarnings:unchecked
org.hibernate.query.criteria.internal.expression.function back to summary

public Class AggregationFunction.SUM<N extends java.lang.Number>

extends AggregationFunction<N extends Number>
Class Inheritance

Implementation of a SUM function providing convenience in construction.

Parameterized as N extends Number because thats what JPA states that the return from SUM should be.

Field Summary

Modifier and TypeField and Description
public static final String

Constructor Summary

AccessConstructor and Description
public
SUM(CriteriaBuilderImpl criteriaBuilder, Expression<N> expression)

public
SUM(CriteriaBuilderImpl criteriaBuilder, Expression<? extends Number> expression, Class<N> returnType)

Method Summary

Inherited from org.hibernate.query.criteria.internal.expression.function.AggregationFunction:
isAggregationisStandardJpaFunction

Field Detail

NAMEback to summary
public static final String NAME

Constructor Detail

SUMback to summary
public SUM(CriteriaBuilderImpl criteriaBuilder, Expression<N> expression)
Annotations
@SuppressWarnings:unchecked
SUMback to summary
public SUM(CriteriaBuilderImpl criteriaBuilder, Expression<? extends Number> expression, Class<N> returnType)