Win a copy of Micro Frontends in Action this week in the Server-Side JavaScript and NodeJS forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Paul Clapham
  • Bear Bibeault
  • Junilu Lacar
Sheriffs:
  • Jeanne Boyarsky
  • Tim Cooke
  • Henry Wong
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • salvin francis
  • Frits Walraven
Bartenders:
  • Scott Selikoff
  • Piet Souris
  • Carey Brown

Hibernate many-to-one mapping

 
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
 
Bartender
Posts: 4107
72
Hibernate Fedora Chrome
  • 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
 
reply
    Bookmark Topic Watch Topic
  • New Topic