yinl wrote:
Hibernate version: 2.1.5
From Hibernate Doc,
" 5.4. Modular mapping files
It is possible to define subclass and joined-subclass mappings in seperate mapping documents, directly beneath hibernate-mapping. This allows you to extend a class hierachy just by adding a new mapping file. You must specify an extends attribute in the subclass mapping, naming a previously mapped superclass. Use of this feature makes the ordering of the mapping documents important!
<hibernate-mapping>
<subclass name="eg.subclass.DomesticCat" extends="eg.TheCat" discriminator-value="D">
<property name="name" type="string"/>
</subclass>
</hibernate-mapping>"
Can someone tell me how I can control the ordering of the mapping? I tried to specify the order in the the build.xml file:
<hbm2java output="${build.gen-src.dir}">
<fileset dir="${build.gen-src.dir}">
<include name="**/TheCat.hbm.xml"/>
<include name="**/DomesticCat.hbm.xml"/>
</fileset>
</hbm2java>
but when I ran it with Ant, I am getting the exception:
net.sf.hibernate.MappingException: Cannot extend unmapped class eg.TheCat
...
Thanks