|
14 | 14 | import javax.persistence.MappedSuperclass;
|
15 | 15 |
|
16 | 16 | import org.hibernate.cfg.AnnotationBinder;
|
| 17 | +import org.hibernate.hql.internal.ast.QuerySyntaxException; |
17 | 18 | import org.hibernate.internal.CoreMessageLogger;
|
18 | 19 | import org.hibernate.jpa.test.BaseEntityManagerFunctionalTestCase;
|
19 | 20 |
|
20 | 21 | import org.hibernate.testing.TestForIssue;
|
21 | 22 | import org.hibernate.testing.logger.LoggerInspectionRule;
|
22 | 23 | import org.hibernate.testing.logger.Triggerable;
|
| 24 | +import org.hibernate.testing.util.ExceptionUtil; |
23 | 25 | import org.junit.Rule;
|
24 | 26 | import org.junit.Test;
|
25 | 27 |
|
26 | 28 | import org.jboss.logging.Logger;
|
27 | 29 |
|
| 30 | +import static org.hibernate.testing.transaction.TransactionUtil.doInJPA; |
28 | 31 | import static org.junit.Assert.assertEquals;
|
29 | 32 | import static org.junit.Assert.assertFalse;
|
30 | 33 | import static org.junit.Assert.assertTrue;
|
@@ -62,7 +65,18 @@ public void buildEntityManagerFactory() {
|
62 | 65 |
|
63 | 66 | @Test
|
64 | 67 | public void test() {
|
65 |
| - |
| 68 | + doInJPA( this::entityManagerFactory, entityManager -> { |
| 69 | + entityManager.createQuery("from Manager").getResultList(); |
| 70 | + entityManager.createQuery("from Developer").getResultList(); |
| 71 | + |
| 72 | + try { |
| 73 | + //Check the @Inheritance annotation was ignored |
| 74 | + entityManager.createQuery("from Employee").getResultList(); |
| 75 | + } catch (Exception expected) { |
| 76 | + QuerySyntaxException rootException = (QuerySyntaxException) ExceptionUtil.rootCause(expected); |
| 77 | + assertEquals("Employee is not mapped", rootException.getMessage()); |
| 78 | + } |
| 79 | + } ); |
66 | 80 | }
|
67 | 81 |
|
68 | 82 | @Inheritance(strategy = InheritanceType.TABLE_PER_CLASS)
|
|
0 commit comments