伙计们感谢时间和帮助
我使用case和参数进行HQL查询,当我设置参数
时出现错误我的查询是:
SELECT
IC.Sources,
IC.Total,
IC.Destination,
IC.Where,
ICP.Date,
ICP.filedirectory,
ICP.filename
FROM IcmA AS IC, IcmProc AS ICP
WHERE IC.uniqueid = ICP.uniqueid
AND IC.Sources = :Num OR IC.Destination= :Num
AND CASE
WHEN LENGTH(IC.Sources) = 1 OR LENGTH(IC.Destination) = 1 THEN
:NBalance
WHEN LENGTH(IC.Sources) > 1 OR LENGTH(IC.Destination) > 1 THEN
:NBalance
ELSE
:NBalance
END = :NBalance
AND(DATE_FORMAT(ICP.Date, '%Y/%m/%d') >= :fDate AND DATE_FORMAT(ICP.Date, '%Y/%m/%d') <= :tDate) ORDER BY ICP.Date DESC
错误:
org.hibernate.hql.ast.tree.ParameterNode cannot be cast to org.hibernate.hql.ast.tree.SelectExpression>
java.lang.ClassCastException: org.hibernate.hql.ast.tree.ParameterNode cannot be cast to org.hibernate.hql.ast.tree.SelectExpression