orphanRemoval: wrong DELETE order

Description

Given the following JPA entity model:

The following test fails due to integrity constraint violation (tranche refereces tranchenmodell), because Hibernate removes entities in the following wrong order:

  1. Tranchenmodell

  2. Trache (contains foreign key to Tranchenmodell)

Environment

H2, Oracle

Activity

Show:
Maxim Frolov
November 4, 2014, 11:15 AM

A workaround is to use @OneToMany/@ManyToOne instead of @OneToOne/@OneToOne between Preisregelung and Tranchenmodell from the example above.
See test case diff here.

Gail Badner
November 20, 2014, 6:53 PM

Thank you for the clear and simple test case. I'll use it when fixing HHH-9091.

Brett Meyer
April 22, 2015, 9:14 PM

Closing rejected issues.

Assignee

Gail Badner

Reporter

Maxim Frolov

Fix versions

None

Labels

None

backPortable

None

Suitable for new contributors

None

Requires Release Note

None

Pull Request

None

backportDecision

None

Components

Affects versions

Priority

Major
Configure