HHH-9549 : Selecting treated root generates invalid HQL (test case)
(cherry picked from commit ea57113e81
)
This commit is contained in:
parent
c7db015cc6
commit
bf3130cd1c
|
@ -129,6 +129,16 @@ public class TreatKeywordTest extends BaseEntityManagerFunctionalTestCase {
|
||||||
em.close();
|
em.close();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
public void treatRoot() {
|
||||||
|
EntityManager em = getOrCreateEntityManager();
|
||||||
|
CriteriaBuilder builder = em.getCriteriaBuilder();
|
||||||
|
CriteriaQuery<Human> criteria = builder.createQuery( Human.class );
|
||||||
|
Root<Animal> root = criteria.from( Animal.class );
|
||||||
|
criteria.select( builder.treat( root, Human.class ) );
|
||||||
|
em.createQuery( criteria ).getResultList();
|
||||||
|
em.close();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue