Я использовал эту статью: http://viralpatel.net/blogs/2011/12/hibernate-inheritance-table-per-subclass-annotation-xml-mapping.html для таблицы наследования Hibernate для метода подкласса hbm. Когда я запускаю основной класс, я получаю исключение ниже.
</p>
<pre><code>12/02/16 00:02:24 ERROR hibernate.AssertionFailure: an assertion failure occured (this may indicate a bug in Hibernate, but is more likely due to unsafe use of the session)
org.hibernate.AssertionFailure: not a joined-subclass
at org.hibernate.mapping.Subclass.createForeignKey(Subclass.java:192)
at org.hibernate.cfg.HbmBinder.bindJoinedSubclass(HbmBinder.java:942)
at org.hibernate.cfg.HbmBinder.handleJoinedSubclass(HbmBinder.java:2305)
at org.hibernate.cfg.HbmBinder.createClassProperties(HbmBinder.java:2207)
at org.hibernate.cfg.HbmBinder.createClassProperties(HbmBinder.java:2134)
at org.hibernate.cfg.HbmBinder.bindRootPersistentClassCommonValues(HbmBinder.java:409)
at org.hibernate.cfg.HbmBinder.bindRootClass(HbmBinder.java:323)
at org.hibernate.cfg.HbmBinder.bindRoot(HbmBinder.java:174)
at org.hibernate.cfg.Configuration$MetadataSourceQueue.processHbmXml(Configuration.java:3948)
at org.hibernate.cfg.Configuration$MetadataSourceQueue.processHbmXmlQueue(Configuration.java:3940)
at org.hibernate.cfg.Configuration$MetadataSourceQueue.processMetadata(Configuration.java:3928)
at org.hibernate.cfg.Configuration.secondPassCompile(Configuration.java:1368)
at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1826)
at com.gubs.HibernateUtil.buildSessionFactory(HibernateUtil.java:13)
at com.gubs.HibernateUtil.<clinit>(HibernateUtil.java:8)
at com.gubs.OneToOne.main(OneToOne.java:12)
Initial SessionFactory creation failed.org.hibernate.AssertionFailure: not a joined-subclass
Exception in thread "main" java.lang.ExceptionInInitializerError
at com.gubs.HibernateUtil.buildSessionFactory(HibernateUtil.java:17)
at com.gubs.HibernateUtil.<clinit>(HibernateUtil.java:8)
at com.gubs.OneToOne.main(OneToOne.java:12)
Caused by: org.hibernate.AssertionFailure: not a joined-subclass
Есть идеи?
Спасибо,
Gubs