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
|