-
1. Re: Multiple Objects under a single key in POJOCache?
ben.wang Aug 12, 2007 11:07 PM (in response to brucespringfield)No, you can't associate multiple objects using a single key.
-
2. Re: Multiple Objects under a single key in POJOCache?
brucespringfield Aug 13, 2007 11:37 AM (in response to brucespringfield)Hi Ben,
"ben.wang@jboss.com" wrote:
No, you can't associate multiple objects using a single key.
Then is the only use for the findAll() method to get all objects in the cache? -
3. Re: Multiple Objects under a single key in POJOCache?
brucespringfield Aug 13, 2007 11:38 AM (in response to brucespringfield)Since, there doesn't seem to be much point to use findAll(id) when you could just as well use find(id) if there will only be one object associated with this id?
-
4. Re: Multiple Objects under a single key in POJOCache?
jason.greene Aug 13, 2007 12:06 PM (in response to brucespringfield)Id really should be called Fqn in the signature. You can use this method to find all objects at a particular location in the cache.
For example:cache.attach("/people/Bob", bob); cache.attach("/people/Fred", fred); cache.attach("/group/Admins", admins); // Returns Bob and Fred cache.findAll("/people");
-Jason -
5. Re: Multiple Objects under a single key in POJOCache?
genman Aug 13, 2007 1:54 PM (in response to brucespringfield)btw, why does PojoCache use String and not Fqn in the method calls?
-
6. Re: Multiple Objects under a single key in POJOCache?
jason.greene Aug 13, 2007 3:15 PM (in response to brucespringfield)Good question. I believe Ben was trying to minimize the amount of API you needed to use to work with POJO Cache.
I will add overloaded FQN methods for 2.1.0:
http://jira.jboss.com/jira/browse/JBCACHE-1163
-Jason -
7. Re: Multiple Objects under a single key in POJOCache?
jason.greene Aug 13, 2007 3:21 PM (in response to brucespringfield)BTW I should note that I would have replaced the String versions in 2.0.0, but I didnt because by the time I joined JBoss Cache was already in CR and I didn't want to make such a significant API change. Also people are used to the String versions from the 1.X series, so leaving them would minimize the effort to upgrade to 2.0.
-
8. Re: Multiple Objects under a single key in POJOCache?
ben.wang Aug 14, 2007 2:35 AM (in response to brucespringfield)Yes, that is one reason. The other is really from PojoCache point of view, it is more natural to associate with a String id than a Fqn object id. At least that was then. :-)
-Ben -
9. Re: Multiple Objects under a single key in POJOCache?
brucespringfield Aug 14, 2007 3:51 AM (in response to brucespringfield)Hi Jason,
"jason.greene@jboss.com" wrote:
Id really should be called Fqn in the signature. You can use this method to find all objects at a particular location in the cache.
For example:cache.attach("/people/Bob", bob); cache.attach("/people/Fred", fred); cache.attach("/group/Admins", admins); // Returns Bob and Fred cache.findAll("/people");
-Jason
Thanks for the reply!! Yes, that's make it much clearer!
Kind regards