1 Reply Latest reply on Jul 1, 2013 7:46 AM by Jonathan.Knight

    Filtering by a field which is inside an array attribute of a Pof


      Hi, I am having a hard time trying to filter by an attribute which is inside a class which is an attribute of array type in the main Pof class. The structure is something like this:


      class PartyDetailsListReport implements PortableObject{


           PartyDetailGrp[] partyDetailGrp;




      class PartyDetailGrp{


           private String partyDetailID;




      So the idea is trying to make a filter like "getPartyDetailGrp.getPartyDetailID" ... but this is not working as they are not simple fields. Which would be the best approach for this problem? Thanks,




        • 1. Re: Filtering by a field which is inside an array attribute of a Pof

          Hi Efraín


          What you need is an extractor that can get the values from the members of the array but... The question you need to answer is what sort of value are you expecting to get back from calling something like "getPartyDetailGrp.getPartyDetailID"? Obviously getPartyDetailGrp() would return an array of PartyDetailGrp instances and then calling getPartyDetailID() would return the ID for each of those instances so you would be returning multiple values - in effect it is a bit like a Collection filed. So you filter would then need to be one of the filters that works with Collections such as ContainsAllFilter, ContainsAnyFilter, ContainsFilter.


          Out of the box, Coherence does not have a ValueExtractor that will work with an array in the way you want. I did post something a long time ago on a similar question where the field was a Collection rather than an array https://forums.oracle.com/message/4076106#4076106