Bernat Gacias (
https://hibernate.atlassian.net/secure/ViewProfile.jspa?accountId=5c6acd8...
) *created* an issue
Hibernate ORM (
https://hibernate.atlassian.net/browse/HHH?atlOrigin=eyJpIjoiNjk0M2NkOGE3...
) / Bug (
https://hibernate.atlassian.net/browse/HHH-16970?atlOrigin=eyJpIjoiNjk0M2...
) HHH-16970 (
https://hibernate.atlassian.net/browse/HHH-16970?atlOrigin=eyJpIjoiNjk0M2...
) @OneToMany with orphanRemoval = true does not work in @Embeddable
org.hibernate.property.access.spi.PropertyAccessException (
https://hibernate.atlassian.net/browse/HHH-16970?atlOrigin=eyJpIjoiNjk0M2...
)
Issue Type: Bug Affects Versions: 6.2.6 Assignee: Unassigned Created: 21/Jul/2023 08:20 AM
Priority: Major Reporter: Bernat Gacias (
https://hibernate.atlassian.net/secure/ViewProfile.jspa?accountId=5c6acd8...
)
My problem is the case when i have an embedded attribute in an entity
The embeddable has a one to many relation with an orphan removal true
when i try to delete the main entity (which contains the embeddable) I have an
org.hibernate.property.access.spi.PropertyAccessException
it happens because the owner of the collection is the embeddable object and not the main
object so in
org.hibernate.engine.internal.Collections#processDereferencedCollection
i try to get the identifier
Object ownerId = loadedPersister.getOwnerEntityPersister().getIdentifier( coll.getOwner(),
session );
and i have a desynchronisation because the getOwnerEntityPersister() corresponds to the
maoin entity
and the coll.getOwner it’s the embeddable. So impossible to find the identifier.
I try to apply the solutions proposed here
https://stackoverflow.com/questions/9878066/embeddable-entity-with-onetom...
but it does not work in mi case.
How can I solve this
(
https://hibernate.atlassian.net/browse/HHH-16970#add-comment?atlOrigin=ey...
) Add Comment (
https://hibernate.atlassian.net/browse/HHH-16970#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#100232- sha1:4329f54 )