-
Notifications
You must be signed in to change notification settings - Fork 368
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add a hypersistence-utils-hibernate-63 module for Hibernate 6.3 #657
Comments
Hibernate 6.3 is not supported yet. Feel free to implement it and send me a Pull Request when you are done. |
@vladmihalcea Are you no longer contributing to the project? |
Just FYI for anyone stumbling over this: Hibernate 6.3 has native support for PostgreSQL enums. Just use @JdbcType(PostgreSQLEnumJdbcType::class)
val myEnum: MyEnum (or the respective Java equivalent) I still use hypersistence-utils for PostgreSQL interval types - it's great! - but for enums it is not required anymore. |
@oliveryasuna Over the next few years, I will be very busy and won't have too much spare time to work on this project. However, if you provide a Pull Request with the fix, I will find some time to review and integrate it. Looking forward to your contributions. |
We could really use a hibernate 6.3 compatible version. I don't think I have the skills with hibernate's internals to make it happen. Hopefully some kind soul with the skills does! |
The question is: what would need to be done? Apart from removing enum support from hypersistence-utils (as it's not required anymore thanks to built-in support), is there anything that requires actual changes for Hibernate 6.3? As mentioned, I'm only using hypersistence |
Here's what's needed to be done:
That's it. |
@benstpierre @milgner @vladmihalcea A discussion should be had on whether enum support should be removed from hypersistence-utils or updated to support Hibernate 6.3. In no particular order... Argument 1: Update hypersistence-utils to support Hibernate 6.3's enum
Argument 2: Drop enum support in favor of Hibernate's native support
I would love to hear from @thjanssen. @vladmihalcea How do you expect branching/tagging to work? |
The PostgreSQL Enum Type in Hypersistence Utils does not do anything special. If the Hibernate 6 provides support for it, then the current Type should be deprecated in the 60 snd 62 modules and removed in the new 63 module. Most likely that a new module will be needed. |
Hi i just discovered this wonderful project today and used it for getting the native Query generated by PSQL. i can confirm that Hibernate 6.3 does not work: i also get an exception "contains compatible versions ..." and had to revert to 6.2.9. So it is definitely not only about PostgreSQL Enum's. Andrej |
Could you add the full error message and stacktrace here? That would certainly help to get a full picture of what needs to be done. |
@milgner From the previous Hibernate 6 modules, there are surely tons of things that have to be done. You can use this branch as a starting point, and if you run
However, this is just to compile the main classes. When this part is fixed, there are tests that might be failing, too, and those will have to be fixed as well. |
here is the stacktrace i get when using Hibernate 6.3.1:
|
As a workaround for mapping Postgres types, what I was used to do with @TypeDefs({
@TypeDef(name = "my_postgres_enum_type_name", typeClass = PostgreSQLEnumType.class)
})
public class MyEntity {
@Enumerated(EnumType.STRING)
@Type(type = "my_postgres_enum_type_name")
MyJavaEnumName field; What worked for me on Spring Boot 3.1.4, Hibernate 6.3.1 is @Enumerated(EnumType.STRING)
@Column(columnDefinition = "my_postgres_enum_type_name")
@JdbcTypeCode(SqlTypes.NAMED_ENUM)
MyJavaEnumName field; |
More an FYI: Since Spring-Boot 3.2 Hibernate 6.3 is included. Which makes this library not compatible anymore with newer Spring-Boot versions starting with 3.2 that was released today... |
@dreis2211 It will be compatible when this issue is fixed. Looking forward to the Pull Request that fixes it. |
Based on the comment here, it might make sense to directly go to Hibernate 6.4: https://hibernate.atlassian.net/browse/HHH-17454?focusedCommentId=113382 |
@vladmihalcea should we then use Spring 6.1.x in the new |
@adrianAzoitei Currently, there's only a branch where nothing was done, so feel free to do anything that's needed to make it work with Hibernate 6.3 and 6.4. |
All in all the necessary code changes to make it compile and test successfully with Hibernate 6.3 were small. As I don't use most of the libraries features I have no proper real world test case for the changes. So please try out the changes and report any issues. |
Fixed. |
This MR contains the following updates: | Package | Type | Update | Change | |---|---|---|---| | [flow-bin](https://github.com/flowtype/flow-bin) ([changelog](https://github.com/facebook/flow/blob/master/Changelog.md)) | devDependencies | minor | [`^0.224.0` -> `^0.225.0`](https://renovatebot.com/diffs/npm/flow-bin/0.224.0/0.225.1) | | [org.liquibase.ext:liquibase-hibernate5](https://github.com/liquibase/liquibase-hibernate/wiki) ([source](https://github.com/liquibase/liquibase-hibernate)) | build | patch | `4.25.0` -> `4.25.1` | | [org.liquibase:liquibase-maven-plugin](http://www.liquibase.org/liquibase-maven-plugin) ([source](https://github.com/liquibase/liquibase)) | build | patch | `4.25.0` -> `4.25.1` | | [org.jsoup:jsoup](https://jsoup.org/) ([source](https://github.com/jhy/jsoup)) | compile | patch | `1.17.1` -> `1.17.2` | | [io.hypersistence:hypersistence-utils-hibernate-62](https://github.com/vladmihalcea/hypersistence-utils) | compile | minor | `3.6.1` -> `3.7.0` | | [io.quarkus:quarkus-maven-plugin](https://github.com/quarkusio/quarkus) | build | patch | `3.6.3` -> `3.6.4` | | [io.quarkus:quarkus-universe-bom](https://github.com/quarkusio/quarkus-platform) | import | patch | `3.6.3` -> `3.6.4` | | [org.apache.maven.plugins:maven-compiler-plugin](https://maven.apache.org/plugins/) | build | minor | `3.11.0` -> `3.12.1` | --- ### Release Notes <details> <summary>flowtype/flow-bin</summary> ### [`v0.225.1`](flow/flow-bin@62a43fb...23ec616) [Compare Source](flow/flow-bin@62a43fb...23ec616) ### [`v0.225.0`](flow/flow-bin@e6104a1...62a43fb) [Compare Source](flow/flow-bin@e6104a1...62a43fb) </details> <details> <summary>liquibase/liquibase</summary> ### [`v4.25.1`](https://github.com/liquibase/liquibase/blob/HEAD/changelog.txt#Liquibase-4251-is-a-patch-release) [Compare Source](liquibase/liquibase@v4.25.0...v4.25.1) </details> <details> <summary>jhy/jsoup</summary> ### [`v1.17.2`](https://github.com/jhy/jsoup/blob/HEAD/CHANGES.md#​1172-2023-Dec-29) ##### Improvements - **Attribute object accessors**: Added `Element.attribute(String)` and `Attributes.attribute(String)` to more simply obtain an `Attribute` object. [2069](jhy/jsoup#2069) - **Attribute source tracking**: If source tracking is on, and an Attribute's key is changed ( via `Attribute.setKey(String)`), the source range is now still tracked in `Attribute.sourceRange()`. [2070](jhy/jsoup#2070) - **Wildcard attribute selector**: Added support for the `[*]` element with any attribute selector. And also restored support for selecting by an empty attribute name prefix (`[^]`). [2079](jhy/jsoup#2079) ##### Bug Fixes - **Mixed-cased source position**: When tracking the source position of attributes, if the source attribute name was mix-cased but the parser was lower-case normalizing attribute names, the source position for that attribute was not tracked correctly. [2067](jhy/jsoup#2067) - **Source position NPE**: When tracking the source position of a body fragment parse, a null pointer exception was thrown. [2068](jhy/jsoup#2068) - **Multi-point emoji entity**: A multi-point encoded emoji entity may be incorrectly decoded to the replacement character. [2074](jhy/jsoup#2074) - **Selector sub-expressions**: (Regression) in a selector like `parent [attr=va], other`, the `, OR` was binding to `[attr=va]` instead of `parent [attr=va]`, causing incorrect selections. The fix includes a EvaluatorDebug class that generates a sexpr to represent the query, allowing simpler and more thorough query parse tests. [2073](jhy/jsoup#2073) - **XML CData output**: When generating XML-syntax output from parsed HTML, script nodes containing (pseudo) CData sections would have an extraneous CData section added, causing script execution errors. Now, the data content is emitted in a HTML/XML/XHTML polyglot format, if the data is not already within a CData section. [2078](jhy/jsoup#2078) - **Thread safety**: The `:has` evaluator held a non-thread-safe Iterator, and so if an Evaluator object was shared across multiple concurrent threads, a NoSuchElement exception may be thrown, and the selected results may be incorrect. Now, the iterator object is a thread-local. [2088](jhy/jsoup#2088) *** Older changes for versions 0.1.1 (2010-Jan-31) through 1.17.1 (2023-Nov-27) may be found in [change-archive.txt](./change-archive.txt). </details> <details> <summary>vladmihalcea/hypersistence-utils</summary> ### [`v3.7.0`](https://github.com/vladmihalcea/hypersistence-utils/blob/HEAD/changelog.txt#Version-370---December-18-2023) \================================================================================ Oracle Interval Type does not support negative intervals [#​682](vladmihalcea/hypersistence-utils#682) Return original object if target and original are the same when merging [#​677](vladmihalcea/hypersistence-utils#677) Add a hypersistence-utils-hibernate-63 module for Hibernate 6.3 [#​657](vladmihalcea/hypersistence-utils#657) </details> <details> <summary>quarkusio/quarkus</summary> ### [`v3.6.4`](https://github.com/quarkusio/quarkus/releases/tag/3.6.4) [Compare Source](quarkusio/quarkus@3.6.3...3.6.4) ##### Complete changelog - [#​37808](quarkusio/quarkus#37808) - CLI - Rework how missing commands are detected - [#​37803](quarkusio/quarkus#37803) - Dev mode: add null checks to TimestampSet.isRestartNeeded() - [#​37798](quarkusio/quarkus#37798) - Only update ~/.docker/config.json if it exists - [#​37787](quarkusio/quarkus#37787) - Take priority into account in ConfigurationImpl - [#​37775](quarkusio/quarkus#37775) - Docs: fix typo in rabbitmq reference documentation - [#​37770](quarkusio/quarkus#37770) - Add SequencedCollection to BANNED_INTERFACE_TYPES - [#​37768](quarkusio/quarkus#37768) - Running application build with JDK21 and target Java 17 crash with NoClassDefFoundError: java/util/SequencedCollection - [#​37731](quarkusio/quarkus#37731) - Query logging is being done in io.quarkus.mongodb.panache.common.runtime.MongoOperations - [#​37723](quarkusio/quarkus#37723) - Do not use CSRF cookie as the next token value - [#​37717](quarkusio/quarkus#37717) - Docs: Fix incorrect link reference in Cross-Site Request Forgery Prevention guide - [#​37714](quarkusio/quarkus#37714) - Remove the driver property in the documentation for Cloud SQL - [#​37710](quarkusio/quarkus#37710) - Use NoStackTraceException in metrics - [#​37677](quarkusio/quarkus#37677) - Bump io.quarkus:quarkus-platform-bom-maven-plugin from 0.0.100 to 0.0.101 - [#​37654](quarkusio/quarkus#37654) - Make sure dev mode is properly written in doc - [#​36848](quarkusio/quarkus#36848) - CSRF Token with HMAC signature gets double signed </details> <details> <summary>quarkusio/quarkus-platform</summary> ### [`v3.6.4`](quarkusio/quarkus-platform@3.6.3...3.6.4) [Compare Source](quarkusio/quarkus-platform@3.6.3...3.6.4) </details> --- ### Configuration 📅 **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined). 🚦 **Automerge**: Enabled. ♻ **Rebasing**: Whenever MR is behind base branch, or you tick the rebase/retry checkbox. 👻 **Immortal**: This MR will be recreated if closed unmerged. Get [config help](https://github.com/renovatebot/renovate/discussions) if that's undesired. --- - [ ] <!-- rebase-check -->If you want to rebase/retry this MR, check this box --- This MR has been generated by [Renovate Bot](https://github.com/renovatebot/renovate). <!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzNC4yNC4wIiwidXBkYXRlZEluVmVyIjoiMzQuMjQuMCJ9-->
Description:
An attempt was made to call a method that does not exist. The attempt was made from the following location:
io.hypersistence.utils.hibernate.type.basic.PostgreSQLEnumType.setParameterValues(PostgreSQLEnumType.java:56)
The following method did not exist:
org.hibernate.metamodel.model.convert.spi.EnumValueConverter org.hibernate.type.EnumType.getEnumValueConverter()
The text was updated successfully, but these errors were encountered: