-->
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.  [ 2 posts ] 
Author Message
 Post subject: critera search on subclasses
PostPosted: Mon Dec 06, 2004 12:01 pm 
Newbie

Joined: Mon Dec 06, 2004 11:50 am
Posts: 2
Hi..

I'm trying to do a critera search.

I have 4 subclasses that extends my "animal" class.
Lets say that the 4 subclasses are, "cat", "dog", "fish" and "rat"

The thing I'm trying to do is:

Criteria aniamlCrit = hibernateSession.createCriteria(Animal.class);

and then add something like:
animalCrit.add(Expression.eq("dog.name", "Fido");
animalCrit.add(Expression.eq("cat.sex", "male");

I want to get Animal objects from this... with all dog's having the name Fido and all Cat that are males.

can't get this to work.. (is it possible at all?)


//Martin


Top
 Profile  
 
 Post subject:
PostPosted: Mon Dec 06, 2004 12:26 pm 
Hibernate Team
Hibernate Team

Joined: Tue Sep 09, 2003 2:10 pm
Posts: 3246
Location: Passau, Germany
No, not possible.


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 2 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.