The issue is because you are using a Set
to hold your values. Set
-s normally don't have an ordering and therefore no get(index)
method. So you cannot pass values to them like that: supplierPaidChecks[0].checkNo
. Of course you can remove indexing (e.g. supplierPaidChecks.checkNo
) but since your sets hold objects and you are trying to submit more than one property to it, it will lead to not desired behavior.
The best solution will be to change your Set
-s to List
-s and if you have overridden equals
methods then pull that logic to some utility class and check uniqueness of objects in list elsewhere.