HHH-12565 Test showing TYPE for a TPC hierarchy leaf subtype fails
This commit is contained in:
parent
ecd6f503f8
commit
f972dd4d29
|
@ -6,10 +6,6 @@
|
|||
*/
|
||||
package org.hibernate.test.unionsubclass3;
|
||||
|
||||
import org.hibernate.Session;
|
||||
import org.hibernate.Transaction;
|
||||
import org.hibernate.query.Query;
|
||||
|
||||
import org.hibernate.testing.TestForIssue;
|
||||
import org.hibernate.testing.junit4.BaseCoreFunctionalTestCase;
|
||||
import org.junit.Test;
|
||||
|
@ -23,8 +19,6 @@ import javax.persistence.Inheritance;
|
|||
import javax.persistence.InheritanceType;
|
||||
import javax.persistence.ManyToOne;
|
||||
|
||||
import org.hibernate.test.locking.A;
|
||||
|
||||
import static org.hibernate.testing.transaction.TransactionUtil.doInHibernate;
|
||||
import static org.junit.Assert.assertEquals;
|
||||
|
||||
|
@ -81,8 +75,7 @@ public class UnionSubclassTest extends BaseCoreFunctionalTestCase {
|
|||
session.persist(child2);
|
||||
session.persist(child3);
|
||||
session.persist(child4);
|
||||
} );
|
||||
|
||||
});
|
||||
doInHibernate( this::sessionFactory, session -> {
|
||||
List results = session.createQuery(
|
||||
"select c " +
|
||||
|
@ -98,6 +91,19 @@ public class UnionSubclassTest extends BaseCoreFunctionalTestCase {
|
|||
} );
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestForIssue( jiraKey = "HHH-12565" )
|
||||
public void typeOfLeafTPC() {
|
||||
doInHibernate( this::sessionFactory, session -> {
|
||||
List results = session.createQuery(
|
||||
"select TYPE(f) " +
|
||||
"from Father f" +
|
||||
" where f.id = -1")
|
||||
.getResultList();
|
||||
assertEquals(0, results.size());
|
||||
} );
|
||||
}
|
||||
|
||||
@Entity(name = "Child")
|
||||
public static class Child
|
||||
{
|
||||
|
|
Loading…
Reference in New Issue