Win a copy of Design for the Mind this week in the Design forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

when parent is deleted child is updating rather than deleting

 
ankur jadiya
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

 
Anayonkar Shivalkar
Bartender
Posts: 1557
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: 1557
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.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic