criteriabuilder in 查询语句怎么写

criteriaBuilder.in 得到In对象, 可以用于添加in的列表

Path path = root.get("hospId");
CriteriaBuilder.In in = criteriaBuilder.in(path);
	for (BigInteger hospId:hospIds){
	in.value(hospId);
}
predicates.add(criteriaBuilder.and(in));
 
   

参考:

  • https://zhidao.baidu.com/question/1705552624990361460.html

转载于:https://my.oschina.net/hongdaorong/blog/3027028

你可能感兴趣的:(criteriabuilder in 查询语句怎么写)