-->
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.  [ 2 posts ] 
Author Message
 Post subject: How to do this kind of caching using Hibernate?
PostPosted: Fri Sep 02, 2011 5:21 pm 
Newbie

Joined: Fri Sep 02, 2011 9:28 am
Posts: 4
Is it possible to achieve this using Hibernate?

I have Orders table in which the status can be P, A, B, M, G, X

There is a JSP application which fetches the orders
Two links -
Orders with pending status (gives all orders with status='P')
Orders with confirmed status(gives all orders with status<>'P')

Is there anyway to cache the contents of the second query and never the first query? This is because once the order is confirmed, its entries cannot change(for some tables like orders, orderitems etc)


Top
 Profile  
 
 Post subject: Re: How to do this kind of caching using Hibernate?
PostPosted: Mon Sep 05, 2011 4:32 am 
Beginner
Beginner

Joined: Wed Jan 07, 2009 7:07 pm
Posts: 26
You can write two separate queries for these and use query cache for the one you want to cache.


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