我的页面是:
在页面中的 “策略名称” 里面进行模糊查询,报错,报错信息如下:
java.lang.IllegalArgumentException: An exception occurred while creating a query in EntityManager:
Exception Description: Problem compiling [select e from channelassessment$IndexRate e where e.strID.strName like :custom_strName].
[50, 65] The state field path 'e.strID.strName' cannot be resolved to a valid type.
---
org.eclipse.persistence.exceptions.JPQLException:
Exception Description: Problem compiling [select e from channelassessment$IndexRate e where e.strID.strName like :custom_strName].
[50, 65] The state field path 'e.strID.strName' cannot be resolved to a valid type.
at com.haulmont.cuba.core.sys.ServiceInterceptor.aroundInvoke(ServiceInterceptor.java:124)
at sun.reflect.GeneratedMethodAccessor143.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.springframework.aop.aspectj.AbstractAspectJAdvice.invokeAdviceMethodWithGivenArgs(AbstractAspectJAdvice.java:627)
at org.springframework.aop.aspectj.AbstractAspectJAdvice.invokeAdviceMethod(AbstractAspectJAdvice.java:616)
at org.springframework.aop.aspectj.AspectJAroundAdvice.invoke(AspectJAroundAdvice.java:70)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:168)
at org.springframework.aop.interceptor.ExposeInvocationInterceptor.invoke(ExposeInvocationInterceptor.java:92)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179)
at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:213)
at com.sun.proxy.$Proxy220.loadList(Unknown Source)
相关实体信息是:
评级实体:
策略实体:
添加策略名称
//策略名称
public Component generateStrNameCell(IndexRate entity) {
Label label = componentsFactory.createComponent(Label.class);
List list = entity.getStrID();
for(int i = 0 ; i < list.size() ; i++){
label.setValue(list.size() == 0 ? "" : ((StrategyManage)list.get(i)).getStrName());
}
return label;
}
查询部分代码:
//查找
public void onSearchBtnClick() {
indexRatesDs.refresh(ParamsMap.of("indexName",indexNameField.getValue()==null ? "" : "%" + indexNameField.getValue() + "%",
"strName",strNameField.getValue() == null ? "" : "%" + strNameField.getValue() + "%" ));
}
<query>
<![CDATA[select e from channelassessment$IndexRate e]]>
<filter>
<and>
<c>e.rateName like :custom$indexName</c>
<c>e.strID.strName like :custom$strName</c>
</and>
</filter>
</query>
大神,请指教一下,不太明白是哪里错了