thanks tenwit - I had read that section but didnt see the part that said to map to the superclass, be it an interface or abstract, etc. So that part is working, but now I'm getting an org.hibernate.MappingException when mapping a static inner class as a property of one of the subclasses. I'm not sure why since that's legal, and since i'm also successfully mapping 3 static inner enumeration types to another subclass. Here is my mapping with comments on the properties:
Code:
<?xml version="1.0"?>
<!DOCTYPE hibernate-mapping PUBLIC "-//Hibernate/Hibernate Mapping DTD 3.0//EN"
"http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd">
<hibernate-mapping>
<class
name="net.godcode.biocycle.cycle.AbstractObservation"
table="Observation"
>
<id name="id" type="long" column="observation_id">
<generator class="native"/>
</id>
<joined-subclass
name="net.godcode.biocycle.cycle.manager.persistent.HThermalObservation"
table="HThermalObservation"
>
<key column="observation_id"/>
<!-- this causes a mapping exception -->
<property name="temperature"
type="net.godcode.biocycle.cycle.ThermalObservation$Temperature"/>
</joined-subclass>
<joined-subclass
name="net.godcode.biocycle.cycle.manager.persistent.HCervicalObservation"
table="HCervicalObservation"
>
<key column="observation_id"/>
<!-- these map successfully -->
<property name="openness"
type="net.godcode.biocycle.cycle.CervicalObservation$Openness"/>
<property name="firmness"
type="net.godcode.biocycle.cycle.CervicalObservation$Firmness"/>
<property name="position" column="cposition"
type="net.godcode.biocycle.cycle.CervicalObservation$Position"/>
</joined-subclass>
</class>
</hibernate-mapping>
Thanks!