Hi,
I have the following table model:
Expertise: ID
Phase: ID, EXPERTISE_ID, DISCRIMINATOR
Phase has 3 subclasses: FirstInstance, Appeal and Arbitration.
An Expertise has each time one of each phase, where FirstInstance is always required and the other two are optional.
So the idea is to have 3 properties in the expertise class:
Code:
public class Expertise {
private FirstInstance firstInstance;
private Appeal appeal;
private Arbitration arbitration;
}
The mapping for the phases was straightforward:
Code:
<hibernate-mapping package="be.fgov.health.mediflow.schema.driver.model">
<class name="Phase" table="PHASE">
<id name="id" type="long" column="ID" >
<generator class="native">
<param name="sequence">SEQ_PHASE</param>
</generator>
</id>
<discriminator column="DISCRIMINATOR" />
<many-to-one name="expertise" column="EXPERTISE_ID" class="Expertise" not-null="true"/>
<subclass name="FirstInstance" discriminator-value="FI">
</subclass>
<subclass name="Appeal" discriminator-value="AP">
</subclass>
<subclass name="Arbitration" discriminator-value="AR">
</subclass>
</class>
</hibernate-mapping>
But I don't seem to find a way to map the phases for expertise.
I'm pretty sure I need some kind of inverse mapping, but I don't need a collection. It's only a single item. Any ideas?
(I'm required to use Hibernate 3.2.6 without annotations)
Thanks in advance.