Win a copy of Kubernetes in Action this week in the Cloud/Virtualization forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

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

 
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


 
Ranch Hand
Posts: 945
2
  • 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
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!