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: NHibernate pulling a branch of the Inheritance hierarchy.
PostPosted: Thu Sep 18, 2008 9:46 am 
Newbie

Joined: Thu Sep 18, 2008 9:38 am
Posts: 1
I have successfully setup my mapping files to support a table per hierarchy model. It works great when persisting. When I pull things back it will properly map to the concrete class, which is also perfect.

My question is can I query for just a particular concrete class rather than pulling everything and then performing casts to determine if it is one class or another. Anything with Examples/Criteria?

Thanks,

Pete Grazaitis


Top
 Profile  
 
 Post subject:
PostPosted: Thu Sep 18, 2008 12:29 pm 
Regular
Regular

Joined: Tue Oct 16, 2007 9:45 am
Posts: 93
you have discriminator column that you could filter by I guess?


Top
 Profile  
 
 Post subject:
PostPosted: Fri Sep 19, 2008 1:36 am 
Expert
Expert

Joined: Thu Dec 14, 2006 5:57 am
Posts: 1185
Location: Zurich, Switzerland
There is a special property "class" which can be used for that. There are two thread about it at the nhuser group at google:

http://groups.google.com/group/nhusers/browse_thread/thread/c68c903c686e4737

http://groups.google.com/group/nhusers/browse_thread/thread/bab5b00039138a69

_________________
--Wolfgang


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.