-->
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.  [ 1 post ] 
Author Message
 Post subject: Shared Inverse Relationship
PostPosted: Tue Jun 18, 2013 10:45 am 
Beginner
Beginner

Joined: Tue Nov 02, 2010 4:29 am
Posts: 21
I have class A that has two different onetomany collections of class B. Class B has a single (shared) reference back to A. The relationship is bidirectional. Is it possible to map this (using annotations) in hibernate? To my mind it looks like I have to use two join tables. Is this a supported hibernate mapping configuration?

class A
{
Set<B> set1;
Set<B> set2;
}

class B
{
A a;
}

EDIT: Class A will contain the add and remove methods for managing the relationship.


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

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.