Package org.hibernate.query.sqm.function
Class NamedSqmFunctionDescriptor
- java.lang.Object
-
- org.hibernate.query.sqm.function.AbstractSqmFunctionDescriptor
-
- org.hibernate.query.sqm.function.AbstractSqmSelfRenderingFunctionDescriptor
-
- org.hibernate.query.sqm.function.NamedSqmFunctionDescriptor
-
- All Implemented Interfaces:
FunctionRenderer
,FunctionRenderingSupport
,SqmFunctionDescriptor
- Direct Known Subclasses:
OracleSpatialFunction
,StandardSQLFunction
public class NamedSqmFunctionDescriptor extends AbstractSqmSelfRenderingFunctionDescriptor
Provides a standard implementation that supports the majority of the HQL functions that are translated to SQL. The Dialect and its sub-classes use this class to provide details required for processing of the associated function.
-
-
Constructor Summary
Constructors Constructor Description NamedSqmFunctionDescriptor(String functionName, boolean useParenthesesWhenNoArgs, ArgumentsValidator argumentsValidator, FunctionReturnTypeResolver returnTypeResolver)
NamedSqmFunctionDescriptor(String functionName, boolean useParenthesesWhenNoArgs, ArgumentsValidator argumentsValidator, FunctionReturnTypeResolver returnTypeResolver, FunctionArgumentTypeResolver argumentTypeResolver)
NamedSqmFunctionDescriptor(String functionName, boolean useParenthesesWhenNoArgs, ArgumentsValidator argumentsValidator, FunctionReturnTypeResolver returnTypeResolver, FunctionArgumentTypeResolver argumentTypeResolver, String name, FunctionKind functionKind, String argumentListSignature, SqlAstNodeRenderingMode argumentRenderingMode)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
alwaysIncludesParentheses()
Will a call to the described function always include parentheses?String
getArgumentListSignature()
String
getName()
Function name accessorvoid
render(SqlAppender sqlAppender, List<? extends SqlAstNode> sqlAstArguments, ReturnableType<?> returnType, SqlAstTranslator<?> translator)
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<?> translator)
void
render(SqlAppender sqlAppender, List<? extends SqlAstNode> sqlAstArguments, Predicate filter, ReturnableType<?> returnType, SqlAstTranslator<?> translator)
String
toString()
-
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, getReturnSignature, getReturnTypeResolver, getSignature
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, 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
generateSqmExpression, generateSqmExpression
-
-
-
-
Constructor Detail
-
NamedSqmFunctionDescriptor
public NamedSqmFunctionDescriptor(String functionName, boolean useParenthesesWhenNoArgs, ArgumentsValidator argumentsValidator, FunctionReturnTypeResolver returnTypeResolver)
-
NamedSqmFunctionDescriptor
public NamedSqmFunctionDescriptor(String functionName, boolean useParenthesesWhenNoArgs, ArgumentsValidator argumentsValidator, FunctionReturnTypeResolver returnTypeResolver, FunctionArgumentTypeResolver argumentTypeResolver)
-
NamedSqmFunctionDescriptor
public NamedSqmFunctionDescriptor(String functionName, boolean useParenthesesWhenNoArgs, ArgumentsValidator argumentsValidator, FunctionReturnTypeResolver returnTypeResolver, FunctionArgumentTypeResolver argumentTypeResolver, String name, FunctionKind functionKind, String argumentListSignature, SqlAstNodeRenderingMode argumentRenderingMode)
-
-
Method Detail
-
getName
public String getName()
Function name accessor- Overrides:
getName
in classAbstractSqmFunctionDescriptor
- Returns:
- The function name.
-
getArgumentListSignature
public String getArgumentListSignature()
- Overrides:
getArgumentListSignature
in classAbstractSqmFunctionDescriptor
-
alwaysIncludesParentheses
public boolean alwaysIncludesParentheses()
Description copied from interface:SqmFunctionDescriptor
Will a call to the described function always include parentheses?Instances of this interface are usually used for rendering of functions. 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 opening parenthesis, we can safely assume the token is a function name. Bur if the next token is not an opening parenthesis, the token might still represent a function if the function has a "no paren" form in the case of no arguments.
For example, many databases do not require parentheses for functions like
current_timestamp
and friends. This method helps account for those cases.- Returns:
true
by default
-
render
public void render(SqlAppender sqlAppender, List<? extends SqlAstNode> sqlAstArguments, ReturnableType<?> returnType, SqlAstTranslator<?> translator)
- 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<?> translator)
-
render
public void render(SqlAppender sqlAppender, List<? extends SqlAstNode> sqlAstArguments, Predicate filter, List<SortSpecification> withinGroup, ReturnableType<?> returnType, SqlAstTranslator<?> translator)
-
render
public void render(SqlAppender sqlAppender, List<? extends SqlAstNode> sqlAstArguments, Predicate filter, Boolean respectNulls, Boolean fromFirst, ReturnableType<?> returnType, SqlAstTranslator<?> walker)
-
-