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

Hibernate many-to-one mapping

 
srikanth sridhar
Greenhorn
Posts: 15
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

I have problem in hibernate mapping.
The two tables are

MEAL ON BOARD - master tables

while updating getting
Caused by: java.sql.BatchUpdateException: ORA-02291: integrity constraint (FK_OPRS_SERVICES_MEAL_02) violated - parent key not found

My HBM mapping is as follows

I tried many to one mapping but failing miserably. Please help.....
 
srikanth sridhar
Greenhorn
Posts: 15
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
sorry the OPRS_SERVICES_MEAL has error

the corrected one
 
Vijitha Kumara
Bartender
Posts: 3913
9
Chrome Fedora Hibernate
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I tried many to one mapping but failing miserably.

Where? You have shown only partial mapping. You need to tell more details here (TellTheDetails). Where is "FK_OPRS_SERVICES_MEAL_02" is defined?
 
srikanth sridhar
Greenhorn
Posts: 15
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
"FK_OPRS_SERVICES_MEAL_02" is defined in the Serviced Master Table
The table is


I tred mapping this way
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic