You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
HHH-19565 @SQLRestriction should not be applied to a @manytoone
At least not when mapped to a foreign key association.
If we apply such a restriction, we will set the FK to null
when the entity is updated, resulting in data loss.
Note that this was the historical and correct behavior right
up until Hibernate 6.2. Some recent tests are asserting a
different and dangerous behavior, so I'm changing those tests.
Copy file name to clipboardExpand all lines: hibernate-core/src/test/java/org/hibernate/orm/test/inheritance/join/AttributeJoinWithRestrictedJoinedInheritanceTest.java
+2-1Lines changed: 2 additions & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -66,7 +66,8 @@ public void testLeftJoinWithDiscriminatorFiltering(SessionFactoryScope scope) {
Copy file name to clipboardExpand all lines: hibernate-core/src/test/java/org/hibernate/orm/test/mapping/where/WhereAnnotationAndJoinedInheritanceTest.java
+4-2Lines changed: 4 additions & 2 deletions
Original file line number
Diff line number
Diff line change
@@ -79,7 +79,8 @@ public void testCriteriaQuery(EntityManagerFactoryScope scope) {
0 commit comments