报错如下:
Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'ITestDao': Invocation of init method failed; nested exception is java.lang.IllegalArgumentException: Validation failed for query for method public abstract void com.richfit.qhse.core.dao.ITestDao.updateDelAll(java.util.List)!
代码如下:
@Modifying
@Query("update sys_test r set r.deletion=true where r.id in (?1)")
void updateDelAll(List<Long> ids);
错误原因
hql语句不可以直接写表名,update后面跟的是实体名
修改如下:
@Modifying
@Query("update SysTest r set r.deletion=true where r.id in (?1)")
void updateDelAll(List<Long> ids);
启动成功~~