Here are the examples of the java api class javax.persistence.criteria.CriteriaBuilder.In taken from open source projects.
1. Query#in()
Project: SpringMVCWithJavaConfig
File: Query.java
File: Query.java
/** * in * * @param propertyName ???? * @param value ??? */ public void in(String propertyName, Collection value) { if ((value == null) || (value.size() == 0)) { return; } Iterator iterator = value.iterator(); In in = criteriaBuilder.in(from.get(propertyName)); while (iterator.hasNext()) { in.value(iterator.next()); } this.predicates.add(in); }
2. Query#notIn()
Project: SpringMVCWithJavaConfig
File: Query.java
File: Query.java
/** * not in * * @param propertyName ???? * @param value ??? */ public void notIn(String propertyName, Collection value) { if ((value == null) || (value.size() == 0)) { return; } Iterator iterator = value.iterator(); In in = criteriaBuilder.in(from.get(propertyName)); while (iterator.hasNext()) { in.value(iterator.next()); } this.predicates.add(criteriaBuilder.not(in)); }