• Post Reply Bookmark Topic Watch Topic
  • New Topic

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

 
Bhagirathi Mallick
Greenhorn
Posts: 26
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator


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
Posts: 874
1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
Without subsidies, chem-ag food costs four times more than organic. Or this tiny ad:
the new thread boost feature: great for the advertiser and smooth for the coderanch user
https://coderanch.com/t/674455/Thread-Boost-feature
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!