-->
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.  [ 4 posts ] 
Author Message
 Post subject: "Extra lazy" Collection with Criteria
PostPosted: Thu Sep 14, 2006 9:22 am 
Beginner
Beginner

Joined: Wed Jan 25, 2006 10:18 am
Posts: 28
I've looked everywhere but can't figure this out.
How do I use the Criteria api to load an "extra lazy" collection?

I want
Code:
session.createCriteria(Item.class).list()
to return a lazy list.


Top
 Profile  
 
 Post subject:
PostPosted: Fri Sep 15, 2006 3:55 pm 
Beginner
Beginner

Joined: Wed Jan 25, 2006 10:18 am
Posts: 28
Perhaps it's not possible to load "extra lazy" lists with the Criteria api? If so, could someone please confirm that so I can stop looking for an answer? :)


Top
 Profile  
 
 Post subject:
PostPosted: Fri Sep 15, 2006 5:15 pm 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 6:10 am
Posts: 8615
Location: Neuchatel, Switzerland (Danish)
extra lazy collections has to do with the mapped collections.

nothing to do with the returned list from any type of query.

use a ScrollableResult or iterator or pagnation if you want a results "lazy"

_________________
Max
Don't forget to rate


Top
 Profile  
 
 Post subject:
PostPosted: Fri Sep 15, 2006 5:36 pm 
Beginner
Beginner

Joined: Wed Jan 25, 2006 10:18 am
Posts: 28
Thanks.
I was just thinking perhaps there was a way to make list() behave just like an extra lazy collection. That way you would be able to use subList(..) and size() for pagination. :)

I'm on mysql now so I'm not sure ScrollableResult is a good idea. I'll just stick to setFirstResult/setMaxResults for now.


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