HHH-8518 - Validate EMF#addNamedQuery transfers all query settings

This commit is contained in:
Steve Ebersole 2013-09-18 15:12:45 -05:00
parent 346d958c20
commit 5a7d37aa80
1 changed files with 5 additions and 0 deletions

View File

@ -131,6 +131,8 @@ public class AddNamedQueryTest extends BaseEntityManagerFunctionalTestCase {
public void testConfigValueHandling() {
final String name = "itemJpaQueryWithLockModeAndHints";
EntityManager em = getOrCreateEntityManager();
em.getTransaction().begin();
Query query = em.createNamedQuery( name );
org.hibernate.Query hibernateQuery = ( (HibernateQuery) query ).getHibernateQuery();
// 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( LockMode.PESSIMISTIC_WRITE, hibernateQuery.getLockOptions().getLockMode() );
assertEquals( (Integer) 10, hibernateQuery.getTimeout() );
em.getTransaction().commit();
em.close();
}
}