Class H2JsonTableFunction
java.lang.Object
org.hibernate.query.sqm.function.AbstractSqmSetReturningFunctionDescriptor
org.hibernate.query.sqm.function.AbstractSqmSelfRenderingSetReturningFunctionDescriptor
org.hibernate.dialect.function.json.JsonTableFunction
org.hibernate.dialect.function.json.H2JsonTableFunction
- All Implemented Interfaces:
SetReturningFunctionRenderer,SqmSetReturningFunctionDescriptor
H2 json_table function.
H2 does not support "lateral" i.e. the use of a from node within another, but we can apply the same trick that we already applied everywhere else for H2, which is to join a sequence table to emulate array element rows and eliminate non-existing array elements by checking the index against array length. Finally, we rewrite the selection expressions to access the array by joined sequence index.
-
Nested Class Summary
Nested classes/interfaces inherited from class org.hibernate.dialect.function.json.JsonTableFunction
JsonTableFunction.JsonTableArguments -
Constructor Summary
ConstructorsConstructorDescriptionH2JsonTableFunction(int maximumArraySize, TypeConfiguration typeConfiguration) -
Method Summary
Modifier and TypeMethodDescriptionprotected <T> SelfRenderingSqmSetReturningFunction<T> generateSqmSetReturningFunctionExpression(List<? extends SqmTypedNode<?>> sqmArguments, QueryEngine queryEngine) Return an SQM node or subtree representing an invocation of this function with the given arguments.protected voidrenderJsonTable(SqlAppender sqlAppender, JsonTableFunction.JsonTableArguments arguments, AnonymousTupleTableGroupProducer tupleType, String tableIdentifierVariable, SqlAstTranslator<?> walker) booleanrendersIdentifierVariable(List<SqlAstNode> arguments, SessionFactoryImplementor sessionFactory) Methods inherited from class org.hibernate.dialect.function.json.JsonTableFunction
countNestedColumnDefinitions, determineColumnType, determineColumnType, render, renderColumnDefinitions, renderColumnPath, renderColumns, renderJsonExistsColumnDefinition, renderJsonNestedColumnDefinition, renderJsonOrdinalityColumnDefinition, renderJsonQueryColumnDefinition, renderJsonValueColumnDefinitionMethods inherited from class org.hibernate.query.sqm.function.AbstractSqmSetReturningFunctionDescriptor
generateSqmExpression, getArgumentListSignature, getArgumentsValidator, getArgumentTypeResolver, getName, getSetReturningTypeResolver, getSignature
-
Constructor Details
-
H2JsonTableFunction
-
-
Method Details
-
generateSqmSetReturningFunctionExpression
protected <T> SelfRenderingSqmSetReturningFunction<T> generateSqmSetReturningFunctionExpression(List<? extends SqmTypedNode<?>> sqmArguments, QueryEngine queryEngine) Description copied from class:AbstractSqmSetReturningFunctionDescriptorReturn 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:
generateSqmSetReturningFunctionExpressionin classJsonTableFunction- Parameters:
sqmArguments- the arguments of the function invocation
-
rendersIdentifierVariable
public boolean rendersIdentifierVariable(List<SqlAstNode> arguments, SessionFactoryImplementor sessionFactory) -
renderJsonTable
protected void renderJsonTable(SqlAppender sqlAppender, JsonTableFunction.JsonTableArguments arguments, AnonymousTupleTableGroupProducer tupleType, String tableIdentifierVariable, SqlAstTranslator<?> walker) - Overrides:
renderJsonTablein classJsonTableFunction
-