Skip to content

update hibernate up to the latest non-patched version - #1583

Open
aleksandy wants to merge 2 commits into
playframework:masterfrom
aleksandy:upgrade-hibernate
Open

aleksandy wants to merge 2 commits into
playframework:masterfrom
aleksandy:upgrade-hibernate

Conversation

@aleksandy

Copy link
Copy Markdown
Contributor

Summary

Removes the Play-patched hibernate-core jar and its build infrastructure, migrating the framework to a vanilla Hibernate ORM 7.4.14.Final. The Play-specific flush semantics (JPABase.willBeSaved), previously injected via a source patch of hibernate-core, are now implemented in the framework itself as forked flush event listeners, registered programmatically at bootstrap.

Play flush semantics as framework code (instead of patching Hibernate)

  • play.db.jpa.PlayAbstractFlushingEventListener — fork of Hibernate 7.4 AbstractFlushingEventListener with two Play changes: skip flush-time cascades for JPABase entities with willBeSaved == false, and veto collection recreate/remove/update actions for collections whose owner (or the entity being saved) is not going to be saved

  • PlayFlushEventListener / PlayAutoFlushEventListener — forks of DefaultFlushEventListener / DefaultAutoFlushEventListener (the latter is required, otherwise auto-flush on queries would use vanilla cascades)

  • PlayHibernateIntegrator registers them for EventType.FLUSH / EventType.AUTO_FLUSH; wired from JPAPlugin via JpaSettings.INTEGRATOR_PROVIDER (accepted as an instance, no ServiceLoader needed)

  • Each fork file contains the upstream 7.4.14 source kept as close to original as possible, with every Play change wrapped in // [play] ... // [/play] markers; framework/patches/hibernate-7.4.14-patch-play-fork.patch + README record the changes and document the upgrade workflow (copy upstream sources → rename → apply patch)

@mergify

mergify Bot commented Oct 26, 2026

Copy link
Copy Markdown
Contributor

Tick the box to add this pull request to the merge queue (same as @mergifyio queue).

  • Queue this pull request

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant