标签:lis public ring class add keyword 表达式 getname sharp
public Page<User> findByConditions(UserCriteria, Pageable page) { Page<Item> page = itemRepository.findAll((root, criteriaQuery, criteriaBuilder) -> {
List<Predicate> predicatesList = new ArrayList<>(); if (name != null) { predicatesList.add( criteriaBuilder.and( criteriaBuilder.like( root.get("lisi"), "%" +UserCriteria.getName()+ "%"))); }
return criteriaBuilder.and( predicatesList.toArray(new Predicate[predicatesList.size()]));
}, page);
return page;
}
springboot Specification的lambda表达式
标签:lis public ring class add keyword 表达式 getname sharp
原文地址:https://www.cnblogs.com/notchangeworld/p/11990966.html