-->
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: Get all the instances of class in cache
PostPosted: Thu Apr 07, 2005 4:07 am 
Beginner
Beginner

Joined: Thu Feb 03, 2005 12:48 pm
Posts: 22
Suppose I have a class Apple.
I want to get all the instances of Apple.

One solution is to write :
Code:
        Criteria criteria = hbSession.createCriteria(Apple.class);
        return criteria.list();



However, if I execute the statement again, the query is executed again on the database.

I would like the collection of Apples to be kept in cache : how to achieve it ?

I do not want to cache ResultSets, but cache Apples.

Thanks
Regards


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.