com.querydsl.core.types.升级到 Spring boot 1.4.0 后找不到谓词符号

问题描述 投票:0回答:2

刚刚更新了spring boot版本到1.4.0。之后我收到像

这样的错误
Error:(109, 45) java: no suitable method found for findAll(com.mysema.query.types.Predicate,org.springframework.data.domain.Pageable)
    method org.springframework.data.querydsl.QueryDslPredicateExecutor.findAll(com.querydsl.core.types.Predicate,org.springframework.data.domain.Sort) is not applicable
      (argument mismatch; com.mysema.query.types.Predicate cannot be converted to com.querydsl.core.types.Predicate)
    method org.springframework.data.querydsl.QueryDslPredicateExecutor.findAll(com.querydsl.core.types.Predicate,com.querydsl.core.types.OrderSpecifier<?>...) is not applicable
      (argument mismatch; com.mysema.query.types.Predicate cannot be converted to com.querydsl.core.types.Predicate)
    method org.springframework.data.querydsl.QueryDslPredicateExecutor.findAll(com.querydsl.core.types.OrderSpecifier<?>...) is not applicable
      (varargs mismatch; com.mysema.query.types.Predicate cannot be converted to com.querydsl.core.types.OrderSpecifier<?>)
    method org.springframework.data.querydsl.QueryDslPredicateExecutor.findAll(com.querydsl.core.types.Predicate,org.springframework.data.domain.Pageable) is not applicable
      (argument mismatch; com.mysema.query.types.Predicate cannot be converted to com.querydsl.core.types.Predicate)

升级之前,查询工作正常。

spring-boot spring-data-jpa querydsl
2个回答
4
投票

很可能(因为提供的信息非常有限)您使用的是错误版本的 QueryDSL。 QueryDSL Predicate 类现在(从 QueryDSL 4 开始)在包

com.querydsl.core.types
中。 尝试从 pom 中删除 queryDSL 依赖项的版本(如果使用 maven),并改为在依赖项管理部分使用 Spring Boot BOM 依赖项。见这里


0
投票

删除目标地图并重建它

© www.soinside.com 2019 - 2024. All rights reserved.