Use id from data container instance for populating another data container collection

I have

    -> customerDc  (Instance)
           -> invoices  (Collection)
    -> customerSpendView  (Collection)

I want the query of the customerSpendView collection to use the ID of the customerDc instance.

I remember the old version of Cuba was something like where :id = ds$
But now I am using 7.1 of cuba and not sure how to get this.

I can’t seem to find anything in the documentation.


Actually I think documentation is here: Data Components - CUBA Platform. Developer’s Manual

What I have come up with is something like:

public class CustomerEdit extends StandardEditor<Customer> {

    private CollectionLoader<CustomerSpendView> customerSpendViewDl;

    private InstanceLoader<Customer> customerDl;

    public void onBeforeShow(BeforeShowEvent event) {
        customerSpendViewDl.setParameter("customerId", customerDl.getEntityId());

Then the query in the designer for the would be

> select e from myapp_CustomerSpendView e where =:customerId

I presume this is how to go about it…

In CUBA 7.1 you should use DataLoadCoordinator and new format of specifying connecting parameter names: