-->
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.  [ 3 posts ] 
Author Message
 Post subject: Hibernate query for subclass in association
PostPosted: Tue Jan 27, 2004 12:46 pm 
Newbie

Joined: Mon Jan 26, 2004 5:24 pm
Posts: 2
Hello,

I have a question on how to create a query in Hibernate that properly resolves a subclass.
Lets say I have 4 classes: A, B, B2 and C with the following relationships:
    B2 is a subclass of B.
    A has a many-to-one association to a B
    B2 has a one-to-one association to a C


I need to create a query that goes for A, then uses the association to B to get ONLY B2 objects, then across the association from B2 to its C.
The thing I don't understand is how to "cast" the B to be a B2. Is there something in HQL that supports this type of query?

Thanks!


Top
 Profile  
 
 Post subject:
PostPosted: Tue Jan 27, 2004 1:06 pm 
Since the association is from A to B, I would expect that you can only use it to get Bs. If you use the hierachy-per-table mapping for B and B2 you get a type field that you might be able to use as well.


Top
  
 
 Post subject:
PostPosted: Tue Jan 27, 2004 8:14 pm 
Hibernate Team
Hibernate Team

Joined: Sun Sep 14, 2003 3:54 am
Posts: 7256
Location: Paris, France
not yet, but it's on JIRA, vote for it

_________________
Emmanuel


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

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.