Class DB2JsonTableFunction
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.DB2JsonTableFunction
- All Implemented Interfaces:
SetReturningFunctionRenderer
,SqmSetReturningFunctionDescriptor
DB2 json_table function.
This implementation/emulation goes to great lengths to ensure Hibernate ORM can provide the same
json_table()
experience that other dialects provide also on DB2.
The most notable limitation of the DB2 function is that it doesn't support JSON arrays,
so this emulation uses a series CTE called max_series
with 10_000 rows to join
each array element queried with json_query()
at the respective index via json_table()
separately.
Another notable limitation of the DB2 function is that it doesn't support nested column paths,
which requires emulation by joining each nesting with a separate json_table()
.-
Nested Class Summary
Nested ClassesNested classes/interfaces inherited from class org.hibernate.dialect.function.json.JsonTableFunction
JsonTableFunction.JsonTableArguments
-
Constructor Summary
ConstructorsConstructorDescriptionDB2JsonTableFunction
(int maximumSeriesSize, TypeConfiguration typeConfiguration) -
Method Summary
Modifier and TypeMethodDescriptionprotected String
determineColumnType
(CastTarget castTarget, SqlAstTranslator<?> walker) protected <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 void
renderJsonTable
(SqlAppender sqlAppender, JsonTableFunction.JsonTableArguments arguments, AnonymousTupleTableGroupProducer tupleType, String tableIdentifierVariable, SqlAstTranslator<?> walker) Methods inherited from class org.hibernate.dialect.function.json.JsonTableFunction
countNestedColumnDefinitions, determineColumnType, render, renderColumnDefinitions, renderColumnPath, renderColumns, renderJsonExistsColumnDefinition, renderJsonNestedColumnDefinition, renderJsonOrdinalityColumnDefinition, renderJsonQueryColumnDefinition, renderJsonValueColumnDefinition
Methods inherited from class org.hibernate.query.sqm.function.AbstractSqmSetReturningFunctionDescriptor
generateSqmExpression, getArgumentListSignature, getArgumentsValidator, getArgumentTypeResolver, getName, getSetReturningTypeResolver, getSignature
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.hibernate.query.sqm.function.SetReturningFunctionRenderer
rendersIdentifierVariable
-
Constructor Details
-
DB2JsonTableFunction
-
-
Method Details
-
generateSqmSetReturningFunctionExpression
protected <T> SelfRenderingSqmSetReturningFunction<T> generateSqmSetReturningFunctionExpression(List<? extends SqmTypedNode<?>> sqmArguments, 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 classJsonTableFunction
- Parameters:
sqmArguments
- the arguments of the function invocation
-
renderJsonTable
protected void renderJsonTable(SqlAppender sqlAppender, JsonTableFunction.JsonTableArguments arguments, AnonymousTupleTableGroupProducer tupleType, String tableIdentifierVariable, SqlAstTranslator<?> walker) - Overrides:
renderJsonTable
in classJsonTableFunction
-
determineColumnType
- Overrides:
determineColumnType
in classJsonTableFunction
-