@SuppressWarnings("unchecked") public List<T> findAllByIdInList(List<Integer> ids) { if (ids != null && ids.size() > 0) { return findByCriteria(Restrictions.in("id", ids)); } else { return new ArrayList<T>(); } }
/** * Restricts the results by the given property values * * @param property The name of the property * @param values The values to restrict by * @return This query instance */ public Query in(String property, List values) { criteria.add(Restrictions.in(property, values)); return this; }