Top Description Fields Constructors Methods
org.hibernate.dialect.function

public Class DateTruncEmulation

extends AbstractSqmFunctionDescriptor
implements FunctionRenderer
Class Inheritance
All Implemented Interfaces
org.hibernate.query.sqm.function.FunctionRenderer, org.hibernate.query.sqm.function.FunctionRenderingSupport
Known Direct Subclasses
org.hibernate.dialect.function.SqlServerConvertTruncFunction.DateTruncConvertEmulation, org.hibernate.dialect.function.SybaseTruncFunction.SybaseDateTruncEmulation
Imports
java.util.List, org.hibernate.query.ReturnableType, org.hibernate.query.spi.QueryEngine, org.hibernate.query.sqm.NodeBuilder, .TemporalUnit, org.hibernate.query.sqm.function.AbstractSqmFunctionDescriptor, .FunctionRenderer, .SelfRenderingSqmFunction, org.hibernate.query.sqm.produce.function.ArgumentTypesValidator, .StandardArgumentsValidators, .StandardFunctionArgumentTypeResolvers, .StandardFunctionReturnTypeResolvers, org.hibernate.query.sqm.tree.SqmTypedNode, org.hibernate.query.sqm.tree.expression.SqmExpression, .SqmExtractUnit, .SqmFormat, .SqmLiteral, org.hibernate.sql.ast.SqlAstTranslator, org.hibernate.sql.ast.spi.SqlAppender, org.hibernate.sql.ast.tree.SqlAstNode, org.hibernate.type.spi.TypeConfiguration

Deprecated

as a consequence of FunctionRenderer being deprecated. See corresponding docs for further information.

Emulation of trunc(datetime, temporal_unit) function that leverages formatting the datetime to string and back to truncate it
Author
Marco Belladelli

Field Summary

Modifier and TypeField and Description
private final SqmFormat
protected final String

Constructor Summary

AccessConstructor and Description
protected
DateTruncEmulation(String toDateFunction, TypeConfiguration typeConfiguration)

Method Summary

Modifier and TypeMethod and Description
protected <T> SelfRenderingSqmFunction<T>
generateSqmFunctionExpression(List<? extends SqmTypedNode<?>>
the arguments of the function invocation
arguments
,
ReturnableType<T>
the function return type as inferred from its usage
impliedResultType
,
QueryEngine queryEngine)

Implements abstract org.hibernate.query.sqm.function.AbstractSqmFunctionDescriptor.generateSqmFunctionExpression.

Return an SQM node or subtree representing an invocation of this function with the given arguments.
public void
render(SqlAppender sqlAppender, List<? extends SqlAstNode> sqlAstArguments, ReturnableType<?> returnType, SqlAstTranslator<?> walker)

Implements org.hibernate.query.sqm.function.FunctionRenderer.render.

Inherited from org.hibernate.query.sqm.function.AbstractSqmFunctionDescriptor:
generateAggregateSqmExpressiongenerateOrderedSetAggregateSqmExpressiongenerateSqmAggregateFunctionExpressiongenerateSqmExpressiongenerateSqmOrderedSetAggregateFunctionExpressiongenerateSqmWindowFunctionExpressiongenerateWindowSqmExpressiongetArgumentListSignaturegetArgumentsValidatorgetArgumentTypeResolvergetNamegetReturnSignaturegetReturnTypeResolvergetSignature

Field Detail

sqmFormatback to summary
private final SqmFormat sqmFormat
toDateFunctionback to summary
protected final String toDateFunction

Constructor Detail

DateTruncEmulationback to summary
protected DateTruncEmulation(String toDateFunction, TypeConfiguration typeConfiguration)

Method Detail

generateSqmFunctionExpressionback to summary
protected <T> SelfRenderingSqmFunction<T> generateSqmFunctionExpression(List<? extends SqmTypedNode<?>> arguments, ReturnableType<T> impliedResultType, QueryEngine queryEngine)

Implements abstract org.hibernate.query.sqm.function.AbstractSqmFunctionDescriptor.generateSqmFunctionExpression.

Doc from org.hibernate.query.sqm.function.AbstractSqmFunctionDescriptor.generateSqmFunctionExpression.

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.

Parameters
arguments:List<? extends SqmTypedNode<?>>

the arguments of the function invocation

impliedResultType:ReturnableType<T>

the function return type as inferred from its usage

Annotations
@Override
renderback to summary
public void render(SqlAppender sqlAppender, List<? extends SqlAstNode> sqlAstArguments, ReturnableType<?> returnType, SqlAstTranslator<?> walker)

Implements org.hibernate.query.sqm.function.FunctionRenderer.render.

Annotations
@Override