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: Bug in Criteria API (embedded element collections)
PostPosted: Wed Nov 24, 2010 8:07 am 
Newbie

Joined: Wed Nov 24, 2010 5:07 am
Posts: 2
Hi everyone,

I have a problem with Criteria API. I have an entity which has a property mapped as ElementCollection. Calling setMaxResults(1) limits the number of entities to retrieve and the number of embedded elements in the collection. It seems the setMaxResults value is somehow taken into account when a subquery is created. I tried it with 3.6.0 RC2 version of the core. The bug is there. Did anyone experience the same problem?

Best regards,
Vitaly


Top
 Profile  
 
 Post subject: Re: Bug in Criteria API (embedded element collections)
PostPosted: Wed Nov 24, 2010 9:53 am 
Hibernate Team
Hibernate Team

Joined: Fri Oct 05, 2007 4:47 pm
Posts: 2536
Location: Third rock from the Sun
Hi,
could you please provide a unit test to apply on 3.6.0.Final ?
attach it to a jira issue, thank you > http://opensource.atlassian.com/projects/hibernate/browse/HHH

_________________
Sanne
http://in.relation.to/


Top
 Profile  
 
 Post subject: Re: Bug in Criteria API (embedded element collections)
PostPosted: Thu Nov 25, 2010 4:24 am 
Newbie

Joined: Wed Nov 24, 2010 5:07 am
Posts: 2
Hi,

I could solve this problem by using @Fetch(FetchMode.SELECT).
According to what I could see in a log file Hibernate was creating a single select with an outer join appended by a limit operator. So MAYBE it's not a bug. BUT an HQL query under the same conditions (without @Fetch annotation) returns the correct result.
Could you please comment on this? Should I still create a test case or it is just the way Criteria API works?

Tnx


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.