我有Specification<A>
的构建器。我想将其应用于连接实体的另一个规范中:
private static Specification<B> createForFieldA(Filter filter) {
return (root, query, cb) -> {
Join<B, A> joined = root.join("a")
Specification<A> aspec = ASpecification.createSpec(filter.getAFilter());
//next what I want to do:
return aspec.applyFor(joined);
}
}
我可以通过某种方式做到这一点吗?