Added test case for HHH-14125 'Selecting EntityCollection fails ("not an entity")'

This commit is contained in:
Benjamin Maurer 2020-07-30 11:52:23 +02:00
parent 9323d426f1
commit f73fa6d132
1 changed files with 10 additions and 0 deletions

View File

@ -15,6 +15,7 @@ import org.hibernate.testing.junit4.BaseCoreFunctionalTestCase;
/**
* @author Steve Ebersole
* @author Benjamin Maurer
*/
public class QueryTest extends BaseCoreFunctionalTestCase {
@Override
@ -30,4 +31,13 @@ public class QueryTest extends BaseCoreFunctionalTestCase {
s.createQuery( "from EntityWithAnElementCollection e where 'abc' member of e.someStrings" ).list();
s.close();
}
@Test
@TestForIssue( jiraKey = "HHH-14125" )
public void testSelectElementCollectionProperty() {
// Selecting property directly works for basic types and associated entities, should also work for ElementCollection
Session s = openSession();
s.createQuery( "select e.someStrings from EntityWithAnElementCollection e" ).list();
s.close();
}
}