aspose file tools*
The moose likes Object Relational Mapping and the fly likes How to persist data in tables with Many-to-Many relationship 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
Bookmark "How to persist data in tables with Many-to-Many relationship" Watch "How to persist data in tables with Many-to-Many relationship" New topic
Author

How to persist data in tables with Many-to-Many relationship

Bhagirathi Mallick
Greenhorn

Joined: Jul 21, 2011
Posts: 26


and this is another class for options


and




And this is the main method





When i am executing this code
I am getting an exception like
org.hibernate.PersistentObjectException : detached entity passed to persist: com.crosscoce.entity.Question

Monica. Shiralkar
Ranch Hand

Joined: Jul 07, 2012
Posts: 644
so you mean to say userId column will come in Email table only in case of one to many Bidirectional and not in case of one to many unidirectional? So in case of one to many unidirectional in Email table we should have only one column that is EmailId?

thanks
 
 
subject: How to persist data in tables with Many-to-Many relationship