IllegalStateException: Query argument not found in list of parameters

Hi,

I do have the below query.

<collection id="peopleDc" class="com.g10.align.entity.Person">
            <loader id="peopleDl">
                <query>
                    <![CDATA[select e from align_Person e where e.position is null and e.personType = :personType]]>
            </query>
        </loader>
    </collection>

And below Data Load Coordinator.

<dataLoadCoordinator auto="true">
            <refresh loader="peopleDl" param="personType" onComponentValueChanged="personTypeField"/>
        </dataLoadCoordinator>

I’m using Cuba 7.2 in my project.

My problem is i’m getting below error while clicking on Create button (When creating new record) only. For existing records there is not problem.

IllegalStateException: Query argument personType not found in the list of parameters provided during query execution.

Do I missing something?

Thanks,
Hari

Hi Hari,

Perhaps you should provide an initial value to the personType parameter on the screen initialization, because DataLoadCoordinator does this only after the component value changes. Or move the e.personType = :personType part of the query to the <condition> element as shown in the example 2 in the docs.

Regards,
Konstantin

Thanks @knstvk. Will try and revert back.

Thanks it worked.