Hibernate version: 2.1
Name and version of the database you are using: Oracle / Postgresql
Hi I am Newbie to Hibernate . I have few queries on delete operation.
I will take dept and employee as example. Say this dept is used in many places . Suppose I want delete the dept I want to do a check whether the department is having any employee or any childs . If there , then I have to throw any exception for this . In short , I want to detect the assocations at runtime and if any child is found I have to throw a exception . I am using a <property> to represent the dept in emp.hbm.xml . (This is just for example - Rather in this context <many-to-one> makes sense). I want to know what type of mappings will help in this manner . Also the mapping should be lazy loading as this dept can be used in "N" places .
|