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

public Class FormatFunction

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.SQLServerFormatEmulation, org.hibernate.dialect.function.DB2FormatEmulation
Imports
java.util.ArrayList, .List, org.hibernate.dialect.Dialect, org.hibernate.internal.util.StringHelper, org.hibernate.metamodel.mapping.JdbcMappingContainer, .MappingModelExpressible, org.hibernate.query.ReturnableType, org.hibernate.query.spi.QueryEngine, org.hibernate.query.sqm.BinaryArithmeticOperator, .ComparisonOperator, .TemporalUnit, org.hibernate.query.sqm.function.AbstractSqmFunctionDescriptor, .AbstractSqmSelfRenderingFunctionDescriptor, .FunctionRenderer, .FunctionRenderingSupport, .MultipatternSqmFunctionDescriptor, .SelfRenderingFunctionSqlAstExpression, .SelfRenderingSqmFunction, .SqmFunctionDescriptor, org.hibernate.query.sqm.produce.function.ArgumentTypesValidator, .ArgumentsValidator, .FunctionReturnTypeResolver, .StandardArgumentsValidators, .StandardFunctionArgumentTypeResolvers, .StandardFunctionReturnTypeResolvers, org.hibernate.query.sqm.sql.SqmToSqlAstConverter, org.hibernate.query.sqm.tree.SqmTypedNode, org.hibernate.sql.ast.SqlAstTranslator, org.hibernate.sql.ast.spi.SqlAppender, .StringBuilderSqlAppender, org.hibernate.sql.ast.tree.SqlAstNode, org.hibernate.sql.ast.tree.expression.BinaryArithmeticExpression, .CaseSearchedExpression, .CastTarget, .DurationUnit, .Expression, .Format, .QueryLiteral, .SqlTuple, .SqlTupleContainer, org.hibernate.sql.ast.tree.predicate.BetweenPredicate, .ComparisonPredicate, org.hibernate.type.BasicType, .SqlTypes, .StandardBasicTypes, org.hibernate.type.spi.TypeConfiguration

Deprecated

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

A format function with support for composite temporal expressions.
Author
Christian Beikov

Nested and Inner Type Summary

Modifier and TypeClass and Description
protected static class

Field Summary

Modifier and TypeField and Description
private final boolean
private final String
private final boolean
private final boolean

Constructor Summary

AccessConstructor and Description
public
FormatFunction(String nativeFunctionName, TypeConfiguration typeConfiguration)

public
FormatFunction(String nativeFunctionName, boolean reversedArguments, boolean concatPattern, TypeConfiguration typeConfiguration)

public
FormatFunction(String nativeFunctionName, boolean reversedArguments, boolean concatPattern, boolean supportsTime, 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 String
private boolean
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:
generateAggregateSqmExpressiongenerateOrderedSetAggregateSqmExpressiongenerateSqmAggregateFunctionExpressiongenerateSqmExpressiongenerateSqmOrderedSetAggregateFunctionExpressiongenerateSqmWindowFunctionExpressiongenerateWindowSqmExpressiongetArgumentsValidatorgetArgumentTypeResolvergetNamegetReturnSignaturegetReturnTypeResolvergetSignature

Field Detail

concatPatternback to summary
private final boolean concatPattern
nativeFunctionNameback to summary
private final String nativeFunctionName
reversedArgumentsback to summary
private final boolean reversedArguments
supportsTimeback to summary
private final boolean supportsTime

Constructor Detail

FormatFunctionback to summary
public FormatFunction(String nativeFunctionName, TypeConfiguration typeConfiguration)
FormatFunctionback to summary
public FormatFunction(String nativeFunctionName, boolean reversedArguments, boolean concatPattern, TypeConfiguration typeConfiguration)
FormatFunctionback to summary
public FormatFunction(String nativeFunctionName, boolean reversedArguments, boolean concatPattern, boolean supportsTime, 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
getArgumentListSignatureback to summary
public String getArgumentListSignature()

Overrides org.hibernate.query.sqm.function.AbstractSqmFunctionDescriptor.getArgumentListSignature.

Annotations
@Override
isTimeTemporalback to summary
private boolean isTimeTemporal(SqlAstNode expression)
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
org.hibernate.dialect.function back to summary

protected Class FormatFunction.FormatSqmFunction<T>

extends SelfRenderingSqmFunction<T>
Class Inheritance

Field Summary

Modifier and TypeField and Description
private final boolean
private final TypeConfiguration

Constructor Summary

AccessConstructor and Description
public
FormatSqmFunction(SqmFunctionDescriptor descriptor, FunctionRenderingSupport renderingSupport, List<? extends SqmTypedNode<?>> arguments, ReturnableType<T> impliedResultType, ArgumentsValidator argumentsValidator, FunctionReturnTypeResolver returnTypeResolver, boolean supportsPatternLiterals, QueryEngine queryEngine)

public
FormatSqmFunction(SqmFunctionDescriptor descriptor, FunctionRenderer renderer, List<? extends SqmTypedNode<?>> arguments, ReturnableType<T> impliedResultType, ArgumentsValidator argumentsValidator, FunctionReturnTypeResolver returnTypeResolver, boolean supportsPatternLiterals, QueryEngine queryEngine)

Deprecated as a consequence of FunctionRenderer being deprecated.

Method Summary

Modifier and TypeMethod and Description
private Expression
concat(AbstractSqmSelfRenderingFunctionDescriptor concatFunction, BasicType<String> stringType, Expression expression, Expression expression2)

Deprecated as a consequence of AbstractSqmSelfRenderingFunctionDescriptor being deprecated.
private Expression
concatAsLiteral(AbstractSqmSelfRenderingFunctionDescriptor concatFunction, BasicType<String> stringType, String delimiter, Expression expression, Expression expression2)

Deprecated as a consequence of AbstractSqmSelfRenderingFunctionDescriptor being deprecated.
public Expression
private Expression
private Expression
private Expression
private AbstractSqmSelfRenderingFunctionDescriptor
getFunction(SqmToSqlAstConverter walker, String name)

Deprecated as a consequence of AbstractSqmSelfRenderingFunctionDescriptor being deprecated.
private AbstractSqmSelfRenderingFunctionDescriptor
getFunction(SqmToSqlAstConverter walker, String name, int argumentCount)

Deprecated as a consequence of AbstractSqmSelfRenderingFunctionDescriptor being deprecated.
private Expression
getHours(AbstractSqmSelfRenderingFunctionDescriptor floorFunction, AbstractSqmSelfRenderingFunctionDescriptor castFunction, BasicType<Integer> integerType, Expression offsetExpression)

Deprecated as a consequence of AbstractSqmSelfRenderingFunctionDescriptor being deprecated.
private Expression
getMinutes(AbstractSqmSelfRenderingFunctionDescriptor floorFunction, AbstractSqmSelfRenderingFunctionDescriptor castFunction, BasicType<Integer> integerType, Expression offsetExpression)

Deprecated as a consequence of AbstractSqmSelfRenderingFunctionDescriptor being deprecated.
private SqlAstNode
getOffsetAdjusted(SqlTuple sqlTuple, AbstractSqmSelfRenderingFunctionDescriptor timestampaddFunction, BasicType<Integer> integerType)

Deprecated as a consequence of AbstractSqmSelfRenderingFunctionDescriptor being deprecated.
Inherited from org.hibernate.query.sqm.function.SelfRenderingSqmFunction:
copygetArgumentsValidatorgetFunctionRenderergetImpliedResultTypegetMappingModelExpressiblegetNodeTypegetRenderingSupportgetReturnTypeResolverresolveResultTyperesolveResultTyperesolveResultTyperesolveSqlAstArguments

Field Detail

supportsPatternLiteralsback to summary
private final boolean supportsPatternLiterals
typeConfigurationback to summary
private final TypeConfiguration typeConfiguration

Constructor Detail

FormatSqmFunctionback to summary
public FormatSqmFunction(SqmFunctionDescriptor descriptor, FunctionRenderingSupport renderingSupport, List<? extends SqmTypedNode<?>> arguments, ReturnableType<T> impliedResultType, ArgumentsValidator argumentsValidator, FunctionReturnTypeResolver returnTypeResolver, boolean supportsPatternLiterals, QueryEngine queryEngine)
Annotations
@Deprecated
forRemoval:true
FormatSqmFunctionback to summary
public FormatSqmFunction(SqmFunctionDescriptor descriptor, FunctionRenderer renderer, List<? extends SqmTypedNode<?>> arguments, ReturnableType<T> impliedResultType, ArgumentsValidator argumentsValidator, FunctionReturnTypeResolver returnTypeResolver, boolean supportsPatternLiterals, QueryEngine queryEngine)

Deprecated

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

Method Detail

concatback to summary
private Expression concat(AbstractSqmSelfRenderingFunctionDescriptor concatFunction, BasicType<String> stringType, Expression expression, Expression expression2)

Deprecated

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

concatAsLiteralback to summary
private Expression concatAsLiteral(AbstractSqmSelfRenderingFunctionDescriptor concatFunction, BasicType<String> stringType, String delimiter, Expression expression, Expression expression2)

Deprecated

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

convertToSqlAstback to summary
public Expression convertToSqlAst(SqmToSqlAstConverter walker)

Overrides org.hibernate.query.sqm.function.SelfRenderingSqmFunction.convertToSqlAst.

Annotations
@Override
createFullOffsetback to summary
private Expression createFullOffset(AbstractSqmSelfRenderingFunctionDescriptor concatFunction, AbstractSqmSelfRenderingFunctionDescriptor floorFunction, AbstractSqmSelfRenderingFunctionDescriptor castFunction, BasicType<String> stringType, BasicType<Integer> integerType, Expression offsetExpression)

Deprecated

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

createMediumOffsetback to summary
private Expression createMediumOffset(AbstractSqmSelfRenderingFunctionDescriptor concatFunction, AbstractSqmSelfRenderingFunctionDescriptor substringFunction, AbstractSqmSelfRenderingFunctionDescriptor floorFunction, AbstractSqmSelfRenderingFunctionDescriptor castFunction, BasicType<String> stringType, BasicType<Integer> integerType, Expression offsetExpression)

Deprecated

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

createSmallOffsetback to summary
private Expression createSmallOffset(AbstractSqmSelfRenderingFunctionDescriptor concatFunction, AbstractSqmSelfRenderingFunctionDescriptor substringFunction, AbstractSqmSelfRenderingFunctionDescriptor floorFunction, AbstractSqmSelfRenderingFunctionDescriptor castFunction, BasicType<String> stringType, BasicType<Integer> integerType, Expression offsetExpression)

Deprecated

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

getFunctionback to summary
private AbstractSqmSelfRenderingFunctionDescriptor getFunction(SqmToSqlAstConverter walker, String name)

Deprecated

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

getFunctionback to summary
private AbstractSqmSelfRenderingFunctionDescriptor getFunction(SqmToSqlAstConverter walker, String name, int argumentCount)

Deprecated

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

getHoursback to summary
private Expression getHours(AbstractSqmSelfRenderingFunctionDescriptor floorFunction, AbstractSqmSelfRenderingFunctionDescriptor castFunction, BasicType<Integer> integerType, Expression offsetExpression)

Deprecated

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

getMinutesback to summary
private Expression getMinutes(AbstractSqmSelfRenderingFunctionDescriptor floorFunction, AbstractSqmSelfRenderingFunctionDescriptor castFunction, BasicType<Integer> integerType, Expression offsetExpression)

Deprecated

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

getOffsetAdjustedback to summary
private SqlAstNode getOffsetAdjusted(SqlTuple sqlTuple, AbstractSqmSelfRenderingFunctionDescriptor timestampaddFunction, BasicType<Integer> integerType)

Deprecated

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