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

ash*_*ram 5 querydsl spring-data-jpa spring-boot

我刚刚将 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)
Run Code Online (Sandbox Code Playgroud)

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

Uli*_*ses 4

最有可能的是(因为提供的信息非常有限)您使用了错误的 QueryDSL 版本。QueryDSL Predicate 类现在(从 QueryDSL 4 开始)位于包中com.querydsl.core.types。尝试从 pom 中删除 queryDSL 依赖项的版本(如果使用 maven),并在依赖项管理部分中使用 Spring Boot BOM 依赖项。看这里