Hello,
Our team chose to create seperate class mapping files for each Persistent class. A.hbm.xml, B.hbm.xml, C.hbm.xml, etc.
We are using Hibernate version 1.2.x.
They are then added to the Hibernate Datastore. Hibernate seems to require that the classes be added to the Datastore in a pre-defined order. Mapping exceptions occur if you add them to the datastore out of order.
If Class A depends on Class B then mapping exceptions occur if you add class A before class B.
How do you handle the case where Class A has a reference to Class B and Class B also has a reference back to Class A.
For example:
Class A has a set of Class B.
Class B has a reference to a single Class A.
We like the concept of small hbm.xml files for each class, but want to avoid duplicate class definitions and maintenance.
Is there a way to create a hbm.xml file that includes other hbm.xml files?
Is there another solution aside from creating one master hbm.xml mapping file?
Thanks in advance.
|