-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 
Author Message
 Post subject: property-ref and key-many-to-one
PostPosted: Mon Nov 29, 2004 9:57 am 
Newbie

Joined: Wed Nov 10, 2004 11:25 am
Posts: 11
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


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.