I'm looking for advice on how to map the following association:
"A" has a reference to "B" ... "B" is really an interface, of which there are a few implementations - "B1", "B2", "B3". The three implementations all have their own (unique) additional properties for persistence (that aren't defined on "B").
The "B" is associated to exactly one "A" - and in fact can't exist without the "A" holding a reference to it.
Ideally I'd like to map this like:
Code:
<class "A">
<property ...>
<property ...>
<component class "B">
<property ...>
<property ...>
<joined-subclass "B1" .... >
<property ...>
<property ...>
</joined-subclass>
<joined-subclass "B2" .... >
<property ...>
<property ...>
</joined-subclass>
<joined-subclass "B3" .... >
<property ...>
<property ...>
</joined-subclass>
</component>
</class>
But joined subclasses aren't allowed in <component>s.
Does anyone know of an alternative other than one-to-one? I'd really like to not have to assign Ids to "B"s (or at least just use the Id of the "A" as the Id of the "B"), and their lifecycle should be that of the "A".
thanks,
james