I am trying to add an entrylistener to my hazelcast map using a predicate to filter the entries.
The method I am calling is:
String addEntryListener(MapListener listener,
Predicate<K,V> predicate,
boolean includeValue)
I am trying to build a predicate to filter by my key. My keys are of type HazelKey
which have the fields:
KeyOne keyOne;
KeyTwo keyTwo;
KeyThree keyThree;
Then these three Keys have the field:
String code
Therefore i am trying to do something along the lines of:
PredicateBuilder predicate = EntryObject.key().get("keyOne").get("code").equal("1234");
to build a predicate to filter all the entries with the keyOne value 1234.
However once the listener has been added, the entries get updated, hazelcast throws the error:
Caused by: com.hazelcast.query.QueryException: java.lang.IllegalArgumentException: There is no suitable accessor for 'code' on class 'class com.sun.proxy.$Proxy45'
I believe this is because the predicateBuilder is just ignoring the top level 'KeyOne' paramater and just using 'code' so my question is: How do I do this multilevel predicatebuilding?
Thanks in advance.