HHH-11241 : Missing column when executing HQL and criteria query with secondary table

This commit is contained in:
Gail Badner 2016-12-08 12:22:45 -08:00
parent 3906816ee2
commit 28942c3f67

View File

@ -27,6 +27,7 @@
*/
@TestForIssue( jiraKey = "HHH-11241" )
public class SubclassesWithSamePropertyNameTest extends BaseCoreFunctionalTestCase {
private Long blogEntryId;
@Override
public String[] getMappings() {
@ -43,6 +44,30 @@ protected void prepareTest() {
s.persist( blogEntry );
s.getTransaction().commit();
s.close();
blogEntryId = blogEntry.getId();
}
@Override
protected void cleanupTest() {
Session s = openSession();
s.getTransaction().begin();
s.createQuery( "delete from BlogEntry" ).executeUpdate();
s.getTransaction().commit();
s.close();
}
@Test
@TestForIssue( jiraKey = "HHH-11241" )
@FailureExpected( jiraKey = "HHH-11241" )
public void testGetSuperclass() {
Session s = openSession();
Transaction tx = s.beginTransaction();
Reportable reportable = s.get( Reportable.class, blogEntryId );
assertEquals( "John Doe", reportable.getReportedBy() );
assertEquals( "detail", ( (BlogEntry) reportable ).getDetail() );
tx.commit();
s.close();
}
@Test