2017-02-15 58 views
1

有一个Java bean具有以下Map领域:如何更新缓存在Coherence中的对象的HashMap字段的值?

private Map<String, Long> items; 

public Map<String, Long> getItems() { 
    return items; 
} 

public void setItems(Map<String, Long> items) { 
    this.items = items; 
} 

这是任何机会去使用这个Coherence Query Language领域items更新的一致性缓存对象的分布式缓存?

喜欢的东西:

update "order-cache" set items = new HashMap<String, Long>() {{put("001",2L);}} where key()=”1” 

回答

0

这可能与Guava'sImmutableMap来完成:

update "order-cache" set items = com.google.common.collect.ImmutableMap.of("001",2L) where key()="1" 

这个解决方案有仅适用于对象达在HashMap领域的5项

相关问题