升级 Spring Boot 和 JPA 后,`@Query` 方法启动报错 Validation Failed 怎么办?

新手上路,请多包涵

jpa升级到3.3.2启动提示 Validation failed for query for method public abstract java.util.List com.ford.fc.parms.parammaster.system.api.repository.BranchRepository.getBranchCodeListData(java.lang.Short,java.time.LocalDate)

org.springframework.boot:3.3.2
spring-boot-starter-data-jpa:3.3.2

@Data
    public static class UniqueId implements Serializable {

        private static final long serialVersionUID = 1L;
        private Short companyBusinessCode;
        private String branchCode;
        private LocalDate branchEffectiveDate;
    }
@Query(name="Branch.getParameterListData")
    List<Object[]> getBranchCodeListData(Short coBusCode,LocalDate now);
Branch.getParameterListData = SELECT DISTINCT branchName,branchCode \
                            FROM Branch A \
                            WHERE companyBusinessCode = ?1 \
                            AND branchEffectiveDate=\
                            (SELECT MAX (branchEffectiveDate) \
                            FROM Branch \
                            WHERE companyBusinessCode = ?1 \
                            AND branchCode  = A.branchCode \
                            AND (branchExpiryDate > ?2 \
                            OR branchExpiryDate IS NULL))\

升级之前org.springframework.boot是2.7.14 是正常的

阅读 614
撰写回答
你尚未登录,登录后可以
  • 和开发者交流问题的细节
  • 关注并接收问题和回答的更新提醒
  • 参与内容的编辑和改进,让解决方法与时俱进
宣传栏