HHH-13742 - Added additional tests

This commit is contained in:
Jan-Willem Gmelig Meyling 2019-11-21 21:34:44 +01:00 committed by Andrea Boriero
parent 325239353e
commit 473566c50d
1 changed files with 22 additions and 0 deletions

View File

@ -122,6 +122,28 @@ public class HHH13670Test extends BaseCoreFunctionalTestCase {
});
}
@Test
public void testSubTypePropertyReferencedFromEntityJoinInSyntheticSubquery3() {
doInJPA(this::sessionFactory, em -> {
List<Tuple> resultList = em.createQuery(
"SELECT subB_0.id, subA_0.id, subB_0.id, subA_0.id FROM SubB subB_0 INNER JOIN SubA subA_0 ON 1=1 WHERE (EXISTS (SELECT 1 FROM Super s WHERE s.id = subB_0.parent.id)) ORDER BY subB_0.id ASC, subA_0.id ASC", Tuple.class)
.getResultList();
assertEquals(6, resultList.size());
});
}
@Test
public void testSubTypePropertyReferencedFromEntityJoinInSyntheticSubquery4() {
doInJPA(this::sessionFactory, em -> {
List<Tuple> resultList = em.createQuery(
"SELECT subB_0.id, subA_0.id, subB_0.id, subA_0.id FROM SubB subB_0 INNER JOIN SubA subA_0 ON 1=1 WHERE (EXISTS (SELECT 1 FROM Super s WHERE s.id = subA_0.parent.id)) ORDER BY subB_0.id ASC, subA_0.id ASC", Tuple.class)
.getResultList();
assertEquals(0, resultList.size());
});
}
@Test
public void testSubTypePropertyReferencedFromWhereClause() {
doInJPA(this::sessionFactory, em -> {