org.hibernate.ejb.criteria.expression.function
Class AggregationFunction<T>

java.lang.Object
  extended by org.hibernate.ejb.criteria.AbstractNode
      extended by org.hibernate.ejb.criteria.expression.AbstractTupleElement<X>
          extended by org.hibernate.ejb.criteria.expression.SelectionImpl<T>
              extended by org.hibernate.ejb.criteria.expression.ExpressionImpl<X>
                  extended by org.hibernate.ejb.criteria.expression.function.BasicFunctionExpression<X>
                      extended by org.hibernate.ejb.criteria.expression.function.ParameterizedFunctionExpression<T>
                          extended by org.hibernate.ejb.criteria.expression.function.AggregationFunction<T>
All Implemented Interfaces:
Serializable, Expression<T>, Selection<T>, TupleElement<T>, FunctionExpression<T>, ExpressionImplementor<T>, ParameterContainer, Renderable, SelectionImplementor<T>, TupleElementImplementor<T>
Direct Known Subclasses:
AggregationFunction.AVG, AggregationFunction.COUNT, AggregationFunction.GREATEST, AggregationFunction.LEAST, AggregationFunction.MAX, AggregationFunction.MIN, AggregationFunction.SUM

public class AggregationFunction<T>
extends ParameterizedFunctionExpression<T>
implements Serializable

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

See Also:
Serialized Form

Nested Class Summary
static class AggregationFunction.AVG
          Implementation of a AVG function providing convenience in construction.
static class AggregationFunction.COUNT
          Implementation of a COUNT function providing convenience in construction.
static class AggregationFunction.GREATEST<X extends Comparable<X>>
          Models the MAX function in terms of non-numeric expressions.
static class AggregationFunction.LEAST<X extends Comparable<X>>
          Models the MIN function in terms of non-numeric expressions.
static class AggregationFunction.MAX<N extends Number>
          Implementation of a MAX function providing convenience in construction.
static class AggregationFunction.MIN<N extends Number>
          Implementation of a MIN function providing convenience in construction.
static class AggregationFunction.SUM<N extends Number>
          Implementation of a SUM function providing convenience in construction.
 
Nested classes/interfaces inherited from interface org.hibernate.ejb.criteria.ParameterContainer
ParameterContainer.Helper
 
Constructor Summary
AggregationFunction(CriteriaBuilderImpl criteriaBuilder, Class<T> returnType, String functionName, Expression<?> argument)
          Constructs an aggregation function with a single literal argument.
AggregationFunction(CriteriaBuilderImpl criteriaBuilder, Class<T> returnType, String functionName, Object argument)
          Constructs an aggregation function with a single literal argument.
 
Method Summary
 boolean isAggregation()
          Is this function a value aggregator (like a COUNT or MAX function e.g.)?
 
Methods inherited from class org.hibernate.ejb.criteria.expression.function.ParameterizedFunctionExpression
getArgumentExpressions, properSize, registerParameters, render, renderArguments, wrapAsLiterals
 
Methods inherited from class org.hibernate.ejb.criteria.expression.function.BasicFunctionExpression
getFunctionName, renderProjection
 
Methods inherited from class org.hibernate.ejb.criteria.expression.ExpressionImpl
as, asBigDecimal, asBigInteger, asDouble, asFloat, asInteger, asLong, asString, in, in, in, in, isNotNull, isNull
 
Methods inherited from class org.hibernate.ejb.criteria.expression.SelectionImpl
alias, getCompoundSelectionItems, getValueHandlers, isCompoundSelection
 
Methods inherited from class org.hibernate.ejb.criteria.expression.AbstractTupleElement
forceConversion, getAlias, getJavaType, getValueHandler, resetJavaType, setAlias
 
Methods inherited from class org.hibernate.ejb.criteria.AbstractNode
criteriaBuilder
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.hibernate.ejb.criteria.expression.function.FunctionExpression
getFunctionName
 
Methods inherited from interface javax.persistence.criteria.Expression
as, in, in, in, in, isNotNull, isNull
 
Methods inherited from interface javax.persistence.criteria.Selection
alias, getCompoundSelectionItems, isCompoundSelection
 
Methods inherited from interface javax.persistence.TupleElement
getAlias, getJavaType
 
Methods inherited from interface org.hibernate.ejb.criteria.SelectionImplementor
getValueHandlers
 
Methods inherited from interface org.hibernate.ejb.criteria.TupleElementImplementor
getValueHandler
 

Constructor Detail

AggregationFunction

public AggregationFunction(CriteriaBuilderImpl criteriaBuilder,
                           Class<T> returnType,
                           String functionName,
                           Object argument)
Constructs an aggregation function with a single literal argument.

Parameters:
criteriaBuilder - The query builder instance.
returnType - The function return type.
functionName - The name of the function.
argument - The literal argument

AggregationFunction

public AggregationFunction(CriteriaBuilderImpl criteriaBuilder,
                           Class<T> returnType,
                           String functionName,
                           Expression<?> argument)
Constructs an aggregation function with a single literal argument.

Parameters:
criteriaBuilder - The query builder instance.
returnType - The function return type.
functionName - The name of the function.
argument - The argument
Method Detail

isAggregation

public boolean isAggregation()
Description copied from interface: FunctionExpression
Is this function a value aggregator (like a COUNT or MAX function e.g.)?

Specified by:
isAggregation in interface FunctionExpression<T>
Overrides:
isAggregation in class BasicFunctionExpression<T>
Returns:
True if this functions does aggregation.


Copyright © 2001-2012 Red Hat, Inc. All Rights Reserved.