Skip to content
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

When will 1.5 released with hibernate 6 support? #355

Open
ankitbardiyasapiens opened this issue Nov 21, 2023 · 6 comments
Open

When will 1.5 released with hibernate 6 support? #355

ankitbardiyasapiens opened this issue Nov 21, 2023 · 6 comments
Assignees

Comments

@ankitbardiyasapiens
Copy link

ankitbardiyasapiens commented Nov 21, 2023

We are doing a major upgrade on our application including hibernate 6. We use xstream for a very critial part of our application so we are looking for an upgrade since xstream-hibernate 1.4.20 still using hibernate 4 only.

@joehni joehni self-assigned this Dec 8, 2023
@joehni
Copy link
Member

joehni commented Dec 8, 2023

The Hibernate extension was once brought in as contribution, personally I never used it in a real project. So you may help with patches upgrading the head revision to the latest Hibernate version...

@gboersma
Copy link

gboersma commented Mar 23, 2024

I took this on, but it is a quick solution that is not ready to be added to Xstream.

This is what I did:

  • Get the latest XStream repo.
  • Switch to v-1.4.x branch.
  • Copied the xstream-hibernate code into my own project.
  • Update my own POM as needed, to reflect what is in the xstream POM.
  • Update references to Hibernate classes in util/Hibernate.java:
    -- PersistentBag = loadHibernateType("org.hibernate.collection.spi.PersistentBag");
    etc.
    EnversList = loadHibernateEnversType("org.hibernate.envers.internal.entities.mapper.relation.lazy.proxy.ListProxy");
    etc.
    I got the correct package + class names from looking at Hibernate 6 source code.

My plan is to implement this using a smarter approach, i.e works with Hibernate 4 or 6 and do proper testing. I hope to get to that soon, but this hack should get you going for now.

@gboersma
Copy link

I also want to point out that I could not update the HEAD (1.5.0-SNAPSHOT) version since it would not build for me. I was consistently getting errors with the Lambda test cases, among others. Once HEAD is in a better state, I can add the updates.

@joehni
Copy link
Member

joehni commented Mar 24, 2024

Just as a side note, master builds for me cleanly using Java 17 including execution of all unit tests. However, for the next two weeks I am offline, so don't expect any response for this time.
BTW: Do you have any numbers about the usage of the different major Hibernate versions? O simply wonder, what XStream 1.5 should support. 3+4 are probably completely out of scope...

@gboersma
Copy link

gboersma commented Mar 27, 2024

Okay, I can confirm that everything builds and passes tests with Java 17. I think I was using Java 21 instead, which does not build successfully. Please note that OpenJDK 17 is successful, but Oracle JDK 17 is not.

It should be easy to support all major hibernate versions. The code can try for 6 first, and if it fails, fall back to 3/4.

@joehni
Copy link
Member

joehni commented Apr 19, 2024

Sorry for the delay, I have this on my radar, but I am currently still overloaded...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants