-->
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.  [ 3 posts ] 
Author Message
 Post subject: many to one mapping using join-table
PostPosted: Wed Feb 09, 2011 8:30 am 
Newbie

Joined: Wed Feb 09, 2011 8:26 am
Posts: 4
Hello
This page here http://docs.jboss.org/hibernate/core/3. ... l-join-12m
shows the following example of

<class name="Address">
<id name="id" column="addressId">
<generator class="native"/>
</id>
<join table="PersonAddress"
inverse="true"
optional="true">
<key column="addressId"/>
<many-to-one name="person"
column="personId"
not-null="true"/>
</join>
</class>

to undertake a many-to-one mapping if you have link tables.

However when I try and insert this into a component mapping I get the following error

The content of element type "component" must match "(meta*,tuplizer*,parent?,(property|many-to-one|one-to-one|component|dynamic-component|any|map|set|list|bag|array|primitive-array)*)

It works if I insert it at the <class> level. Can I not use join-table notation in a <component>?

And if not how would I do this?

Cheers


Top
 Profile  
 
 Post subject: Re: many to one mapping using join-table
PostPosted: Tue Aug 09, 2011 11:33 pm 
Newbie

Joined: Wed Dec 17, 2008 1:45 am
Posts: 5
Did you ever find a solution to this? I am having the same error and I find it odd that following their tutorial yields this error...


Top
 Profile  
 
 Post subject: Re: many to one mapping using join-table
PostPosted: Wed Aug 10, 2011 11:33 am 
Newbie

Joined: Wed Dec 17, 2008 1:45 am
Posts: 5
Well, now I'm really confused. I used the hibernate tools for eclipse to generate the join, it generated the same EXACT code but now it isn't complaining...


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 3 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.