Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Hibernate add query for 2 mapped tables

 
pavani potnuru
Greenhorn
Posts: 11
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
HI, I have 2 tables. they are category(category_id(PK),category_name)
other table is recommendation(category_id(FK),recommen_id(PK),reco_title)
Now i mapped these tables by one to many mapping from category to recommendation tables using hibernate annotations..So one category has many recommendations.Now in category entity, i have recommendation object list.
So when I add a record in category table i need to add the list of recommendations also. But it is adding only in category table. The list of recommendation entities are not getting added into recommendation table..
Please help me out in this...
 
Paul Clapham
Sheriff
Posts: 21572
33
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Moving to Object Relational Mapping forum where Hibernate is discussed.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic