JPA规范查询希望为IN子句创建一个规范。有人可以告诉我如何为IN参数子句
创建JPA规范。public interface BmsVcashQueryRepository extends JpaRepository<BmsVcashquery, String>, JpaSpecificationExecutor<BmsVcashquery> {
...
class CashQuerySpecification {
public static Specification<BmsVcashquery> paymentModeIs(String paymentmode) {
return (root, query, cb) -> cb.like(root.get("paymentmode"), paymentmode);
}
public static Specification<BmsVcashquery> paymentIs(String payment) {
return (root, query, cb) -> cb.like(root.get("inoviceCreditorcash"), payment);
}
}
}