How to filter for un-empty array in CUBA Platform collection

125 Views Asked by At

I need to call a collection consisting of objects that have an un-empty array in the items (array) field, I filter collection like this:

filter:
conditions:[
{
              property: "items",
              operator: "notEmpty",
              value:null
            }]

but this solution doesn't work, 500 error is returned, how to implement it?

1

There are 1 best solutions below

1
Vadim Basko On

CUBA Platform REST API doesn't support filtration by collections (@OneToMany and @ManyToMany relations).

To implement such functionality you need to create and expose predefined JPQL query on back end.

There is similar discussion on CUBA Platform forum.