Skip to content

Commit f972dd4

Browse files
beikovsebersole
authored andcommitted
HHH-12565 Test showing TYPE for a TPC hierarchy leaf subtype fails
1 parent ecd6f50 commit f972dd4

File tree

1 file changed

+14
-8
lines changed

1 file changed

+14
-8
lines changed

hibernate-core/src/test/java/org/hibernate/test/unionsubclass3/UnionSubclassTest.java

Lines changed: 14 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,6 @@
66
*/
77
package org.hibernate.test.unionsubclass3;
88

9-
import org.hibernate.Session;
10-
import org.hibernate.Transaction;
11-
import org.hibernate.query.Query;
12-
139
import org.hibernate.testing.TestForIssue;
1410
import org.hibernate.testing.junit4.BaseCoreFunctionalTestCase;
1511
import org.junit.Test;
@@ -23,8 +19,6 @@
2319
import javax.persistence.InheritanceType;
2420
import javax.persistence.ManyToOne;
2521

26-
import org.hibernate.test.locking.A;
27-
2822
import static org.hibernate.testing.transaction.TransactionUtil.doInHibernate;
2923
import static org.junit.Assert.assertEquals;
3024

@@ -81,8 +75,7 @@ public void testUnionSubclassClassResults() {
8175
session.persist(child2);
8276
session.persist(child3);
8377
session.persist(child4);
84-
} );
85-
78+
});
8679
doInHibernate( this::sessionFactory, session -> {
8780
List results = session.createQuery(
8881
"select c " +
@@ -98,6 +91,19 @@ public void testUnionSubclassClassResults() {
9891
} );
9992
}
10093

94+
@Test
95+
@TestForIssue( jiraKey = "HHH-12565" )
96+
public void typeOfLeafTPC() {
97+
doInHibernate( this::sessionFactory, session -> {
98+
List results = session.createQuery(
99+
"select TYPE(f) " +
100+
"from Father f" +
101+
" where f.id = -1")
102+
.getResultList();
103+
assertEquals(0, results.size());
104+
} );
105+
}
106+
101107
@Entity(name = "Child")
102108
public static class Child
103109
{

0 commit comments

Comments
 (0)