This content has been marked as final.
Show 2 replies
-
1. Re: Objects with multiple paths
cwampler Apr 5, 2004 1:00 PM (in response to sateh)We had the same issue, and what we did was cached a bunch of key matchups along with the object. So we would do something like this:
cache.put("/foo/byId", Id, Object)
Then also
cache.put ("/keylookup", "/foo/byName," + Name, "/foo/byId," + Id)
That way when it comes lookup time you can first do a keylookup on "/foo/byName," + Name to see if it has another node (In this case "/foo/byId," + Id, then grab that one.
If you find a better solution please let me know. -
2. Re: Objects with multiple paths
belaban Apr 5, 2004 8:46 PM (in response to sateh)Why don't you use this ? :
Person joe;
TreeCacheAop tree;
tree.putObject("/aop/joe1", joe);
tree.putObject("/aop/bela", joe);
You'll have 2 bindings for the *same* object. References were introduced by Ben in the 1.0 release of JBossCache
Bela