-->
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: mapping bidirectional entity associtation one-to-many
PostPosted: Wed Jun 01, 2005 9:35 am 
Regular
Regular

Joined: Thu Apr 14, 2005 2:15 pm
Posts: 66
I have this entity association.
1 Customer has * Budget.
In my customer class, I have the attribute budgets that is a List and in my Budget class I have the attribute customer. So, this is a bidirection one to may associtation between two entitys.

How can I map this? I alread tryed to use idbag, but this doesn't work. In the hibernate manual and the Hibernate in action, there are examples of this case only using <set>. Can I make this using a List in java code? Should I use idbag? I don't need to preserve the index of the list.

I alread tryed this mapping below, but this doesn't work:
Code:
                <idbag name="orcamentos" lazy="true" inverse="true" cascade="save-update">
                   <key column="CLIENTE_ID" not-null="true" />
                   <one-to-many class="src.model.Orcamento" />
                </idbag>


Top
 Profile  
 
 Post subject:
PostPosted: Wed Jun 01, 2005 1:16 pm 
Regular
Regular

Joined: Thu Apr 14, 2005 2:15 pm
Posts: 66
I resolved this problem using only bag and not idbag.


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.