Hibernate version:2.1.6
Is it possible to map the following using only 2 tables? :
Class A contains a single instance of a type safe collection class B (1..1 to 0..1), which in turn contains a java.util.Set with multiple data objects in it (4 properties per set entry)
We have class B for two reasons : 1.) its type safe, and 2.) if provides some state change logic checks.
Currently, Ive got A.hbm.xml containing a one-to-one reference to Class B
<one-to-one property-ref="A" cascade="save-update">
and in B.hbm.xml I have a <set> set up
<set name="foo" lazy="true">
<key column="a_id" foreign_key="FK_B_A"/>
<composite-element class="MySetEntryClass">
...
...
</composite-element>
However, this results in 3 tables:
1 for class A (which is ok)
1 for class B
1 for the collection mapping of B
Can I combine the 2nd and 3rd tables tables, and simply map this construct with 2 tables (some sort of custom user-implemented collection type)?
Nick
|