• 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 Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Paul Clapham
  • Jeanne Boyarsky
  • Liutauras Vilda
Sheriffs:
  • Rob Spoor
  • Bear Bibeault
  • Tim Cooke
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Piet Souris
Bartenders:
  • Frits Walraven
  • Himai Minh

when parent is deleted child is updating rather than deleting

 
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
This problem is related to hibenate and this is my first time to ask the question in this forum if any mistakes on asking question please tell me so that i can improve style of asking question thanks.
My problem is that when i am performing delete operation on parent table parent is deleted smoothly but in child table, update query is running.There is one-to-many relation exist in parent and child table
where Employee Table is parent and Project table is child table
when executing the program output is showing like this

output

Hibernate: update employee_project set employeeNumber=null where employeeNumber=?
Hibernate: delete from employee where EMPLOYEE_NUMBER=?



Employee pojo

}
and this is my Employee.hbm.xml



and this is my project.hbm.xml




and the logic is
of deleting is

 
Bartender
Posts: 1558
5
Eclipse IDE Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi ankur,

Welcome to CodeRanch!

Firstly, please go through forum FAQs (like TellTheDetails, CarefullyChooseOneForum, UseCodeTags etc.).

Further, please be clear about exactly when you are having problem. What is parent table and child table? What is Employee.hbm.xml?

To me, the question appears to be related to hibernate (would be much better if you mention this) and I'm moving this to relevant forum.

Please provide the details (so that other members can assist you in better way) and feel free to ask more questions (and answer questions by others ).
 
ankur jadiya
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

ankur wrote:Hi Anayonkar Shivalkar,

Thanks for replying as you know this is my first time can you tell if question related to particular topic how to ask question on that topic forum

 
Anayonkar Shivalkar
Bartender
Posts: 1558
5
Eclipse IDE Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Its ok

You can check forum's home page and select proper forum.
 
You showed up just in time for the waffles! And this tiny ad:
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop
https://coderanch.com/wiki/718759/books/Building-World-Backyard-Paul-Wheaton
reply
    Bookmark Topic Watch Topic
  • New Topic