I have a relationship like the following:
create TABLE PARENT ( parent_id int PK, some_value varchar )
create TABLE CHILD ( child_id int PK, parent_id int FK, type char(1), some_other_value varchar )
However, the object looks like:
public class Parent { private int id; private String someValue; private List<Child> typeAChilden; private List<Child> typeBChilden; }
public class Child { private int id; private String someOtherValue; }
The type column in the CHILD table would be of either value "A" or "B" which would determine what list it would be loaded/inserted/updated from. It should also be noted that each row in CHILD has a unique id.
Im trying to work out how to implement this in xml mappings. I was thinking to use the where clause in the one to many definition but it wonty allow this.
Any ideas on this would be very helpful.
|