• 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: 21975
36
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.
 
my overalls have superpowers - they repel people who think fashion is important. Tiny ad:
the new thread boost feature brings a LOT of attention to your favorite threads
https://coderanch.com/t/674455/Thread-Boost-feature
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!