Yoann Rodière (
https://hibernate.atlassian.net/secure/ViewProfile.jspa?accountId=557058%...
) *updated* an issue
Hibernate ORM (
https://hibernate.atlassian.net/browse/HHH?atlOrigin=eyJpIjoiNGM5MzJmNDdm...
) / New Feature (
https://hibernate.atlassian.net/browse/HHH-15508?atlOrigin=eyJpIjoiNGM5Mz...
) HHH-15508 (
https://hibernate.atlassian.net/browse/HHH-15508?atlOrigin=eyJpIjoiNGM5Mz...
) Backport Session#getReference(Object) to branch 5.6 (
https://hibernate.atlassian.net/browse/HHH-15508?atlOrigin=eyJpIjoiNGM5Mz...
)
Change By: Yoann Rodière (
https://hibernate.atlassian.net/secure/ViewProfile.jspa?accountId=557058%...
)
See [https://
github.com/quarkusio/quarkus/issues/27184|https://github.com/quarkusio/qu...],
[
https://github.com/quarkusio/quarkus/pull/27832|https://github.com/quarku...]
See [https://
hibernate.zulipchat.com/#narrow/stream/132094-hibernate-orm-dev/topic/Get...]
{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}
(
https://hibernate.atlassian.net/browse/HHH-15508#add-comment?atlOrigin=ey...
) Add Comment (
https://hibernate.atlassian.net/browse/HHH-15508#add-comment?atlOrigin=ey...
)
Get Jira notifications on your phone! Download the Jira Cloud app for Android (
https://play.google.com/store/apps/details?id=com.atlassian.android.jira....
) or iOS (
https://itunes.apple.com/app/apple-store/id1006972087?pt=696495&ct=Em...
) This message was sent by Atlassian Jira (v1001.0.0-SNAPSHOT#100207- sha1:30c8888 )