File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Object Relational Mapping and the fly likes Hibernate: Found Shared References to a Collection Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Databases » Object Relational Mapping
Reply locked New topic
Author

Hibernate: Found Shared References to a Collection

David Zazeky
Greenhorn

Joined: Nov 05, 2008
Posts: 7
I started with the following three tables:

Customer

Roles

Customer_Has_Roles

In the Customer.hbm.xml, I have the following:



In the Role.hbm.xml, I have the following:



The above configuration is working in my application, but I want to add a new many-to-many table called Admin_Has_Roles between the Admin and the Roles table. In the admin.hbm.xml file, I added the following:




I did not add a new set to the Role.hbm.xml file since I don't want the Customer table to inherit the Admin_Has_Roles relationship. When I try to save an Admin object in my application, I now get the following Hibernate exception:



What am I doing wrong with my hibernate config? Why can't I create a many-to-many relationship between Admins and Roles?
sailu ms
Greenhorn

Joined: Aug 08, 2012
Posts: 1
Hi,

i am facing the same problem did you find any solution for this?? please do let me know if you know the solution.

Thanks
SailuMS
Bill Gorder
Bartender

Joined: Mar 07, 2010
Posts: 1666
    
    7

sailu ms,

This topic is almost 2 years old. The original poster is likely not following it. Please create a new topic with your question.


[How To Ask Questions][Read before you PM me]
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Hibernate: Found Shared References to a Collection