Java 休眠异常
org.hibernate.hql.ast.QuerySyntaxException:无法取消引用标量集合元素:cspNameJava 休眠异常,java,hibernate,spring,orm,hql,Java,Hibernate,Spring,Orm,Hql,org.hibernate.hql.ast.QuerySyntaxException:无法取消引用标量集合元素:cspName st.append("SELECT customers.name,sum(csp.cspValue) as TotalMoney "); st.append("from Account as account "); st.append("left join account.CSPFields as csp with ((a
st.append("SELECT customers.name,sum(csp.cspValue) as TotalMoney ");
st.append("from Account as account ");
st.append("left join account.CSPFields as csp with ((account.accountID=csp.id) and (csp.cspName = 'Target')) ");
st.append("left join Customers as customers");
st.append("with account.customerExec.id=customers.id ");
st.append("where (account.accountDate between :startDate and :endDate) ");
st.append("and (account.accountBatch.id in (:acIDs)) ");
st.append("group by customers.name");
CSPFields是Account类中映射的对象。cspName是地图收集的关键。在涉及对象时区分大小写,您的帐户实体真的都是大写的吗?如果您发布您的客户和帐户实体,这可能会有所帮助。对于对象而言是区分大小写的,您的帐户实体真的都是大写的吗?如果您发布您的客户和帐户实体,可能会有所帮助。您是否可以尝试使用元素(ACCOUNT.CSPFields)。这应该可以解决问题。您可以尝试使用元素(account.CSPFields)吗。这应该能奏效