diff --git a/hibernate-core/src/test/java/org/hibernate/test/join/SubclassesWithSamePropertyNameTest.java b/hibernate-core/src/test/java/org/hibernate/test/join/SubclassesWithSamePropertyNameTest.java index cfb2ecc256..c1cb2c867b 100644 --- a/hibernate-core/src/test/java/org/hibernate/test/join/SubclassesWithSamePropertyNameTest.java +++ b/hibernate-core/src/test/java/org/hibernate/test/join/SubclassesWithSamePropertyNameTest.java @@ -27,6 +27,7 @@ import static org.junit.Assert.assertEquals; */ @TestForIssue( jiraKey = "HHH-11241" ) public class SubclassesWithSamePropertyNameTest extends BaseCoreFunctionalTestCase { + private Long blogEntryId; @Override public String[] getMappings() { @@ -43,6 +44,30 @@ public class SubclassesWithSamePropertyNameTest extends BaseCoreFunctionalTestCa 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