Package org.hibernate.dialect.function
Class TimestampdiffFunction
java.lang.Object
org.hibernate.query.sqm.function.AbstractSqmFunctionDescriptor
org.hibernate.query.sqm.function.AbstractSqmSelfRenderingFunctionDescriptor
org.hibernate.dialect.function.TimestampdiffFunction
- All Implemented Interfaces:
FunctionRenderer,SqmFunctionDescriptor
The
timestampdiff() or datediff() function has a funny
syntax which accepts a TemporalUnit as the first argument, and
the actual set of accepted units varies widely. This class uses
Dialect.timestampdiffPattern(TemporalUnit, TemporalType, TemporalType)
to abstract these differences.-
Constructor Summary
ConstructorsConstructorDescriptionTimestampdiffFunction(Dialect dialect, TypeConfiguration typeConfiguration) TimestampdiffFunction(Dialect dialect, TypeConfiguration typeConfiguration, SqlAstNodeRenderingMode... renderingModes) -
Method Summary
Modifier and TypeMethodDescriptionexpression(ReturnableType<?> impliedResultType, SqlAstNode... sqlAstArguments) voidrender(SqlAppender sqlAppender, List<? extends SqlAstNode> arguments, ReturnableType<?> returnType, SqlAstTranslator<?> walker) Methods inherited from class org.hibernate.query.sqm.function.AbstractSqmSelfRenderingFunctionDescriptor
generateSqmAggregateFunctionExpression, generateSqmFunctionExpression, generateSqmOrderedSetAggregateFunctionExpression, generateSqmWindowFunctionExpression, getFunctionKindMethods inherited from class org.hibernate.query.sqm.function.AbstractSqmFunctionDescriptor
generateAggregateSqmExpression, generateOrderedSetAggregateSqmExpression, generateSqmExpression, generateWindowSqmExpression, getArgumentsValidator, getArgumentTypeResolver, getName, getReturnSignature, getReturnTypeResolver, getSignatureMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.hibernate.query.sqm.function.FunctionRenderer
render, render, render, renderMethods inherited from interface org.hibernate.query.sqm.function.SqmFunctionDescriptor
alwaysIncludesParentheses, generateSqmExpression, generateSqmExpression, isPredicate
-
Constructor Details
-
TimestampdiffFunction
-
TimestampdiffFunction
public TimestampdiffFunction(Dialect dialect, TypeConfiguration typeConfiguration, SqlAstNodeRenderingMode... renderingModes)
-
-
Method Details
-
render
public void render(SqlAppender sqlAppender, List<? extends SqlAstNode> arguments, ReturnableType<?> returnType, SqlAstTranslator<?> walker) - Specified by:
renderin interfaceFunctionRenderer- Overrides:
renderin classAbstractSqmSelfRenderingFunctionDescriptor
-
expression
public SelfRenderingFunctionSqlAstExpression expression(ReturnableType<?> impliedResultType, SqlAstNode... sqlAstArguments) -
getArgumentListSignature
- Overrides:
getArgumentListSignaturein classAbstractSqmFunctionDescriptor
-