Hibernate version:2.1.6
Mapping documents: <class name="PTracking" table="p_tracking"> <id name="pk" column="pk" type="java.lang.Long"> <generator class="sequence"> <param name="sequence">hibernate_sequence</param> </generator> </id> <one-to-one name="pSubject" class="PSubject" property-ref="pTracking" /> </class>
<class name="PSubject" table="p_subject"> <composite-id unsaved-value="any"> <key-property name="subjectPk" column="fk_subject"/> <key-many-to-one name="pTracking" column="fk_p_tracking"/> </composite-id> </class>
Code between sessionFactory.openSession() and session.close():
Full stack trace of any exception that occurs: net.sf.hibernate.MappingException: property-ref not found: paymentTracking in class: com.jms.server.persistence.beans.accounting.HBPaymentSubjectBean at net.sf.hibernate.cfg.Configuration.secondPassCompile(Configuration.java:653) at net.sf.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:784) at com.server.init.CLocalHibernateInitializer.initHibernate(CLocalHibernateInitializer.java:49) at com.server.init.CLocalHibernateInitializer.<init>(CLocalHibernateInitializer.java:28) at com.server.init.CLocalHibernateInitializer.init(CLocalHibernateInitializer.java:35) at com.CJmsBaseTestCase.initHibernate(CJmsBaseTestCase.java:56) at com.CJmsBaseTestCase.initialize(CJmsBaseTestCase.java:43) at com.CJmsBaseTestCase.setUp(CJmsBaseTestCase.java:33) at com.jms.server.persistence.HBAccountingTest.setUp(HBAccountingTest.java:29) at junit.framework.TestCase.runBare(TestCase.java:125) at junit.framework.TestResult$1.protect(TestResult.java:106) at junit.framework.TestResult.runProtected(TestResult.java:124) at junit.framework.TestResult.run(TestResult.java:109) at junit.framework.TestCase.run(TestCase.java:118) at junit.framework.TestSuite.runTest(TestSuite.java:208) at junit.framework.TestSuite.run(TestSuite.java:203) at junit.textui.TestRunner.doRun(TestRunner.java:116) at com.intellij.rt.execution.junit2.IdeaJUnitAgent.doRun(IdeaJUnitAgent.java:57) at junit.textui.TestRunner.start(TestRunner.java:172) at com.intellij.rt.execution.junit.TextTestRunner2.startRunnerWithArgs(TextTestRunner2.java:23) at com.intellij.rt.execution.junit2.JUnitStarter.prepareStreamsAndStart(JUnitStarter.java:97) at com.intellij.rt.execution.junit2.JUnitStarter.main(JUnitStarter.java:31)
java.lang.RuntimeException: Hibernate not initialized for: /usr/local/projects/server/java/conf/hibernate/, hibernate-config.xml, hibernate.properties at com.jms.CJmsBaseTestCase.initHibernate(CJmsBaseTestCase.java:60) at com.jms.CJmsBaseTestCase.initialize(CJmsBaseTestCase.java:43) at com.jms.CJmsBaseTestCase.setUp(CJmsBaseTestCase.java:33) at com.jms.server.persistence.HBAccountingTest.setUp(HBAccountingTest.java:29) at com.intellij.rt.execution.junit2.JUnitStarter.main(JUnitStarter.java:31)
Buth there is such a property. If I replace key-many-to-one with: key-property and many-to-one everthing works fine. But I don't like that variant. Is there a way to solve this problem?
_________________ Vladimir
www.devitnow.com
|