See [https://github.com/quarkusio/quarkus/issues/27184|https://github.com/quarkusio/quarkus/issues/27184|smart-link], [https://github.com/quarkusio/quarkus/pull/27832|https://github.com/quarkusio/quarkus/pull/27832|smart-link], [https://github.com/quarkusio/quarkus/pull/27928|https://github.com/quarkusio/quarkus/pull/27928|smart-link]
See [https://hibernate.zulipchat.com/#narrow/stream/132094-hibernate-orm-dev/topic/Getting.20reference.20to.20a.20potentially.20detached.20entity|https://hibernate.zulipchat.com/#narrow/stream/132094-hibernate-orm-dev/topic/Getting.20reference.20to.20a.20potentially.20detached.20entity|smart-link]
{quote}\[{{getReference(Object)}} is] the only way to safely get an attached instance of a detached entity without merging it. Critically, it's hard to get the ID of a detached entity in a completely safe way. {{Session#getIdentifier}} doesn't work on detached entities, and {{PersistenceUnitUtil#getIdentifier}}won't work on detached entities whose ID contains an association.{quote}
{quote}In this case I _think_ the patch would be limited to adding one method to {{Session}}, and that method wouldn't even be an overload (since there's no {{getReference}} method with one parameter), so the \[backporting] seems pretty safe.{quote} |
|