I'm upgrading from 2.0.1 to 2.0.3 and some of my mappings have stopped working. I have several places where I use lookup tables to map to state objects, which use the primary key as the discriminator. Here is an example:
Code:
<hibernate-mapping>
<class name="com.bbh.merlin.persistence.failedjob.ReviewStatusState" table="REVIEW_STATUS_TYPE" discriminator-value="null" mutable="false" >
<id column="REVIEWSTATUSTYPE_ID" name="id" type="long">
<generator class="assigned"/>
</id>
<discriminator column="REVIEWSTATUSTYPE_ID" type="int"/>
<property column="DESCRIPTION" length="50" name="description" type="string"/>
<subclass name="com.bbh.merlin.persistence.failedjob.ReviewOpenState" discriminator-value="1"/>
<subclass name="com.bbh.merlin.persistence.failedjob.ReviewResolvedState" discriminator-value="2"/>
<subclass name="com.bbh.merlin.persistence.failedjob.ReviewPendingAppealState" discriminator-value="3"/>
<subclass name="com.bbh.merlin.persistence.failedjob.ReviewPendingRcscState" discriminator-value="4"/>
</class>
</hibernate-mapping>
This worked fine in 2.0.3, but now I get a mapping exception saying "Repeated column in mapping for class x". It looks like it wants the discriminator to be set to insert="false" update="false", but I can't figure out how to do this when the discriminator is also the ID.
Any ideas?
Mark