-->
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: Criteria API and Inheritance
PostPosted: Thu Jan 15, 2009 11:18 am 
Newbie

Joined: Thu Jan 15, 2009 11:11 am
Posts: 1
Hello,

I'm quite new to hibernate so sorry for maybe dump question.

Is it possible to use Hibernate's criteria API on inherited classes? Inheritance strategy is Table per subclass.

To more narrow I need to use Criteria API on non inherited properties.

BaseClass {
baseProp;
}

InhAClass extends BaseClass {
inhAProp;
}

InhBClass extends BaseClass {
inhyBProp;
}

EncapsulClass {
baseClass;
}

Basically what I need to do is polymorfic query on EncapsulClass using Criteria API and as search criterions I have to use properties of extended classes (inhAProp, inhyBProp);

Search result should contain all EncapsulClass-es with InhAClass which satisfies inhAProp criterias and with InhBclass-es which satisfies InhBprop criterias.

If not, do you know some simple workaround?

Thanks a lot
Robert


Top
 Profile  
 
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.