Screen query predefined parameters

Does Jmix have any predefined paramers for loaders queries in screen xml files?

I wondering it for using current user in a query where-clause of my JPQL

Thanks

In the descpitor, write a request with the required parameters

<loader id="newEntitiesDl">
         <query>
              <![CDATA[select e from test_NewEntity e where e.createdBy =  :name]]>
         </query>
</loader>

And set parametr value on contoller

    @Subscribe
    public void onAfterInit(AfterInitEvent event) {
        newEntitiesDl.setParameter("name",currentAuthentication.getUser().getUsername());
        newEntitiesDl.load();
    }
1 Like