HHH-10577 : Fix test case to work pre-5.2

This commit is contained in:
Gail Badner 2017-02-21 15:29:10 -08:00
parent c27e51c3d7
commit afee667c21
1 changed files with 7 additions and 3 deletions

View File

@ -153,12 +153,16 @@ public class CollectionMapWithComponentValueTest extends BaseCoreFunctionalTestC
@Test @Test
@TestForIssue(jiraKey = "HHH-10577") @TestForIssue(jiraKey = "HHH-10577")
public void testMapKeyExpressionDereferenceInSelect() { public void testMapKeyExpressionDereferenceInSelect() {
doInHibernate( this::sessionFactory, s -> { Session s = openSession();
List<String> keyValueNames = s.createQuery( "select key(v).name as name from TestEntity te join te.values v order by name", String.class ).list(); 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( 2, keyValueNames.size() );
assertEquals( "key1", keyValueNames.get( 0 ) ); assertEquals( "key1", keyValueNames.get( 0 ) );
assertEquals( "key2", keyValueNames.get( 1 ) ); assertEquals( "key2", keyValueNames.get( 1 ) );
} ); }
s.getTransaction().commit();
s.close();
} }
@Override @Override