Hi, When i am trying to delete a table using Object, i am getting error if it is reffering some other table. My requirement is if a object is refering some other table then it should not delete ...
For Example: //Here BeanClass is a bean class which is mapped to a table BeanClass Obj=null; //Here pk id primary key of BeanClass mapped table //Sess is org.hibernate.Session object Obj= (BeanClass) Sess.load(BeanClass.class, pk); Sess.delete(Obj);
If pk is refering some other table we will get error. How to find whether pk is refering some other table in hiberbnate.
Thanks & Regards, Sandeep
|