Hi,
I'm trying to get a hibernate to use the same column for a discriminator and for a many-to-one relationship
<class name="Animal" table="animal">
<discriminator column="animal_type" type="long"/>
<many-to-one name="animalType" column="animal_type"/>
</class>
<class name="AnimalType" table="type">
<set name="animals" inverse="true">
<key column="animal_type" />
<one-to-many class="Animal" />
</set>
</class>
Does anyone know how I do this sort of thing? So that hibernate understands this column is both a discriminator & a foreign key?
Thanks for any replies,
Chris
|