hibernate:Not all named parameters have been
Posted 学习笔记
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了hibernate:Not all named parameters have been相关的知识,希望对你有一定的参考价值。
出错信息
update Project p set p.returnCount=:returnCount,p.passTime =:passTime, p.returnTime=:returnTime where p.id=:id
Not all named parameters have been set: [passTime]
passTime是Date数据类型,现在需要设置成null,只需要把hql里面改对象设置为null
public void updateReturnCount(Project project){ try { String hql = "update Project p set p.returnCount=:returnCount,p.passTime=null, p.returnTime=:returnTime where p.id=:id"; Parameter param = new Parameter(); param.put("returnCount",project.getReturnCount()); // 如果需要前台设置驳回时间,替换成project.getReturnTime() param.put("returnTime",DateUtils.getSysDate()); param.put("id",project.getId()); int effected = projectDao.batchExecute(hql, param); log.info("projectId:{},更新后returnCount:{},驳回时间:{},更新{}条数", project.getId(),project.getReturnCount(), DateUtils.dateFormat(project.getReturnTime()),effected); }catch (Exception e) { log.error("项目驳回出错:{}",e); } }
以上是关于hibernate:Not all named parameters have been的主要内容,如果未能解决你的问题,请参考以下文章
PRVF-6402 : Core file name pattern is not same on all the nodes. (Doc ID 1523580.1)