1
通过基于StoreRepository @Oliver Gierke过滤器嵌套的收集工作不与Querydsl,春季数据REST预计
如果Store
有products
/api/store?products.name=Sony%20Vaio
返回商店有索尼VIAO集合在它的产品好,但所有产品返回, 我只需要索尼Viao名称的产品。
public interface StoreRepository extends PagingAndSortingRepository<Store, String>,
QueryDslPredicateExecutor<Store>, QuerydslBinderCustomizer<QStore> {
default void customize(QuerydslBindings bindings, QStore store) {
bindings.bind(store.products.any().first((path, value) -> path.equals(value));
}
}
任何帮助将不胜感激,
感谢,
你真的需要自定义QueryDSL绑定吗?你的代码在没有'customize'方法的情况下适用于我。可用的示例项目[在Github上](https://github.com/manish-in-java/stackoverflow-questions/tree/master/43947202)进行审查。 – manish