Thanks for your reply. We managed to use the grouping feature to accomplish 
this.

We do however, have a need for searching elements within the cache.
Is there existing functionality in the framework or is this something that has 
to be done outside the JCS framework?


TIA,
Raj


--- On Wed, 3/18/09, Aaron Smuts <asm...@yahoo.com> wrote:

From: Aaron Smuts <asm...@yahoo.com>
Subject: Re: Newbee - hierarchical caching and getMatching method
To: "JCS Users List" <jcs-users@jakarta.apache.org>, nwi...@yahoo.com
Date: Wednesday, March 18, 2009, 1:35 PM


The getMatching API has nothing to do with the colon convention.  

The getMatching API allows you to use string pattern matching to retrieve 
items.  Your keys have to be strings to use it.  It even works with the JBDC 
disk cache, if you only use patterns that can be converted into like queries.

The colon convention simply allows you to remove items with string keys that 
match the substring.  

I suppose we need a removeMatching method as well.

Aaron

--- On Mon, 3/16/09, Raj <nwi...@yahoo.com> wrote:

> From: Raj <nwi...@yahoo.com>
> Subject: Newbee - hierarchical caching and getMatching method
> To: jcs-users@jakarta.apache.org
> Date: Monday, March 16, 2009, 2:36 PM
> Hello All,
> 
> I am trying to use hierarchical storage using JCS.
> 
> I have added objects to cache with following code.
> testCache.put ("A:1:a", object1);
> testCache.put ("A:1:b", object2);
> testCache.put ("A:2:a", object3);
> 
> I looking to get the first two objects using the following
> code
> Map map = testCache.getMatching("A:1:");
> 
> This is returning empty map. Thought it would do a pattern
> matching with begins with
> and use colon as separator, as per the JCS web page?
> 
> However this does return a one item, as it should:
> Map map = testCache.getMatching("A:1:a");
> 
> What am i missing?, does matching only match exact? please
> let me know. 
> 
> Thanks in advance,
> Raj
> 
> 
>      

---------------------------------------------------------------------
To unsubscribe, e-mail: jcs-users-unsubscr...@jakarta.apache.org
For additional commands, e-mail: jcs-users-h...@jakarta.apache.org




      

Reply via email to