求教Spring-data-jpa的关于多表查询+分页的问题
展开全部
方法如下
public Page<Article> findByAuthor(String authorId,Pageable pageable) {
Map<String,Object> searchParams=new HashMap<String, Object>();
Map<String, SearchFilter> filters = SearchFilter.parse(searchParams);
//添加查询条件
Specification<Article> spec = DynamicSpecifications.bySearchFilter(filters.values(), Article.class);
return articleDao.findAll(spec, pageable);
public Page<Article> findByAuthor(String authorId,Pageable pageable) {
Map<String,Object> searchParams=new HashMap<String, Object>();
Map<String, SearchFilter> filters = SearchFilter.parse(searchParams);
//添加查询条件
Specification<Article> spec = DynamicSpecifications.bySearchFilter(filters.values(), Article.class);
return articleDao.findAll(spec, pageable);
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询