简体   繁体   English

Cohql - 对地图或列表内的值应用过滤器

[英]Cohql - apply filter for value which is inside map or list

I am using cohql for querying cache.我正在使用 cohql 查询缓存。 I have one cached object which has a Hashmap as a property.我有一个缓存对象,它有一个 Hashmap 作为属性。 Now when get a cache using get(key) and get NamedCache object.现在使用get(key)获取缓存并获取NamedCache对象。

I want to apply filter based on some value of property which is present inside the map.我想根据地图中存在的某些属性值应用过滤器。 I have used like this -我是这样用的——

QueryHelper.createFilter(“Obj.map{‘propertyName’}= ‘xyz’ “)

QuertHelper.createFilter(“Obj.list[‘property’]”)

But not working.但不工作。

Anybody has any idea ?有人有什么想法吗?

Or how we query for collection data ?或者我们如何查询集合数据?

Working on complex data types in coherence cache is similar to as we work normally with Java APIs在一致性缓存中处理复杂数据类型类似于我们正常使用 Java API

For query map like object in cohql we can use For map -对于 cohql 中类似对象的查询地图,我们可以使用 For map -

QueryHelper.createQuery(“Obj.get(‘key’) = ‘xyz’”)

For detailed info - https://docs.oracle.com/cd/E24290_01/coh.371/e22622/strings.htm#BEIDEFED有关详细信息 - https://docs.oracle.com/cd/E24290_01/coh.371/e22622/strings.htm#BEIDEFED

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM