Maybe I do something wrong but I have a problem. I have a table with the following columns
id(number), fk_id(number), clob(clob), discriminator(string).
My subclasses are mapped as the following
Code:
<class abstract="true" name="Clob"  table="efx_clob">   
   <id name="id" unsaved-value="-1" column="clob_id">
      <generator class="sequence">
         <param name="sequence">efxs_clob</param>
      </generator>
   </id>
   <discriminator column="discriminator" type="string" />
   <property 
       name="clob" 
       column="clob_data" 
       type="clob"
       insert="false"
       update="false">
   </property>
   
   <subclass discriminator-value="CLOB1" name="ClobTypeOne"/>
   <subclass discriminator-value="CLOB2" name="ClobTypeTwo"/>
</class>
In another class I have a mapping to a set of ClobTypeTwo objects, however this also contains ClobTypeOne objects?! Resulting in WrongClassExceptions. The mapping
Code:
<set
   name="clobs" 
   cascade="all-delete-orphan" 
   inverse="false" 
   lazy="false">
   <key column="fk_id"/>
   <one-to-many class="ClobTypeTwo" />
</set>
If I look at the query generated it is like
Code:
select {all mapped fiels} from clobs where fk_id=?
However I would have suspected it to be (Which is what is happening when I get the class directely with get(ClobTypeTwo.class, id)).
Code:
select {all mapped fiels} from clobs where fk_id=? and discriminator='CLOB2'
For now I have solved it by including a where clause in the set, however I don't think that that should be necessary. Any more light, suggestions for this situation? Or maybe a bit more indept explaination?
For the record we are using hibernate 3.1.3, JDK, 1.4.2_05 on windows machines.