-->
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: Problem when using class property as discriminator
PostPosted: Tue Jul 13, 2004 10:33 am 
Newbie

Joined: Tue Jun 15, 2004 6:22 am
Posts: 3
Hi everybody,

I'm using hibernate 2.1.14 in my project and I have several mapping strategies: for some objects I use a table per class hierachy strategy and for some other I use table per subclass.

I have a class named A and a class named B. B extends A using the table per class hierachy.
When I execute a query like this : select a from A as a where a.class=B all B instances are returned and when I do select a from A as a where a.class!=B all A instances that are not B instances are returned.

The problem comes when working with the table per subclass strategy, if I do the same ( select a from A as a where a.class=B ) it returns me all the instances of A that are not instances of B and the same case inverted when I ask for the objects that it's class is different from B.

Has anybody any idea about why is this happening?

Thanks in advance

Dave Garcia


Top
 Profile  
 
 Post subject:
PostPosted: Tue Jul 13, 2004 10:38 am 
Hibernate Team
Hibernate Team

Joined: Tue Sep 09, 2003 2:10 pm
Posts: 3246
Location: Passau, Germany
the .class notation is not at all supported for joined-subclasses.


Top
 Profile  
 
 Post subject:
PostPosted: Tue Jul 13, 2004 10:43 am 
Newbie

Joined: Tue Jun 15, 2004 6:22 am
Posts: 3
Thanks Michael, I suspected this because it uses discriminator's value for doing that but it was very weird for me that in joined-subclasses it worked but in an inverse way !
Maybe I'm only experimenting a random behaviour caused by the fact of not being suported by hibernate.

Sincerelly

Dave Garcia


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.