I have read some topic about multitable mapping in this forum. I understand Hibernate3.0 gives the <join> feature to solve the problem. Somehow, my problem is kind of different.
I have
Class B implements Interface A ---> Table X
Class C extends Class B --- Table Y
In the tables, I am using the primary key column as my discriminator column which value is "not null"
I am using Criteria API. My query object is A.
I have following mapping for A and B.
<hibernate-mapping package="gov.nih.nci.cabio.domain">
<class name="A" table="X">
<id name="id" ...>
<generator class="assigned" />
</id>
<discriminator column="a" insert="false"/>
<subclass name="B">
<property name="title" ..../>
...
...
</subclass>
</class>
</hibernate-mapping>
To add the mapping for B and C, the join doesn't work for me. Is there any solutions?
Thanks,
zeng
|