Package org.hibernate.query.sqm.function
Class AbstractSqmFunctionDescriptor
- java.lang.Object
-
- org.hibernate.query.sqm.function.AbstractSqmFunctionDescriptor
-
- All Implemented Interfaces:
SqmFunctionDescriptor
- Direct Known Subclasses:
AbstractSqmSelfRenderingFunctionDescriptor
,CastStrEmulation
,CoalesceIfnullEmulation
,ExtractFunction
,FormatFunction
,InsertSubstringOverlayEmulation
,JdbcEscapeFunctionDescriptor
,LocatePositionEmulation
,LpadRpadPadEmulation
,MultipatternSqmFunctionDescriptor
,NvlCoalesceEmulation
,OrderByFragmentFunction
public abstract class AbstractSqmFunctionDescriptor extends Object implements SqmFunctionDescriptor
-
-
Constructor Summary
Constructors Constructor Description AbstractSqmFunctionDescriptor(String name)
AbstractSqmFunctionDescriptor(String name, ArgumentsValidator argumentsValidator)
AbstractSqmFunctionDescriptor(String name, ArgumentsValidator argumentsValidator, FunctionArgumentTypeResolver argumentTypeResolver)
AbstractSqmFunctionDescriptor(String name, ArgumentsValidator argumentsValidator, FunctionReturnTypeResolver returnTypeResolver, FunctionArgumentTypeResolver argumentTypeResolver)
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description <T> SelfRenderingSqmFunction<T>
generateAggregateSqmExpression(List<? extends SqmTypedNode<?>> arguments, SqmPredicate filter, ReturnableType<T> impliedResultType, QueryEngine queryEngine, TypeConfiguration typeConfiguration)
LikeSqmFunctionDescriptor.generateSqmExpression(List, ReturnableType, QueryEngine, TypeConfiguration)
but also accepts a filter predicate.<T> SelfRenderingSqmFunction<T>
generateOrderedSetAggregateSqmExpression(List<? extends SqmTypedNode<?>> arguments, SqmPredicate filter, SqmOrderByClause withinGroupClause, ReturnableType<T> impliedResultType, QueryEngine queryEngine, TypeConfiguration typeConfiguration)
LikeSqmFunctionDescriptor.generateSqmExpression(List, ReturnableType, QueryEngine, TypeConfiguration)
but also accepts a filter predicate.protected <T> SelfRenderingSqmAggregateFunction<T>
generateSqmAggregateFunctionExpression(List<? extends SqmTypedNode<?>> arguments, SqmPredicate filter, ReturnableType<T> impliedResultType, QueryEngine queryEngine, TypeConfiguration typeConfiguration)
Return an SQM node or subtree representing an invocation of this aggregate function with the given arguments.<T> SelfRenderingSqmFunction<T>
generateSqmExpression(List<? extends SqmTypedNode<?>> arguments, ReturnableType<T> impliedResultType, QueryEngine queryEngine, TypeConfiguration typeConfiguration)
Instantiate this template with the given arguments and expected return type.protected abstract <T> SelfRenderingSqmFunction<T>
generateSqmFunctionExpression(List<? extends SqmTypedNode<?>> arguments, ReturnableType<T> impliedResultType, QueryEngine queryEngine, TypeConfiguration typeConfiguration)
Return an SQM node or subtree representing an invocation of this function with the given arguments.protected <T> SelfRenderingSqmAggregateFunction<T>
generateSqmOrderedSetAggregateFunctionExpression(List<? extends SqmTypedNode<?>> arguments, SqmPredicate filter, SqmOrderByClause withinGroupClause, ReturnableType<T> impliedResultType, QueryEngine queryEngine, TypeConfiguration typeConfiguration)
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<?>> arguments, SqmPredicate filter, Boolean respectNulls, Boolean fromFirst, ReturnableType<T> impliedResultType, QueryEngine queryEngine, TypeConfiguration typeConfiguration)
Return an SQM node or subtree representing an invocation of this window function with the given arguments.<T> SelfRenderingSqmFunction<T>
generateWindowSqmExpression(List<? extends SqmTypedNode<?>> arguments, SqmPredicate filter, Boolean respectNulls, Boolean fromFirst, ReturnableType<T> impliedResultType, QueryEngine queryEngine, TypeConfiguration typeConfiguration)
LikeSqmFunctionDescriptor.generateSqmExpression(List, ReturnableType, QueryEngine, TypeConfiguration)
but also accepts a filter predicate.String
getArgumentListSignature()
ArgumentsValidator
getArgumentsValidator()
FunctionArgumentTypeResolver
getArgumentTypeResolver()
String
getName()
String
getReturnSignature()
FunctionReturnTypeResolver
getReturnTypeResolver()
String
getSignature(String name)
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.hibernate.query.sqm.function.SqmFunctionDescriptor
alwaysIncludesParentheses, generateSqmExpression, generateSqmExpression, getFunctionKind
-
-
-
-
Constructor Detail
-
AbstractSqmFunctionDescriptor
public AbstractSqmFunctionDescriptor(String name)
-
AbstractSqmFunctionDescriptor
public AbstractSqmFunctionDescriptor(String name, ArgumentsValidator argumentsValidator)
-
AbstractSqmFunctionDescriptor
public AbstractSqmFunctionDescriptor(String name, ArgumentsValidator argumentsValidator, FunctionArgumentTypeResolver argumentTypeResolver)
-
AbstractSqmFunctionDescriptor
public AbstractSqmFunctionDescriptor(String name, ArgumentsValidator argumentsValidator, FunctionReturnTypeResolver returnTypeResolver, FunctionArgumentTypeResolver argumentTypeResolver)
-
-
Method Detail
-
getName
public String getName()
-
getSignature
public String getSignature(String name)
- Specified by:
getSignature
in interfaceSqmFunctionDescriptor
-
getArgumentsValidator
public ArgumentsValidator getArgumentsValidator()
- Specified by:
getArgumentsValidator
in interfaceSqmFunctionDescriptor
-
getReturnTypeResolver
public FunctionReturnTypeResolver getReturnTypeResolver()
-
getArgumentTypeResolver
public FunctionArgumentTypeResolver getArgumentTypeResolver()
-
getReturnSignature
public String getReturnSignature()
-
getArgumentListSignature
public String getArgumentListSignature()
-
generateSqmExpression
public final <T> SelfRenderingSqmFunction<T> generateSqmExpression(List<? extends SqmTypedNode<?>> arguments, ReturnableType<T> impliedResultType, QueryEngine queryEngine, TypeConfiguration typeConfiguration)
Description copied from interface:SqmFunctionDescriptor
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.- Specified by:
generateSqmExpression
in interfaceSqmFunctionDescriptor
-
generateAggregateSqmExpression
public final <T> SelfRenderingSqmFunction<T> generateAggregateSqmExpression(List<? extends SqmTypedNode<?>> arguments, SqmPredicate filter, ReturnableType<T> impliedResultType, QueryEngine queryEngine, TypeConfiguration typeConfiguration)
Description copied from interface:SqmFunctionDescriptor
LikeSqmFunctionDescriptor.generateSqmExpression(List, ReturnableType, QueryEngine, TypeConfiguration)
but also accepts a filter predicate. This method is intended for aggregate functions.- Specified by:
generateAggregateSqmExpression
in interfaceSqmFunctionDescriptor
-
generateOrderedSetAggregateSqmExpression
public final <T> SelfRenderingSqmFunction<T> generateOrderedSetAggregateSqmExpression(List<? extends SqmTypedNode<?>> arguments, SqmPredicate filter, SqmOrderByClause withinGroupClause, ReturnableType<T> impliedResultType, QueryEngine queryEngine, TypeConfiguration typeConfiguration)
Description copied from interface:SqmFunctionDescriptor
LikeSqmFunctionDescriptor.generateSqmExpression(List, ReturnableType, QueryEngine, TypeConfiguration)
but also accepts a filter predicate. This method is intended for ordered set-aggregate functions.- Specified by:
generateOrderedSetAggregateSqmExpression
in interfaceSqmFunctionDescriptor
-
generateWindowSqmExpression
public final <T> SelfRenderingSqmFunction<T> generateWindowSqmExpression(List<? extends SqmTypedNode<?>> arguments, SqmPredicate filter, Boolean respectNulls, Boolean fromFirst, ReturnableType<T> impliedResultType, QueryEngine queryEngine, TypeConfiguration typeConfiguration)
Description copied from interface:SqmFunctionDescriptor
LikeSqmFunctionDescriptor.generateSqmExpression(List, ReturnableType, QueryEngine, TypeConfiguration)
but also accepts a filter predicate. This method is intended for aggregate functions.- Specified by:
generateWindowSqmExpression
in interfaceSqmFunctionDescriptor
-
generateSqmFunctionExpression
protected abstract <T> SelfRenderingSqmFunction<T> generateSqmFunctionExpression(List<? extends SqmTypedNode<?>> arguments, ReturnableType<T> impliedResultType, QueryEngine queryEngine, TypeConfiguration typeConfiguration)
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
- the arguments of the function invocationimpliedResultType
- the function return type as inferred from its usage
-
generateSqmAggregateFunctionExpression
protected <T> SelfRenderingSqmAggregateFunction<T> generateSqmAggregateFunctionExpression(List<? extends SqmTypedNode<?>> arguments, SqmPredicate filter, ReturnableType<T> impliedResultType, QueryEngine queryEngine, TypeConfiguration typeConfiguration)
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
- the arguments of the function invocationimpliedResultType
- the function return type as inferred from its usage
-
generateSqmOrderedSetAggregateFunctionExpression
protected <T> SelfRenderingSqmAggregateFunction<T> generateSqmOrderedSetAggregateFunctionExpression(List<? extends SqmTypedNode<?>> arguments, SqmPredicate filter, SqmOrderByClause withinGroupClause, ReturnableType<T> impliedResultType, QueryEngine queryEngine, TypeConfiguration typeConfiguration)
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
- the arguments of the function invocationimpliedResultType
- the function return type as inferred from its usage
-
generateSqmWindowFunctionExpression
protected <T> SelfRenderingSqmWindowFunction<T> generateSqmWindowFunctionExpression(List<? extends SqmTypedNode<?>> arguments, SqmPredicate filter, Boolean respectNulls, Boolean fromFirst, ReturnableType<T> impliedResultType, QueryEngine queryEngine, TypeConfiguration typeConfiguration)
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
- the arguments of the function invocationrespectNulls
-fromFirst
-impliedResultType
- the function return type as inferred from its usage
-
-