Jpa的criteriaBuilder.in 使用

效果相当于 where (maintainUnitId in (?,?..) )

List predicates = new ArrayList<>();
if(companyEntities!=null&&companyEntities.size()>0){
   Path path = root.get("maintainUnitId");//定义查询的字段
   CriteriaBuilder.In in = criteriaBuilder.in(path);
   for (int i = 0; i  
  

 

你可能感兴趣的:(SQL)