-->
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: Question on 2nd level query Caching
PostPosted: Mon Apr 16, 2007 8:08 pm 
Newbie

Joined: Thu Jan 18, 2007 12:55 am
Posts: 10
I have some questions on 2nd level query caching. Does 2nd level caching only allows caching of entities that have a mapping with database.
Suppose if I fetch a query with projection, with selected columns , is it able to cache the query that return columns for different tables

Suppose if I do this
Query q = session.createQuery("select p.name,s.salAmount from Person p
join p.salary s where p.age > 25");

query.setCachemode(CacheMode.NORMAL);
query.setCacheable(true);
query.setCachregion("query.cachreGion);

query.list();

Is this kind of query cachable or do I need to select the whole row with salary assosciation such as
("select p from Person p left join fetch p.salary s where p.age > 25")

to make this query cacheble

Thanks


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.