I have a problem that's equal to the one presented here: how to define an inverse cascade delete on a many-to-one mapping in hibernate
After searching for a while I can't find a decent/clean solution for this. I can't have the parent entity have an @OneToMany to the child, because they are at different modules. I wanted to try the EntityListener that would delete the children before the parent is, but I can't because, again, they are at different modules.
Does anyone know a clean solution to this? I am thinking about to use AspectJ to listen to the call of the delete method from the ParentDao, but this is not a clean solution and I will have to implement one for each entity that have this kind of relation to the Parent class.
This kind of cascade seems to be a basic feature and I am kind dissapointed in seeing that hibernate does not support it :/