Hi All
First let me explain the code structure to all of you ...
The section I'm struggling with makes use of Rule and Action. Rule is an abstract class that inherits from java.util.Observable and which implements java.util.Observer. Action is also an abstract class, but only implements java.util.Observer.
Through the subclasses of these two I can create a rule hierarchy, with one Rule observing multiple others and Actions observing this Rule. Now in order to ease removal and updating of Rules and Actions, every Rule has a List of observables and observers. Every Action has a List of observables.
My problem is, how do I map this in Hibernate without writing my own Observer and Observable classes (or even just how do I do it if I write my own classes). I'm not that adept at inheritance mapping, but I believe that Observer and Observable requires at least getID and setID?
Also, seeing as every Rule has both an Observer and Observable List, how will I handle this in Hibernate? When I persist a Rule it depends both on "children" and "parents".
Thank you for all and any help.
|