0
我試圖使用謂詞向我的hazelcast地圖中添加entrylistener以過濾條目。帶嵌套密鑰的Hazelcast PredicateBuilder
我打電話的方法是:
String addEntryListener(MapListener listener,
Predicate<K,V> predicate,
boolean includeValue)
我想建立一個謂語用我的鑰匙進行過濾。我的鑰匙是HazelKey
型具有以下字段:
KeyOne keyOne;
KeyTwo keyTwo;
KeyThree keyThree;
然後這三個鍵有場:
String code
因此,我試圖做的線沿線的東西:
PredicateBuilder predicate = EntryObject.key().get("keyOne").get("code").equal("1234");
構建謂詞以過濾keyOne值1234的所有條目。
然而,一旦監聽器被添加,該項目得到更新,hazelcast引發錯誤:
Caused by: com.hazelcast.query.QueryException: java.lang.IllegalArgumentException: There is no suitable accessor for 'code' on class 'class com.sun.proxy.$Proxy45'
我相信這是因爲predicateBuilder只是忽略了頂級「KeyOne」 paramater,只是用「代碼」等等我的問題是:如何做這個多級謂詞建立?
在此先感謝。