springboot在注入的時候提示
Unsatisfied dependency expressed through field 'deptService'; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'deptService': Unsatisfied dependency expressed through field 'deptRepository'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'deptRepository': Invocation of init method failed; nested exception is java.lang.IllegalArgumentException: Validation failed for query for method public abstract int com.sxt.springboot.repository.DeptRepository.updateDeptById(com.sxt.springboot.model.Dept)!
最後找到問題
是repository的query註解語句的時候,用的表單名稱必須起別名