【发布时间】:2018-07-09 17:32:24
【问题描述】:
根据 Spring Docs,我只能为 QBE 编写完全匹配。 我只需要精确匹配,但需要在一组值之间(查询的 IN 子句)。
例如
Person p = new Person();
p.setId(); // need to match among set of ids.
Example.of(p);
这是否可以通过 QBE 以某种方式实现,还是我完全走错了路?
类似:
Page<S> findByIdIn(List<Integer> ids, Example<S> e, Pageable p)
两全其美?
我真正需要的,基于多个字段的动态查询(在可能的组合中,比如 (1,2,4) 中的 id,status=open,约会日期
【问题讨论】:
标签: java spring spring-data spring-data-jpa query-by-example