mirror of
https://github.com/hibernate/hibernate-orm
synced 2025-02-25 21:04:51 +00:00
HHH-11241 : Missing column when executing HQL and criteria query with secondary table
This commit is contained in:
parent
3906816ee2
commit
28942c3f67
@ -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
|
||||
|
Loading…
x
Reference in New Issue
Block a user