2
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 ((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是在帳戶類映射的對象。 cspName是地圖收集中的關鍵。