• 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
  • Paul Clapham
  • Liutauras Vilda
  • Knute Snortum
  • Bear Bibeault
Sheriffs:
  • Devaka Cooray
  • Jeanne Boyarsky
  • Junilu Lacar
Saloon Keepers:
  • Ron McLeod
  • Stephan van Hulst
  • Tim Moores
  • Carey Brown
  • salvin francis
Bartenders:
  • Tim Holloway
  • Piet Souris
  • Frits Walraven

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: 4106
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
 
rubbery bacon. rubbery tiny ad:
Java file APIs (DOC, XLS, PDF, and many more)
https://products.aspose.com/total/java
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!