What prefix to use when query in a collection is referencing another collection?

Within a collection, how do I refer to another collection that is defined in the same screen descriptor? I am realizing that I cannot use the “ds” prefix which works for datasources. For example ds$customersDc.

In my screen descriptor I have the following data components:

<data>
    <instance id="batchDc" class="com.company.lms.entity.Batch" view="batch-view">
        <loader/>
    </instance>

    <collection id="customersDc" class="com.company.lms.entity.Customer" view="_local">
        <loader id="customersLc">
            <query><![CDATA[select e from lms_customer e]]></query>
        </loader>
    </collection>

    <collection id="activeCustomersDc" class="com.company.lms.entity.Customer" view="_local">
        <loader id="activeCustomersLc">
            <query><![CDATA[select e from ds$customersDc e where e.active = 1]]></query>
        </loader>
    </collection>
</data>

NOTE: I have simplified my queries just to get help. In the second collection, how do I refer to the first collection ?
I am getting an error when I use ds$customersDc as seen in my code.

In Cuba 7 you have to subscribe to the events of the data components and use the parameters for related data loaders. Examine the guides https://www.cuba-platform.com/guides/ and read the documentation about the data components Dependencies Between Data Components - CUBA Platform. Developer’s Manual

It’s a shame that declarative parameters have gone from version 7.0 as this made linking tables a doddle. Now we have to deal with the event handling(lots of repeated code), or use the mixin example, which works after a bit of fixing but seems a bit slow.

You still could use old way of data linking. All you need is to select a ‘Legacy Screen Templates’ tab when you create a screen.

That is very true.

Please vote for this feature: Built-in mechanism for declarative linking of data components · Issue #1988 · cuba-platform/cuba · GitHub

You still could use old way of data linking. All you need is to select a ‘Legacy Screen Templates’ tab when you create a screen.

Yes, the problem here is that if you want to have more than two levels of data composition on the screen then you need to use the new screens, and then you need a lot more boilerplate code to knit the tables together.