-->
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: CollectionOfElements
PostPosted: Tue Sep 16, 2008 4:57 am 
Beginner
Beginner

Joined: Thu Aug 09, 2007 3:48 pm
Posts: 38
I have object A with a list of B.
I used @CollectionOfElements

and it created me a third table that maps between the 2.
Is it possible to tell it somehow to not create the third table, but just add some mapping column to the B table?

It is a wasted table as i see it...


Top
 Profile  
 
 Post subject:
PostPosted: Tue Sep 16, 2008 4:59 am 
Newbie

Joined: Tue Sep 16, 2008 4:36 am
Posts: 11
If I understand your problem, I would use the annotation @ManyToOne relation.
This way, you are telling him that each elem B has only one parent A.

that way you will not have another table


Top
 Profile  
 
 Post subject:
PostPosted: Tue Sep 16, 2008 5:18 am 
Beginner
Beginner

Joined: Thu Aug 09, 2007 3:48 pm
Posts: 38
correct.

tried that already
but then i have a different problem.
when i merge A (containing a list of B's), it returns me empty list of B's.

Thats why i wanted to try CollectionOfElements.


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.