首页 > 解决方案 > SpringBoot Data JPA Specification 不适用于 1.5.10.RELEASE 版本的 IN CLUASE

问题描述

以下代码适用于 Spring boot org.springframework.boot版本2.0.3.RELEASE,这里我尝试应用IN子句。

//进口

import org.springframework.context.annotation.DeferredImportSelector.Group;
import javax.persistence.criteria.Predicate;

//代码

final Collection<Predicate> predicates = new ArrayList<>();
...
final Path<Group> group = root.<Group> get("countryId");
predicates.add(group.in(selected_country_ids));

但是,Group 似乎无法在org.springframework.boot版本1.5.10.RELEASE

标签: spring-bootspring-data-jpain-clause

解决方案


推荐阅读