Backport Session#getReference(Object) to branch 5.6

Description

See , ,

 

See

[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#getIdentifierwon't work on detached entities whose ID contains an association.

 

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.

Activity

Show:
Fixed

Details

Assignee

Reporter

Components

Fix versions

Priority

Created September 14, 2022 at 9:35 AM
Updated September 27, 2022 at 10:48 AM
Resolved September 16, 2022 at 6:21 AM