In a particular case as described below, order-inserts = true causes FK Violation, while order-inserts = false does not: # A (a self-referential Entity) is inherited by both B and C using Single_Table inheritance strategy. # We have created entites as so: C1 -> B1 -> C2 -> A1, where C1, C2, B1 and A1 are entities of types C,C,B and A respectively. # When persisting C1, an FK Violation is thrown. # In attached testcases [^hibernate-unit-test-case-queue.zip] , it is also observed that the order of inserts of some entities referred to by A,B or C gets ruined and causes FK violations different from observed with above case.
Above cases work just fine for order-inserts = false. Both above cases are included in the attached test cases. Is this a limitation of the order_inserts feature, a bug or am I missing an accepted workaround?
Edit: Was reported in 5.2.8.final, tested in 5.2.17, 5.3.1 and 5.3.7 and same test cases failed in all cases. Failing test cases are: Tests in error: InsertSortingTest1(org.hibernate.bugs.JPAUnitTestCase): Error while committing the transaction InsertSortingTest3(org.hibernate.bugs.JPAUnitTestCase): Error while committing the transaction InsertSortingTest6(org.hibernate.bugs.JPAUnitTestCase): Error while committing the transaction InsertSortingTest9(org.hibernate.bugs.JPAUnitTestCase): Error while committing the transaction |
|