-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 
Author Message
 Post subject: sub class sql issue
PostPosted: Tue Mar 17, 2009 12:33 am 
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?


Top
  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.