Package org.hibernate.dialect.function
Class H2GenerateSeriesFunction
java.lang.Object
org.hibernate.query.sqm.function.AbstractSqmSetReturningFunctionDescriptor
org.hibernate.query.sqm.function.AbstractSqmSelfRenderingSetReturningFunctionDescriptor
org.hibernate.dialect.function.GenerateSeriesFunction
org.hibernate.dialect.function.NumberSeriesGenerateSeriesFunction
org.hibernate.dialect.function.H2GenerateSeriesFunction
- All Implemented Interfaces:
SetReturningFunctionRenderer
,SqmSetReturningFunctionDescriptor
H2 generate_series function.
When possible, the
system_range
function is used directly.
If ordinality is requested, the arguments are temporals or anything other than literals,
this emulation comes into play.
It essentially renders a system_range
with a specified maximum size that serves as "iteration variable".
References to the value are replaced with expressions of the form start + step * iterationVariable
and a condition is added either to the query or join where the function is used to ensure that the value is
less than or equal to the stop value.-
Nested Class Summary
Nested classes/interfaces inherited from class org.hibernate.dialect.function.NumberSeriesGenerateSeriesFunction
NumberSeriesGenerateSeriesFunction.NumberSeriesGenerateSeriesSetReturningFunctionTypeResolver, NumberSeriesGenerateSeriesFunction.NumberSeriesQueryTransformer
-
Field Summary
Fields inherited from class org.hibernate.dialect.function.NumberSeriesGenerateSeriesFunction
maxSeriesSize
Fields inherited from class org.hibernate.dialect.function.GenerateSeriesFunction
coerceToTimestamp
-
Constructor Summary
ConstructorsConstructorDescriptionH2GenerateSeriesFunction
(int maxSeriesSize, TypeConfiguration typeConfiguration) -
Method Summary
Modifier and TypeMethodDescriptionprotected <T> SelfRenderingSqmSetReturningFunction<T>
generateSqmSetReturningFunctionExpression
(List<? extends SqmTypedNode<?>> arguments, QueryEngine queryEngine) Return an SQM node or subtree representing an invocation of this function with the given arguments.protected void
renderGenerateSeries
(SqlAppender sqlAppender, Expression start, Expression stop, @Nullable Expression step, AnonymousTupleTableGroupProducer tupleType, String tableIdentifierVariable, SqlAstTranslator<?> walker) boolean
rendersIdentifierVariable
(List<SqlAstNode> arguments, SessionFactoryImplementor sessionFactory) Methods inherited from class org.hibernate.dialect.function.NumberSeriesGenerateSeriesFunction
add, multiply, multiply, needsVariable
Methods inherited from class org.hibernate.dialect.function.GenerateSeriesFunction
render
Methods inherited from class org.hibernate.query.sqm.function.AbstractSqmSetReturningFunctionDescriptor
generateSqmExpression, getArgumentListSignature, getArgumentsValidator, getArgumentTypeResolver, getName, getSetReturningTypeResolver, getSignature
-
Constructor Details
-
H2GenerateSeriesFunction
-
-
Method Details
-
rendersIdentifierVariable
public boolean rendersIdentifierVariable(List<SqlAstNode> arguments, SessionFactoryImplementor sessionFactory) -
generateSqmSetReturningFunctionExpression
protected <T> SelfRenderingSqmSetReturningFunction<T> generateSqmSetReturningFunctionExpression(List<? extends SqmTypedNode<?>> arguments, QueryEngine queryEngine) Description copied from class:AbstractSqmSetReturningFunctionDescriptor
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.- Overrides:
generateSqmSetReturningFunctionExpression
in classAbstractSqmSelfRenderingSetReturningFunctionDescriptor
- Parameters:
arguments
- the arguments of the function invocation
-
renderGenerateSeries
protected void renderGenerateSeries(SqlAppender sqlAppender, Expression start, Expression stop, @Nullable Expression step, AnonymousTupleTableGroupProducer tupleType, String tableIdentifierVariable, SqlAstTranslator<?> walker) - Specified by:
renderGenerateSeries
in classNumberSeriesGenerateSeriesFunction
-