Package org.hibernate.dialect.function
Class DateTruncEmulation
- java.lang.Object
-
- org.hibernate.query.sqm.function.AbstractSqmFunctionDescriptor
-
- org.hibernate.dialect.function.DateTruncEmulation
-
- All Implemented Interfaces:
FunctionRenderingSupport
,SqmFunctionDescriptor
public class DateTruncEmulation extends AbstractSqmFunctionDescriptor implements FunctionRenderingSupport
Emulation oftrunc(datetime, temporal_unit)
function that leverages formatting the datetime to string and back to truncate it
-
-
Field Summary
Fields Modifier and Type Field Description protected String
toDateFunction
-
Constructor Summary
Constructors Modifier Constructor Description protected
DateTruncEmulation(String toDateFunction, TypeConfiguration typeConfiguration)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected <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.void
render(SqlAppender sqlAppender, List<? extends SqlAstNode> sqlAstArguments, SqlAstTranslator<?> walker)
-
Methods inherited from class org.hibernate.query.sqm.function.AbstractSqmFunctionDescriptor
generateAggregateSqmExpression, generateOrderedSetAggregateSqmExpression, generateSqmAggregateFunctionExpression, generateSqmExpression, generateSqmOrderedSetAggregateFunctionExpression, generateSqmWindowFunctionExpression, generateWindowSqmExpression, getArgumentListSignature, 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.FunctionRenderingSupport
render, render, render
-
Methods inherited from interface org.hibernate.query.sqm.function.SqmFunctionDescriptor
alwaysIncludesParentheses, generateSqmExpression, generateSqmExpression, getFunctionKind
-
-
-
-
Field Detail
-
toDateFunction
protected final String toDateFunction
-
-
Constructor Detail
-
DateTruncEmulation
protected DateTruncEmulation(String toDateFunction, TypeConfiguration typeConfiguration)
-
-
Method Detail
-
render
public void render(SqlAppender sqlAppender, List<? extends SqlAstNode> sqlAstArguments, SqlAstTranslator<?> walker)
- Specified by:
render
in interfaceFunctionRenderingSupport
-
generateSqmFunctionExpression
protected <T> SelfRenderingSqmFunction<T> generateSqmFunctionExpression(List<? extends SqmTypedNode<?>> arguments, ReturnableType<T> impliedResultType, QueryEngine queryEngine, TypeConfiguration typeConfiguration)
Description copied from class:AbstractSqmFunctionDescriptor
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.- Specified by:
generateSqmFunctionExpression
in classAbstractSqmFunctionDescriptor
- Parameters:
arguments
- the arguments of the function invocationimpliedResultType
- the function return type as inferred from its usage
-
-