-->
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.  [ 2 posts ] 
Author Message
 Post subject: Help with property-ref
PostPosted: Fri Jan 06, 2006 1:36 pm 
Newbie

Joined: Fri Jan 06, 2006 12:46 pm
Posts: 1
Help could some please help me with property-ref?

my map looks like this

<class name="KFolder" table="nodes">
<id name="nodeId" type="string" column="node_id" length="180"></id>
<property name="nodeName" column="node_name" type="string" length="241" not-null="true"/>
<property name="status" column="status" type="string" length="20"/>
<one-to-one name="kfnm" class="KFolderNodeMap" property-ref="linkNodeId"/>
</class>
<class name="KFolderNodeMap" table="node_map">
<id name="linkNodeId" type="string" column="link_node_id" length="180"></id>
<property name="numObjects" column="num_objects" type="int" length="11"/>
<property name="seqNum" column="seq_num" type="int" length="11"/>
</class>



When I run a test driver I get this

(cfg.Configuration 879 ) processing collection mappings
(cfg.Configuration 888 ) processing association property refer
ences
Exception in thread "main" org.hibernate.MappingException: property-ref not foun
d: linkNodeId in class: com.api.KFolderNodeMap
at org.hibernate.cfg.Configuration.secondPassCompile(Configuration.java:
910)
at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.jav
a:999)
at com.api.HUtil.<init>(Unknown Source)
at com.unitTest.AMain.folder(Unknown Source)
at com.unitTest.AMain.main(Unknown Source)


I can reproduce the problem in the example "inventory" that comes with hibernate by adding a property-ref clause in the product map


<one-to-one name="supplier"
class="Supplier"
property-ref="id"
cascade="save-update"/>


would someone please be kind enough to point out my error.


thanks in adavance.

jim s


Top
 Profile  
 
 Post subject:
PostPosted: Fri Jan 06, 2006 11:33 pm 
Hibernate Team
Hibernate Team

Joined: Tue Sep 09, 2003 2:10 pm
Posts: 3246
Location: Passau, Germany
It makes no sense to use property-ref on the id, that is the default behaviour of a one-to-one already. Just drop the property-ref. And please read http://www.hibernate.org/hib_docs/v3/re ... n-onetoone


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

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.