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
Copy file name to clipboardExpand all lines: hibernate-core/src/test/java/org/hibernate/orm/test/inheritance/discriminator/JoinedInheritanceDiscriminatorSelectionTest.java
+4-4Lines changed: 4 additions & 4 deletions
Original file line number
Diff line number
Diff line change
@@ -139,28 +139,28 @@ public void testSelectInstance(SessionFactoryScope scope) {
139
139
inspector.clear();
140
140
141
141
scope.inTransaction( session -> {
142
-
// With type filters we still join all subclasses when selecting the entity instance
142
+
// With type filters we still join all subclasses that have properties when selecting the entity instance
143
143
// because we are not aware of the type restriction when processing the selection
144
144
145
145
assertThat( session.createQuery(
146
146
"from ParentEntity p where type(p) = ParentEntity",
147
147
ParentEntity.class
148
148
).getResultList() ).hasSize( 1 );
149
-
inspector.assertNumberOfJoins( 0, 3 );
149
+
inspector.assertNumberOfJoins( 0, 2 );
150
150
inspector.clear();
151
151
152
152
assertThat( session.createQuery(
153
153
"from ParentEntity p where type(p) = ChildA",
154
154
ParentEntity.class
155
155
).getResultList() ).hasSize( 1 );
156
-
inspector.assertNumberOfJoins( 0, 3 );
156
+
inspector.assertNumberOfJoins( 0, 2 );
157
157
inspector.clear();
158
158
159
159
assertThat( session.createQuery(
160
160
"from ParentEntity p where type(p) = SubChildA",
161
161
ParentEntity.class
162
162
).getResultList() ).hasSize( 1 );
163
-
inspector.assertNumberOfJoins( 0, 3 );
163
+
inspector.assertNumberOfJoins( 0, 2 );
164
164
inspector.clear();
165
165
166
166
// With treat() we only join the needed subclasses
0 commit comments