Query eWFqery = em.createQuery("SELECT eworkfirm FROM EsafWorkFirms eworkfirm WHERE eworkfirm.feiNum = :feiNumber AND eworkfirm.getEsafWork().getWorkId() IN :workIdList");
eWFqery.setParameter("feiNumber", firmObj.getFeiNum());
eWFqery.setParameter("workIdList", workIdList);
请帮助我遇到以下错误。
错误:
java.lang.IllegalArgumentException: An exception occurred while creating a query in EntityManager:
Exception Description: Syntax error parsing [SELECT eworkfirm FROM
EsafWorkFirms eworkfirm WHERE eworkfirm.feiNum = :feiNumber AND
eworkfirm.getEsafWork().getWorkId() IN :workIdList].
[52, 136] The expression is not a valid conditional expression.
答案 0 :(得分:0)
我猜这种语法在jpql中是有问题的:getEsafWork().getWorkId()
...
请尝试尝试(如果列表包含ID):
eworkfirm.esafWork.workId in ...
...如果列表中包含“作品”,则只需:
eworkfirm.esafWork in ...