Interface SqmFunctionDescriptor
-
- All Known Implementing Classes:
AbstractSqmFunctionDescriptor
,AbstractSqmSelfRenderingFunctionDescriptor
,AvgFunction
,CaseLeastGreatestEmulation
,CastFunction
,CastingConcatFunction
,CastStrEmulation
,ChrLiteralEmulation
,CoalesceIfnullEmulation
,ConcatPipeFunction
,CountFunction
,CurrentFunction
,DB2FormatEmulation
,DB2PositionFunction
,DB2SubstringFunction
,DerbyLpadEmulation
,DerbyRpadEmulation
,EveryAnyEmulation
,ExtractFunction
,FormatFunction
,HANASpatialAggregate
,HANASpatialFunction
,HypotheticalSetFunction
,HypotheticalSetWindowEmulation
,InsertSubstringOverlayEmulation
,IntegralTimestampaddFunction
,InverseDistributionFunction
,InverseDistributionWindowEmulation
,JdbcEscapeFunctionDescriptor
,LengthFunction
,ListaggFunction
,ListaggGroupConcatEmulation
,ListaggStringAggEmulation
,LocatePositionEmulation
,LpadRpadPadEmulation
,MinMaxCaseEveryAnyEmulation
,ModeStatsModeEmulation
,MultipatternSqmFunctionDescriptor
,NamedSqmFunctionDescriptor
,NvlCoalesceEmulation
,OracleSpatialFunction
,OracleSpatialSQLMMFunction
,OrderByFragmentFunction
,PatternBasedSqmFunctionDescriptor
,PostgreSQLMinMaxFunction
,QuantifiedLeastGreatestEmulation
,SDOGetGeometryType
,SDOMethodDescriptor
,SDORelateFunction
,SqlFunction
,SQLServerEveryAnyEmulation
,SQLServerFormatEmulation
,StandardSQLFunction
,STRelateFunction
,TimestampaddFunction
,TimestampdiffFunction
,TransactSQLStrFunction
,TrimFunction
public interface SqmFunctionDescriptor
A factory for SQM nodes representing invocations of a certain named function. When a function names and arguments are encountered in the HQL, aSqmFunctionDescriptor
for the given name is obtained from aSqmFunctionRegistry
, and thegenerateSqmExpression(java.util.List<? extends org.hibernate.query.sqm.tree.SqmTypedNode<?>>, org.hibernate.query.ReturnableType<T>, org.hibernate.query.spi.QueryEngine, org.hibernate.type.spi.TypeConfiguration)
method is called with the given argument SQM nodes to produce a subtree of SQM nodes representing the function invocation.
-
-
Method Summary
-
-
-
Method Detail
-
generateSqmExpression
<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. 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.
-
generateAggregateSqmExpression
default <T> SelfRenderingSqmFunction<T> generateAggregateSqmExpression(List<? extends SqmTypedNode<?>> arguments, SqmPredicate filter, ReturnableType<T> impliedResultType, QueryEngine queryEngine, TypeConfiguration typeConfiguration)
LikegenerateSqmExpression(List, ReturnableType, QueryEngine, TypeConfiguration)
but also accepts a filter predicate. This method is intended for aggregate functions.
-
generateOrderedSetAggregateSqmExpression
default <T> SelfRenderingSqmFunction<T> generateOrderedSetAggregateSqmExpression(List<? extends SqmTypedNode<?>> arguments, SqmPredicate filter, SqmOrderByClause withinGroupClause, ReturnableType<T> impliedResultType, QueryEngine queryEngine, TypeConfiguration typeConfiguration)
LikegenerateSqmExpression(List, ReturnableType, QueryEngine, TypeConfiguration)
but also accepts a filter predicate. This method is intended for ordered set-aggregate functions.
-
generateWindowSqmExpression
default <T> SelfRenderingSqmFunction<T> generateWindowSqmExpression(List<? extends SqmTypedNode<?>> arguments, SqmPredicate filter, Boolean respectNulls, Boolean fromFirst, ReturnableType<T> impliedResultType, QueryEngine queryEngine, TypeConfiguration typeConfiguration)
LikegenerateSqmExpression(List, ReturnableType, QueryEngine, TypeConfiguration)
but also accepts a filter predicate. This method is intended for aggregate functions.
-
generateSqmExpression
default <T> SelfRenderingSqmFunction<T> generateSqmExpression(SqmTypedNode<?> argument, ReturnableType<T> impliedResultType, QueryEngine queryEngine, TypeConfiguration typeConfiguration)
Convenience for single argument
-
generateSqmExpression
default <T> SelfRenderingSqmFunction<T> generateSqmExpression(ReturnableType<T> impliedResultType, QueryEngine queryEngine, TypeConfiguration typeConfiguration)
Convenience for no arguments
-
alwaysIncludesParentheses
default boolean alwaysIncludesParentheses()
Will a call to the described function always include parentheses?SqmFunctionTemplate is generally used for rendering of a function. However there are cases where Hibernate needs to consume a fragment and decide if a token represents a function name. In cases where the token is followed by an open-paren we can safely assume the token is a function name. However, if the next token is not an open-paren, the token can still represent a function provided that the function has a "no paren" form in the case of no arguments. E.g. Many databases do not require parentheses on functions like `current_timestamp`, etc. This method helps account for those cases.
Note that the most common case, by far, is that a function will always include the parentheses - therefore this return is defined as true by default. see Template#isFunction
-
getFunctionKind
default FunctionKind getFunctionKind()
-
getArgumentsValidator
ArgumentsValidator getArgumentsValidator()
-
-