Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Hibernate 6 upgrade: JSON functions need to be registered using new APIs #16336

@sguilhen

Description

@sguilhen

Before reporting an issue

  • I have searched existing issues
  • I have reproduced the issue with the latest release

Area

storage

Describe the bug

In Hibernate 6, custom functions have to be registered using new APIs. There seems to be a hook in the dialects (PostgresDialect and CockroachDialect) via the initializeFunctionRegistry method, but the preferred way seems to be via MetadataBuilderContributor.

I've attempted to use the contributor as it is already used to register the custom JsonbType, and apparently was able to register the ->> function (test of an actual query that uses this function was not yet done, but hibernate stopped complaining about unrecognized function).

We need to check if this is being done correctly and also register the -> and @> functions. One tricky thing about -> is that it has a JsonbType return type, and we need to check how exactly to map that when registering the function.

Version

quarkus3 branch

Expected behavior

All JSON functions used in map storage should be properly registered/tested with Hibernate 6

Actual behavior

Only ->> function is registered and we're not sure the approach taken is the correct one for that.

How to Reproduce?

User quarkus3 branch.

Anything else?

No response

Metadata

Metadata

Assignees

Labels

area/storageIndicates an issue that touches storage (change in data layout or data manipulation)kind/bugCategorizes a PR related to a bug

Type

No type

Projects

Status

✅ Done

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions