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.  [ 5 posts ] 
Author Message
 Post subject: Caching non primary key look ups
PostPosted: Sat Aug 27, 2005 8:46 am 
Newbie

Joined: Sat Aug 13, 2005 11:35 am
Posts: 5
How can I tell Hibernate to cache lookups that aren't based on primary keys? I have the second level ehcache set up but it doesn't appear to be using the cache for a basic lookup like so: -

select * from Coupon where portfolioID = 1 and instrumentID = 1234 and couponStartDate > today


Top
 Profile  
 
 Post subject:
PostPosted: Sat Aug 27, 2005 9:26 am 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 6:10 am
Posts: 8615
Location: Neuchatel, Switzerland (Danish)
look for <natural-id>

_________________
Max
Don't forget to rate


Top
 Profile  
 
 Post subject: Thanks
PostPosted: Sat Aug 27, 2005 9:44 am 
Newbie

Joined: Sat Aug 13, 2005 11:35 am
Posts: 5
Having thought about this a little more, I assume the cache won't be able to cope with relative queries (where you are checking for a date to be after or before another?)


Top
 Profile  
 
 Post subject:
PostPosted: Sat Aug 27, 2005 9:48 am 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 6:10 am
Posts: 8615
Location: Neuchatel, Switzerland (Danish)
nope - the cache is not queryable, that is what you use a database for ;)

(but we have actually a times (over a beer) talked about adding some kind of queryability to the caches)

_________________
Max
Don't forget to rate


Top
 Profile  
 
 Post subject:
PostPosted: Sat Aug 27, 2005 9:49 am 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 6:10 am
Posts: 8615
Location: Neuchatel, Switzerland (Danish)
btw. check out our new lucene integration in the annotaitons project....has some nice applications

_________________
Max
Don't forget to rate


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