Package org.hibernate.query.sqm.function
Class PatternBasedSqmFunctionDescriptor
java.lang.Object
org.hibernate.query.sqm.function.AbstractSqmFunctionDescriptor
org.hibernate.query.sqm.function.AbstractSqmSelfRenderingFunctionDescriptor
org.hibernate.query.sqm.function.PatternBasedSqmFunctionDescriptor
- All Implemented Interfaces:
FunctionRenderer
,FunctionRenderingSupport
,SqmFunctionDescriptor
Support for HQL functions that have different representations
in different SQL dialects, where the difference can be handled
via a pattern template.
In HQL we might define a function concat(?1, ?2)
to
concatenate two strings p1 and p2. Dialects register different
instances of this class using the same name (concat) but with
different templates or patterns: (?1 || ?2)
for Oracle,
concat(?1, ?2)
for MySQL, (?1 + ?2)
for SQL
Server. Each dialect defines a template as a string exactly as
shown above, marking each function parameter with '?' followed
by the parameter index. Parameters are indexed from 1. The
last parameter may be a vararg, indicated with the syntax
(?1 || ?2...)
.
-
Constructor Summary
ConstructorDescriptionPatternBasedSqmFunctionDescriptor
(PatternRenderer renderer, ArgumentsValidator argumentsValidator, FunctionReturnTypeResolver returnTypeResolver, FunctionArgumentTypeResolver argumentTypeResolver, String name, FunctionKind functionKind, String argumentListSignature) Constructs a pattern-based function template -
Method Summary
Modifier and TypeMethodDescriptionvoid
render
(SqlAppender sqlAppender, List<? extends SqlAstNode> sqlAstArguments, ReturnableType<?> returnType, SqlAstTranslator<?> walker) void
render
(SqlAppender sqlAppender, List<? extends SqlAstNode> sqlAstArguments, Predicate filter, Boolean respectNulls, Boolean fromFirst, ReturnableType<?> returnType, SqlAstTranslator<?> walker) void
render
(SqlAppender sqlAppender, List<? extends SqlAstNode> sqlAstArguments, Predicate filter, List<SortSpecification> withinGroup, ReturnableType<?> returnType, SqlAstTranslator<?> walker) void
render
(SqlAppender sqlAppender, List<? extends SqlAstNode> sqlAstArguments, Predicate filter, ReturnableType<?> returnType, SqlAstTranslator<?> walker) Methods inherited from class org.hibernate.query.sqm.function.AbstractSqmSelfRenderingFunctionDescriptor
generateSqmAggregateFunctionExpression, generateSqmFunctionExpression, generateSqmOrderedSetAggregateFunctionExpression, generateSqmWindowFunctionExpression, getFunctionKind
Methods inherited from class org.hibernate.query.sqm.function.AbstractSqmFunctionDescriptor
generateAggregateSqmExpression, generateOrderedSetAggregateSqmExpression, generateSqmExpression, generateWindowSqmExpression, getArgumentsValidator, getArgumentTypeResolver, getName, getReturnSignature, getReturnTypeResolver, getSignature
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.FunctionRenderer
render
Methods inherited from interface org.hibernate.query.sqm.function.FunctionRenderingSupport
render, render, render
Methods inherited from interface org.hibernate.query.sqm.function.SqmFunctionDescriptor
alwaysIncludesParentheses, generateSqmExpression, generateSqmExpression
-
Constructor Details
-
PatternBasedSqmFunctionDescriptor
public PatternBasedSqmFunctionDescriptor(PatternRenderer renderer, ArgumentsValidator argumentsValidator, FunctionReturnTypeResolver returnTypeResolver, FunctionArgumentTypeResolver argumentTypeResolver, String name, FunctionKind functionKind, String argumentListSignature) Constructs a pattern-based function template
-
-
Method Details
-
render
public void render(SqlAppender sqlAppender, List<? extends SqlAstNode> sqlAstArguments, ReturnableType<?> returnType, SqlAstTranslator<?> walker) - Specified by:
render
in interfaceFunctionRenderer
- Specified by:
render
in interfaceFunctionRenderingSupport
- Overrides:
render
in classAbstractSqmSelfRenderingFunctionDescriptor
-
render
public void render(SqlAppender sqlAppender, List<? extends SqlAstNode> sqlAstArguments, Predicate filter, ReturnableType<?> returnType, SqlAstTranslator<?> walker) -
render
public void render(SqlAppender sqlAppender, List<? extends SqlAstNode> sqlAstArguments, Predicate filter, List<SortSpecification> withinGroup, ReturnableType<?> returnType, SqlAstTranslator<?> walker) -
render
public void render(SqlAppender sqlAppender, List<? extends SqlAstNode> sqlAstArguments, Predicate filter, Boolean respectNulls, Boolean fromFirst, ReturnableType<?> returnType, SqlAstTranslator<?> walker) -
getArgumentListSignature
- Overrides:
getArgumentListSignature
in classAbstractSqmFunctionDescriptor
-