状态字段路径'e.strID.strName'无法解析为有效类型

我的页面是:
image
在页面中的 “策略名称” 里面进行模糊查询,报错,报错信息如下:

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)

相关实体信息是:
评级实体:
image
策略实体:
image

添加策略名称
//策略名称

    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>

大神,请指教一下,不太明白是哪里错了:joy:

由于 strID 是一对多的映射,所以在 IndexRate 实体内是一个 List, list是没法用 e.strID.strName 来访问的。所以 <c>e.strID.strName like :custom$strName</c> 这个条件是有问题的。

不了解你的业务要搜什么,如果按照实体关系猜测,大概思路是 用 e.rateName like … and (exists select f from 策略实体 f where f 与 e的关系 and f.strName like …)。

image
业务是根据策略名称进行模糊查询,得到符合策略名称的数据,进行展示.,

那大神,我这个地方该怎么做呢?:joy:

你这个表格里策略名称怎么选出来的?

按你的实体关系, 你图上一行数据对应多个策略,你是怎么把一对多里面的多(一个list)做为一个字段选出来的? 是通过代码选出来拼出来的string? 如果是,楼上的方案就对的。 如果不是,有点乱,你得先解释下指标、策略啥关系,需要先确认你的数据库设计对不对。