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
@TestForIssue(jiraKey = "HHH-10577")
public void testMapKeyExpressionDereferenceInSelect() {
doInHibernate( this::sessionFactory, s -> {
List<String> 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