-->
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: Problems with inner join and Criteria api
PostPosted: Tue Oct 20, 2009 4:15 am 
Newbie

Joined: Wed Feb 25, 2009 2:50 am
Posts: 3
Hi,

I have one class "Entity" which has a realtionship "one to many" to another class "Rating". The rating has (among others) an attribute "validTo" which are nullable.

What I'm trying to do is to fetch an Entity (by its id) together with all it's ratings where validTo is null. I do this by creating an alias on the criteria and setting the fetchType to "INNER_JOIN" (even though this should be default).

The query works fine BUT it gives me ALL the ratings, not just the ones with validTo is null.

I'm new to Hibernate and defenitely no exert on databases but it sure seems wrong to me. Is there anyone that has a solution for this or can tell me what I'm doing wrong. I don't attach any code yet hoping you to be able to reply anyhow but if code is needed please let me know.

//Magnus


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.