HHH-9549 : Selecting treated root generates invalid HQL (test case)
(cherry picked from commitea57113e81
) (cherry picked from commitbf3130cd1c
)
This commit is contained in:
parent
982c6fc0e8
commit
859fe300c7
|
@ -129,6 +129,16 @@ public class TreatKeywordTest extends BaseEntityManagerFunctionalTestCase {
|
|||
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