HHH-8518 - Validate EMF#addNamedQuery transfers all query settings
This commit is contained in:
parent
346d958c20
commit
5a7d37aa80
|
@ -131,6 +131,8 @@ public class AddNamedQueryTest extends BaseEntityManagerFunctionalTestCase {
|
||||||
public void testConfigValueHandling() {
|
public void testConfigValueHandling() {
|
||||||
final String name = "itemJpaQueryWithLockModeAndHints";
|
final String name = "itemJpaQueryWithLockModeAndHints";
|
||||||
EntityManager em = getOrCreateEntityManager();
|
EntityManager em = getOrCreateEntityManager();
|
||||||
|
em.getTransaction().begin();
|
||||||
|
|
||||||
Query query = em.createNamedQuery( name );
|
Query query = em.createNamedQuery( name );
|
||||||
org.hibernate.Query hibernateQuery = ( (HibernateQuery) query ).getHibernateQuery();
|
org.hibernate.Query hibernateQuery = ( (HibernateQuery) query ).getHibernateQuery();
|
||||||
// assert the state of the query config settings based on the initial named query
|
// assert the state of the query config settings based on the initial named query
|
||||||
|
@ -179,5 +181,8 @@ public class AddNamedQueryTest extends BaseEntityManagerFunctionalTestCase {
|
||||||
assertEquals( CacheMode.IGNORE, hibernateQuery.getCacheMode() );
|
assertEquals( CacheMode.IGNORE, hibernateQuery.getCacheMode() );
|
||||||
assertEquals( LockMode.PESSIMISTIC_WRITE, hibernateQuery.getLockOptions().getLockMode() );
|
assertEquals( LockMode.PESSIMISTIC_WRITE, hibernateQuery.getLockOptions().getLockMode() );
|
||||||
assertEquals( (Integer) 10, hibernateQuery.getTimeout() );
|
assertEquals( (Integer) 10, hibernateQuery.getTimeout() );
|
||||||
|
|
||||||
|
em.getTransaction().commit();
|
||||||
|
em.close();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue