Hello,
I have the following class
Code:
public class Thing {
...
private SubclassOfThing subthing;
...
public SubclassOfThing getSubthing();
... setSubthing();
}
Since the mapping forces me to put my <many-to-one> before the subclass declaration, I have this error when I generate my schemaexport
Code:
Schema text failed: An association from the table thing refers to an unmapped class: SubclassOfThing
<hibernate-mapping>
<class name="Thing" table="thing" discriminator-value="0">
<discriminator column="discriminator" type="byte"/>
...
<many-to-one name="subthing" column="subthing" class="SubThing" />
...
<subclass name="SubThing" discriminator-value="1">
...
</subclass>
</class>
</hibernate-mapping>
Is there any way around that problem? It reminds me of the forward keyword we used to have in Pascal.
Lacou
Hibernate version:
3.x