|
Hibernate version: 3.2.5.ga
Mapping documents: At the office...
Hi all!
I am realtive new in to Hibernate, but after researching I have not found any answer about this:
I have this classes:
Class A { public Set Children
public Set getChildren()... public setChildren(Set children)... }
Class B { public A Parent
public A getParent()... public setParent(A parent)... }
then in my code I have something like this:
... A myAInstance = new A(); ... session.Save(A); ... B myBInstance = new B(); myBInstance.setParent(A); session.Save(B); ...
And my question is:
There is some way or workaround, using Interceptors, events etc etc to be notified/intercept that one object from B has been added to A?
The only workaround that I have found is, implement event listener (delete, update and insert) and via reflection inspect the class that is going to be affected, searching for "parents"... really nasty code.
Thanks,
PD: Sorry, my english is not good :-(
Regards from Mallorca.
|