Need help with Hibernate? Read this first:
http://www.hibernate.org/ForumMailingli ... AskForHelp
Hibernate version:
3.x
Mapping documents:
just want to know how to search the data set by sub class,
where one table is join with a another which has a sub class.
I got following two mappings
for user obj;
Code:
<subclass discriminator-value="O" name="com.wf.core.OnlineUser">
<subclass discriminator-value="M" name="com.wf.core.MainUser">
</subclass>
<subclass discriminator-value="T" name="com.wf.core.TopicUser">
</subclass>
</subclass>
where classes are define as follows ;
Code:
public class OnlineUser extends User {}
public class MainUser extends MainUser{}
public class TopicUser extends OnlineUser {}
then i got a property obj;
Code:
<many-to-one class="com.wf.core.User" name="user" not-null="true">
<column name="property_user"/>
</many-to-one>
The issue is,
i want to list the properties that belong to Topic User, how do i generate the Criteria for that.
so far..
Code:
Criteria crit = wf.getSession().createCriteria(
Property.class);
now how do i check if property is belong to TopicUser, not MainUser or User?