I am getting the following error in my execution of a React load operation using a filtered query:
2021-01-21 17:10:07.012 DEBUG [http-nio-8080-exec-3/pasweb-core/jrusso] com.haulmont.cuba.core.app.RdbmsStore - loadList: metaClass=pasweb_Orders, view=com.paslists.pasweb.entity.Orders/orders-view, query=Query{queryString='select e from pasweb_Orders e where (e.ordType = :UIspqQnNEQ and e.cancelled = :juqOtVGVJf and e.cus.id = :AbyoOWCtpS and e.mplist.brk.id = :zgrcdWfgUd) order by e.bkrnum desc', condition=null, sort=null, firstResult=0, maxResults=10000}, max=10000
2021-01-21 17:10:07.041 ERROR [http-nio-8080-exec-3/pasweb-core/jrusso] com.haulmont.cuba.core.sys.ServiceInterceptor - Exception:
java.lang.IllegalArgumentException: An exception occurred while creating a query in EntityManager:
Exception Description: Problem compiling [select e from pasweb_Orders e where (e.ordType = :UIspqQnNEQ and e.cancelled = :juqOtVGVJf and e.cus.id = :AbyoOWCtpS and e.mplist.brk.id = :zgrcdWfgUd) order by e.bkrnum desc].
[122, 137] The state field path 'e.mplist.brk.id' cannot be resolved to a valid type.
at org.eclipse.persistence.internal.jpa.EntityManagerImpl.createQuery(EntityManagerImpl.java:1750) ~[org.eclipse.persistence.jpa-2.7.3-14-cuba.jar:na]
at com.haulmont.cuba.core.sys.QueryImpl.buildJPAQuery(QueryImpl.java:232) ~[cuba-core-7.2.11.jar:7.2.11]
at com.haulmont.cuba.core.sys.QueryImpl.getQuery(QueryImpl.java:141) ~[cuba-core-7.2.11.jar:7.2.11]
at com.haulmont.cuba.core.sys.QueryImpl.getResultList(QueryImpl.java:412) ~[cuba-core-7.2.11.jar:7.2.11]
at com.haulmont.cuba.core.app.RdbmsStore.executeQuery(RdbmsStore.java:901) ~[cuba-core-7.2.11.jar:7.2.11]
at com.haulmont.cuba.core.app.RdbmsStore.getResultList(RdbmsStore.java:809) ~[cuba-core-7.2.11.jar:7.2.11]
at com.haulmont.cuba.core.app.RdbmsStore.loadList(RdbmsStore.java:242) ~[cuba-core-7.2.11.jar:7.2.11]
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[na:1.8.0_251]
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[na:1.8.0_251]
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[na:1.8.0_251]
at java.lang.reflect.Method.invoke(Method.java:498) ~[na:1.8.0_251]
at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:344) ~[spring-aop-5.2.9.RELEASE.jar:5.2.9.RELEASE]
at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:198) [spring-aop-5.2.9.RELEASE.jar:5.2.9.RELEASE]
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:163) [spring-aop-5.2.9.RELEASE.jar:5.2.9.RELEASE]
at org.springframework.aop.interceptor.ExposeInvocationInterceptor.invoke(ExposeInvocationInterceptor.java:95) [spring-aop-5.2.9.RELEASE.jar:5.2.9.RELEASE]
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:186) [spring-aop-5.2.9.RELEASE.jar:5.2.9.RELEASE]
at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:212) [spring-aop-5.2.9.RELEASE.jar:5.2.9.RELEASE]
at com.sun.proxy.$Proxy357.loadList(Unknown Source) ~[na:na]
As you can see, it does not like the multi-level parameter āe.mplist.brk.idā. Here is the view:
<view entity="pasweb_Orders" name="orders-view" extends="_local">
<property name="mplist" view="_minimal" fetch="JOIN">
<property name="actqty"/>
<property name="ordqty"/>
<property name="recdqty"/>
<property name="mplType"/>
<property name="status"/>
<property name="brk" view="_minimal"/>
</property>
<property name="totQtyOrdered"/>
<property name="totQtyConverted"/>
<property name="cus" view="_minimal" fetch="JOIN"/>
<property name="lst" view="_minimal" fetch="JOIN"/>
<property name="mlr" view="_minimal" fetch="JOIN"/>
<property name="statusDesc"/>
<property name="totQtyReceived"/>
</view>
All I need from the ābrkā object is the ID, which is already in the mplist entity, hence the ā_minimalā view and no fetch parameter on it.
The mplist entity has this field in it:
@ManyToOne(fetch = FetchType.LAZY, optional = false)
@JoinColumn(name = "brk_id")
private Brokers brk;
And, finally, here is the collection definition showing the filter:
this.dataCollection = collection<Orders>(Orders.NAME, {
view: "orders-view",
sort: "-bkrnum",
filter: {
conditions: [
{property: "ordType", operator: "=", value: "MPO"},
{property: "cancelled", operator: "=", value: "1"},
{property: "cus", operator: "=", value: cusId},
{property: "mplist.brk", operator: "=", value: brkId}
]
},
});
Can anybody tell me why I am getting this state error?