Win a copy of Modern JavaScript for the Impatient 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

when parent is deleted child is updating rather than deleting

 
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
  • 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
  • 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
  • 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
  • Quote
  • Report post to moderator
Its ok

You can check forum's home page and select proper forum.
 
Don't get me started about those stupid light bulbs.
    Bookmark Topic Watch Topic
  • New Topic