Top Fields Constructors Methods
org.hibernate.query.sqm.function

public abstract Class AbstractSqmFunctionDescriptor

extends Object
implements SqmFunctionDescriptor
Class Inheritance
All Implemented Interfaces
org.hibernate.query.sqm.function.SqmFunctionDescriptor
Known Direct Subclasses
org.hibernate.query.sqm.function.AbstractSqmSelfRenderingFunctionDescriptor, org.hibernate.query.sqm.function.JdbcEscapeFunctionDescriptor, org.hibernate.query.sqm.function.MultipatternSqmFunctionDescriptor, org.hibernate.dialect.function.CastStrEmulation, org.hibernate.dialect.function.CoalesceIfnullEmulation, org.hibernate.dialect.function.DateTruncEmulation, org.hibernate.dialect.function.ExtractFunction, org.hibernate.dialect.function.FormatFunction, org.hibernate.dialect.function.InsertSubstringOverlayEmulation, org.hibernate.dialect.function.LocatePositionEmulation, org.hibernate.dialect.function.LpadRpadPadEmulation, org.hibernate.dialect.function.NvlCoalesceEmulation, org.hibernate.dialect.function.PostgreSQLTruncRoundFunction, org.hibernate.dialect.function.TruncFunction
Imports
java.util.List, org.hibernate.query.ReturnableType, org.hibernate.query.spi.QueryEngine, org.hibernate.query.sqm.produce.function.ArgumentsValidator, .FunctionArgumentTypeResolver, .FunctionReturnTypeResolver, .StandardArgumentsValidators, .StandardFunctionArgumentTypeResolvers, .StandardFunctionReturnTypeResolvers, org.hibernate.query.sqm.tree.SqmTypedNode, org.hibernate.query.sqm.tree.predicate.SqmPredicate, org.hibernate.query.sqm.tree.select.SqmOrderByClause

Author
Steve Ebersole

Field Summary

Modifier and TypeField and Description
private final ArgumentsValidator
private final FunctionArgumentTypeResolver
private final String
private final FunctionReturnTypeResolver

Constructor Summary

AccessConstructor and Description
public
public
public
public
AbstractSqmFunctionDescriptor(String name, ArgumentsValidator argumentsValidator, FunctionReturnTypeResolver returnTypeResolver, FunctionArgumentTypeResolver argumentTypeResolver)

Method Summary

Modifier and TypeMethod and Description
public final <T> SelfRenderingSqmFunction<T>
public final <T> SelfRenderingSqmFunction<T>
generateOrderedSetAggregateSqmExpression(List<? extends SqmTypedNode<?>> arguments, SqmPredicate filter, SqmOrderByClause withinGroupClause, ReturnableType<T> impliedResultType, QueryEngine queryEngine)

Overrides default org.hibernate.query.sqm.function.SqmFunctionDescriptor.generateOrderedSetAggregateSqmExpression.

Like generateSqmExpression(List, ReturnableType, QueryEngine), but also accepts a filter predicate and an order by clause.
protected <T> SelfRenderingSqmAggregateFunction<T>
generateSqmAggregateFunctionExpression(List<? extends SqmTypedNode<?>>
the arguments of the function invocation
arguments
,
SqmPredicate filter, ReturnableType<T>
the function return type as inferred from its usage
impliedResultType
,
QueryEngine queryEngine)

Return an SQM node or subtree representing an invocation of this aggregate function with the given arguments.

public final <T> SelfRenderingSqmFunction<T>
generateSqmExpression(List<? extends SqmTypedNode<?>> arguments, ReturnableType<T> impliedResultType, QueryEngine queryEngine)

Implements org.hibernate.query.sqm.function.SqmFunctionDescriptor.generateSqmExpression.

Instantiate this template with the given arguments and expected return type.
protected abstract <T> SelfRenderingSqmFunction<T>
generateSqmFunctionExpression(List<? extends SqmTypedNode<?>>
the arguments of the function invocation
arguments
,
ReturnableType<T>
the function return type as inferred from its usage
impliedResultType
,
QueryEngine queryEngine)

Return an SQM node or subtree representing an invocation of this function with the given arguments.

protected <T> SelfRenderingSqmAggregateFunction<T>
generateSqmOrderedSetAggregateFunctionExpression(List<? extends SqmTypedNode<?>>
the arguments of the function invocation
arguments
,
SqmPredicate filter, SqmOrderByClause withinGroupClause, ReturnableType<T>
the function return type as inferred from its usage
impliedResultType
,
QueryEngine queryEngine)

Return an SQM node or subtree representing an invocation of this ordered set-aggregate function with the given arguments.

protected <T> SelfRenderingSqmWindowFunction<T>
generateSqmWindowFunctionExpression(List<? extends SqmTypedNode<?>>
the arguments of the function invocation
arguments
,
SqmPredicate filter, Boolean respectNulls, Boolean fromFirst, ReturnableType<T>
the function return type as inferred from its usage
impliedResultType
,
QueryEngine queryEngine)

Return an SQM node or subtree representing an invocation of this window function with the given arguments.

public final <T> SelfRenderingSqmFunction<T>
generateWindowSqmExpression(List<? extends SqmTypedNode<?>> arguments, SqmPredicate filter, Boolean respectNulls, Boolean fromFirst, ReturnableType<T> impliedResultType, QueryEngine queryEngine)

Overrides default org.hibernate.query.sqm.function.SqmFunctionDescriptor.generateWindowSqmExpression.

Like generateSqmExpression(List, ReturnableType, QueryEngine) but also accepts a filter predicate.
public String
public ArgumentsValidator
getArgumentsValidator()

Implements org.hibernate.query.sqm.function.SqmFunctionDescriptor.getArgumentsValidator.

The object responsible for validating arguments of the function.
public FunctionArgumentTypeResolver
public String
public String
public FunctionReturnTypeResolver
public String
getSignature(String
the function name
name
)

Overrides default org.hibernate.query.sqm.function.SqmFunctionDescriptor.getSignature.

Used only for pretty-printing the function signature in the log.
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

argumentsValidatorback to summary
private final ArgumentsValidator argumentsValidator
functionArgumentTypeResolverback to summary
private final FunctionArgumentTypeResolver functionArgumentTypeResolver
nameback to summary
private final String name
returnTypeResolverback to summary
private final FunctionReturnTypeResolver returnTypeResolver

Constructor Detail

AbstractSqmFunctionDescriptorback to summary
public AbstractSqmFunctionDescriptor(String name)
AbstractSqmFunctionDescriptorback to summary
public AbstractSqmFunctionDescriptor(String name, ArgumentsValidator argumentsValidator)
AbstractSqmFunctionDescriptorback to summary
public AbstractSqmFunctionDescriptor(String name, ArgumentsValidator argumentsValidator, FunctionArgumentTypeResolver argumentTypeResolver)
AbstractSqmFunctionDescriptorback to summary
public AbstractSqmFunctionDescriptor(String name, ArgumentsValidator argumentsValidator, FunctionReturnTypeResolver returnTypeResolver, FunctionArgumentTypeResolver argumentTypeResolver)

Method Detail

generateAggregateSqmExpressionback to summary
public final <T> SelfRenderingSqmFunction<T> generateAggregateSqmExpression(List<? extends SqmTypedNode<?>> arguments, SqmPredicate filter, ReturnableType<T> impliedResultType, QueryEngine queryEngine)

Overrides default org.hibernate.query.sqm.function.SqmFunctionDescriptor.generateAggregateSqmExpression.

Doc from org.hibernate.query.sqm.function.SqmFunctionDescriptor.generateAggregateSqmExpression.

Like generateSqmExpression(List, ReturnableType, QueryEngine), but also accepts a filter predicate.

This method is intended for aggregate functions.

Annotations
@Override
generateOrderedSetAggregateSqmExpressionback to summary
public final <T> SelfRenderingSqmFunction<T> generateOrderedSetAggregateSqmExpression(List<? extends SqmTypedNode<?>> arguments, SqmPredicate filter, SqmOrderByClause withinGroupClause, ReturnableType<T> impliedResultType, QueryEngine queryEngine)

Overrides default org.hibernate.query.sqm.function.SqmFunctionDescriptor.generateOrderedSetAggregateSqmExpression.

Doc from org.hibernate.query.sqm.function.SqmFunctionDescriptor.generateOrderedSetAggregateSqmExpression.

Like generateSqmExpression(List, ReturnableType, QueryEngine), but also accepts a filter predicate and an order by clause.

This method is intended for ordered set aggregate functions.

Annotations
@Override
generateSqmAggregateFunctionExpressionback to summary
protected <T> SelfRenderingSqmAggregateFunction<T> generateSqmAggregateFunctionExpression(List<? extends SqmTypedNode<?>> arguments, SqmPredicate filter, ReturnableType<T> impliedResultType, QueryEngine queryEngine)

Return an SQM node or subtree representing an invocation of this aggregate function with the given arguments. This method may be overridden in the case of function descriptors that wish to customize creation of the node.

Parameters
arguments:List<? extends SqmTypedNode<?>>

the arguments of the function invocation

impliedResultType:ReturnableType<T>

the function return type as inferred from its usage

generateSqmExpressionback to summary
public final <T> SelfRenderingSqmFunction<T> generateSqmExpression(List<? extends SqmTypedNode<?>> arguments, ReturnableType<T> impliedResultType, QueryEngine queryEngine)

Implements org.hibernate.query.sqm.function.SqmFunctionDescriptor.generateSqmExpression.

Doc from org.hibernate.query.sqm.function.SqmFunctionDescriptor.generateSqmExpression.

Instantiate this template with the given arguments and expected return type. This produces a tree of SQM nodes representing a tree of function invocations. This allows a single HQL function to be defined in terms of other predefined (database independent) HQL functions, simplifying the task of writing HQL functions which are portable between databases.

Annotations
@Override
generateSqmFunctionExpressionback to summary
protected abstract <T> SelfRenderingSqmFunction<T> generateSqmFunctionExpression(List<? extends SqmTypedNode<?>> arguments, ReturnableType<T> impliedResultType, QueryEngine queryEngine)

Return an SQM node or subtree representing an invocation of this function with the given arguments. This method may be overridden in the case of function descriptors that wish to customize creation of the node.

Parameters
arguments:List<? extends SqmTypedNode<?>>

the arguments of the function invocation

impliedResultType:ReturnableType<T>

the function return type as inferred from its usage

generateSqmOrderedSetAggregateFunctionExpressionback to summary
protected <T> SelfRenderingSqmAggregateFunction<T> generateSqmOrderedSetAggregateFunctionExpression(List<? extends SqmTypedNode<?>> arguments, SqmPredicate filter, SqmOrderByClause withinGroupClause, ReturnableType<T> impliedResultType, QueryEngine queryEngine)

Return an SQM node or subtree representing an invocation of this ordered set-aggregate function with the given arguments. This method may be overridden in the case of function descriptors that wish to customize creation of the node.

Parameters
arguments:List<? extends SqmTypedNode<?>>

the arguments of the function invocation

impliedResultType:ReturnableType<T>

the function return type as inferred from its usage

generateSqmWindowFunctionExpressionback to summary
protected <T> SelfRenderingSqmWindowFunction<T> generateSqmWindowFunctionExpression(List<? extends SqmTypedNode<?>> arguments, SqmPredicate filter, Boolean respectNulls, Boolean fromFirst, ReturnableType<T> impliedResultType, QueryEngine queryEngine)

Return an SQM node or subtree representing an invocation of this window function with the given arguments. This method may be overridden in the case of function descriptors that wish to customize creation of the node.

Parameters
arguments:List<? extends SqmTypedNode<?>>

the arguments of the function invocation

impliedResultType:ReturnableType<T>

the function return type as inferred from its usage

generateWindowSqmExpressionback to summary
public final <T> SelfRenderingSqmFunction<T> generateWindowSqmExpression(List<? extends SqmTypedNode<?>> arguments, SqmPredicate filter, Boolean respectNulls, Boolean fromFirst, ReturnableType<T> impliedResultType, QueryEngine queryEngine)

Overrides default org.hibernate.query.sqm.function.SqmFunctionDescriptor.generateWindowSqmExpression.

Doc from org.hibernate.query.sqm.function.SqmFunctionDescriptor.generateWindowSqmExpression.

Like generateSqmExpression(List, ReturnableType, QueryEngine) but also accepts a filter predicate.

This method is intended for window functions.

Annotations
@Override
getArgumentListSignatureback to summary
public String getArgumentListSignature()
getArgumentsValidatorback to summary
public ArgumentsValidator getArgumentsValidator()

Implements org.hibernate.query.sqm.function.SqmFunctionDescriptor.getArgumentsValidator.

Doc from org.hibernate.query.sqm.function.SqmFunctionDescriptor.getArgumentsValidator.

The object responsible for validating arguments of the function.

Returns:ArgumentsValidator

an instance of ArgumentsValidator

Annotations
@Override
getArgumentTypeResolverback to summary
public FunctionArgumentTypeResolver getArgumentTypeResolver()
getNameback to summary
public String getName()
getReturnSignatureback to summary
public String getReturnSignature()
getReturnTypeResolverback to summary
public FunctionReturnTypeResolver getReturnTypeResolver()
getSignatureback to summary
public String getSignature(String name)

Overrides default org.hibernate.query.sqm.function.SqmFunctionDescriptor.getSignature.

Doc from org.hibernate.query.sqm.function.SqmFunctionDescriptor.getSignature.

Used only for pretty-printing the function signature in the log.

Parameters
name:String

the function name

Returns:String

the signature of the function