From afee667c21fe7050e614e6f2d182328b83f45783 Mon Sep 17 00:00:00 2001 From: Gail Badner Date: Tue, 21 Feb 2017 15:29:10 -0800 Subject: [PATCH] HHH-10577 : Fix test case to work pre-5.2 --- .../test/hql/CollectionMapWithComponentValueTest.java | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/hibernate-core/src/test/java/org/hibernate/test/hql/CollectionMapWithComponentValueTest.java b/hibernate-core/src/test/java/org/hibernate/test/hql/CollectionMapWithComponentValueTest.java index de13e71fe2..413ec52691 100644 --- a/hibernate-core/src/test/java/org/hibernate/test/hql/CollectionMapWithComponentValueTest.java +++ b/hibernate-core/src/test/java/org/hibernate/test/hql/CollectionMapWithComponentValueTest.java @@ -153,12 +153,16 @@ public class CollectionMapWithComponentValueTest extends BaseCoreFunctionalTestC @Test @TestForIssue(jiraKey = "HHH-10577") public void testMapKeyExpressionDereferenceInSelect() { - doInHibernate( this::sessionFactory, s -> { - List keyValueNames = s.createQuery( "select key(v).name as name from TestEntity te join te.values v order by name", String.class ).list(); + Session s = openSession(); + s.getTransaction().begin(); + { + List keyValueNames = s.createQuery( "select key(v).name as name from TestEntity te join te.values v order by name" ).list(); assertEquals( 2, keyValueNames.size() ); assertEquals( "key1", keyValueNames.get( 0 ) ); assertEquals( "key2", keyValueNames.get( 1 ) ); - } ); + } + s.getTransaction().commit(); + s.close(); } @Override