Deprecated
as a consequence of AbstractSqmSelfRenderingFunctionDescriptor being deprecated. See corresponding docs for further information.
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.
| Modifier and Type | Class and Description |
|---|---|
| private static class | TimestampdiffFunction.TimestampdiffFunctionReturnTypeResolver
A special resolver that resolves to DOUBLE for |
| Access | Constructor and Description |
|---|---|
| public |
| Modifier and Type | Method and Description |
|---|---|
| public SelfRenderingFunctionSqlAstExpression | |
| public String | |
| private PatternRenderer | |
| public void | render(SqlAppender sqlAppender, List<? extends SqlAstNode> arguments, ReturnableType<?> returnType, SqlAstTranslator<?> walker)
Overrides org. Implements org. |
| dialect | back to summary |
|---|---|
| private final Dialect dialect | |
| TimestampdiffFunction | back to summary |
|---|---|
| public TimestampdiffFunction(Dialect dialect, TypeConfiguration typeConfiguration) | |
| expression | back to summary |
|---|---|
| public SelfRenderingFunctionSqlAstExpression expression(ReturnableType<?> impliedResultType, SqlAstNode... sqlAstArguments) | |
| getArgumentListSignature | back to summary |
|---|---|
| public String getArgumentListSignature() Overrides org.
| |
| patternRenderer | back to summary |
|---|---|
| private PatternRenderer patternRenderer(TemporalUnit unit, Expression from, Expression to) | |
| render | back to summary |
|---|---|
| public void render(SqlAppender sqlAppender, List<? extends SqlAstNode> arguments, ReturnableType<?> returnType, SqlAstTranslator<?> walker) Overrides org. Implements org.
| |
TemporalUnit#SECOND and otherwise to LONG.
| Modifier and Type | Field and Description |
|---|---|
| private final BasicType | |
| private final BasicType |
| Access | Constructor and Description |
|---|---|
| public |
| Modifier and Type | Method and Description |
|---|---|
| public String | getReturnType()
Overrides default org. |
| public ReturnableType | resolveFunctionReturnType(ReturnableType<?> impliedType, List<? extends SqmTypedNode<?>> arguments, TypeConfiguration typeConfiguration)
Overrides default org. |
| public ReturnableType | resolveFunctionReturnType(ReturnableType<?> impliedType, Supplier<MappingModelExpressible<?>> inferredTypeSupplier, List<? extends SqmTypedNode<?>> arguments, TypeConfiguration typeConfiguration)
Overrides default org. |
| public BasicValuedMapping | resolveFunctionReturnType(Supplier<BasicValuedMapping> impliedTypeAccess, List<? extends SqlAstNode> arguments)
Implements org. |
| doubleType | back to summary |
|---|---|
| private final BasicType<Double> doubleType | |
| longType | back to summary |
|---|---|
| private final BasicType<Long> longType | |
| TimestampdiffFunctionReturnTypeResolver | back to summary |
|---|---|
| public TimestampdiffFunctionReturnTypeResolver(BasicType<Long> longType, BasicType<Double> doubleType) | |
| getReturnType | back to summary |
|---|---|
| public String getReturnType() Overrides default org. Doc from org. The return type in a format suitable for display to the user.
| |
| resolveFunctionReturnType | back to summary |
|---|---|
| public ReturnableType Overrides default org. Doc from org. Resolve the return type for a function given its context-implied type and the arguments to this call. The context-implied type is the type implied by where the function occurs in the query. E.g., for an equality predicate (`something = some_function`) the implied type of the return from `some_function` would be defined by the type of `some_function`.
| |
| resolveFunctionReturnType | back to summary |
|---|---|
| public ReturnableType Overrides default org. Doc from org. Resolve the return type for a function given its context-implied type and the arguments to this call. The context-implied type is the type implied by where the function occurs in the query. E.g., for an equality predicate (`something = some_function`) the implied type of the return from `some_function` would be defined by the type of `some_function`.
| |
| resolveFunctionReturnType | back to summary |
|---|---|
| public BasicValuedMapping resolveFunctionReturnType(Supplier<BasicValuedMapping> impliedTypeAccess, List<? extends SqlAstNode> arguments) Implements org. Doc from org. Resolve the return type for a function given its context-implied type and the arguments to this call. The context-implied type is the type implied by where the function occurs in the query. E.g., for an equality predicate (`something = some_function`) the implied type of the return from `some_function` would be defined by the type of `some_function`.
| |