Class GaussDBTruncRoundFunction
java.lang.Object
org.hibernate.query.sqm.function.AbstractSqmFunctionDescriptor
org.hibernate.community.dialect.function.GaussDBTruncRoundFunction
- All Implemented Interfaces:
org.hibernate.query.sqm.function.FunctionRenderer,org.hibernate.query.sqm.function.SqmFunctionDescriptor
public class GaussDBTruncRoundFunction
extends org.hibernate.query.sqm.function.AbstractSqmFunctionDescriptor
implements org.hibernate.query.sqm.function.FunctionRenderer
GaussDB only supports the two-argument
trunc and round functions
with the following signatures:
trunc(numeric, integer)round(numeric, integer)
This custom function falls back to using floor as a workaround only when necessary,
e.g. when there are 2 arguments to the function and either:
- The first argument is not of type
numeric
or
- The dialect doesn't support the two-argument
truncfunction
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected <T> org.hibernate.query.sqm.function.SelfRenderingSqmFunction<T> generateSqmFunctionExpression(List<? extends org.hibernate.query.sqm.tree.SqmTypedNode<?>> arguments, org.hibernate.metamodel.model.domain.ReturnableType<T> impliedResultType, org.hibernate.query.spi.QueryEngine queryEngine) voidrender(org.hibernate.sql.ast.spi.SqlAppender sqlAppender, List<? extends org.hibernate.sql.ast.tree.SqlAstNode> arguments, org.hibernate.metamodel.model.domain.ReturnableType<?> returnType, org.hibernate.sql.ast.SqlAstTranslator<?> walker) Methods inherited from class org.hibernate.query.sqm.function.AbstractSqmFunctionDescriptor
generateAggregateSqmExpression, generateOrderedSetAggregateSqmExpression, generateSqmAggregateFunctionExpression, generateSqmExpression, generateSqmOrderedSetAggregateFunctionExpression, generateSqmWindowFunctionExpression, 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, getFunctionKind, isPredicate
-
Constructor Details
-
GaussDBTruncRoundFunction
-
-
Method Details
-
render
public void render(org.hibernate.sql.ast.spi.SqlAppender sqlAppender, List<? extends org.hibernate.sql.ast.tree.SqlAstNode> arguments, org.hibernate.metamodel.model.domain.ReturnableType<?> returnType, org.hibernate.sql.ast.SqlAstTranslator<?> walker) - Specified by:
renderin interfaceorg.hibernate.query.sqm.function.FunctionRenderer
-
getArgumentListSignature
- Overrides:
getArgumentListSignaturein classorg.hibernate.query.sqm.function.AbstractSqmFunctionDescriptor
-
generateSqmFunctionExpression
protected <T> org.hibernate.query.sqm.function.SelfRenderingSqmFunction<T> generateSqmFunctionExpression(List<? extends org.hibernate.query.sqm.tree.SqmTypedNode<?>> arguments, org.hibernate.metamodel.model.domain.ReturnableType<T> impliedResultType, org.hibernate.query.spi.QueryEngine queryEngine) - Specified by:
generateSqmFunctionExpressionin classorg.hibernate.query.sqm.function.AbstractSqmFunctionDescriptor
-