jakarta-jcs-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Aaron Smuts <asm...@yahoo.com>
Subject Re: Newbee - hierarchical caching and getMatching method
Date Wed, 18 Mar 2009 17:35:26 GMT

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.


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

> From: Raj <nwiraj@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-unsubscribe@jakarta.apache.org
For additional commands, e-mail: jcs-users-help@jakarta.apache.org

View raw message