-->
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: one-to-many relationship
PostPosted: Sun Apr 11, 2004 5:22 am 
Newbie

Joined: Sun Apr 11, 2004 5:05 am
Posts: 2
Hi,

I've tried this for the last couple of days and read loads of posts to that:
I want to store countries. Each country can have 1 or more regions attached to it.

These are the mappings (generated with XDooclet):

Country.hbm.xml
[code]
<hibernate-mapping>
<class
name="org.iaeste.at.is.domain.Country"
table="Country"
proxy="org.iaeste.at.is.domain.Country"
dynamic-update="false"
dynamic-insert="false"
>

<id name="id" column="id" type="long" unsaved-value="0" >
<generator class="native" />
</id>

<property name="code" type="string" update="true" insert="true"


Top
 Profile  
 
 Post subject:
PostPosted: Sun Apr 11, 2004 6:23 am 
Newbie

Joined: Sun Apr 11, 2004 5:05 am
Posts: 2
Hi,

I finally found the error: the unsaved value has to be set in regions! I've only tried it in country :-(
And the unsaved-value attribute has to match the actual value of the id set in the constructor.

Philipp


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.