hibernate hql执行in语句 假设List<Integer> a;a里面已经有数据了,则HQL查询条件可以为:
String hql = "from Tab o where o.id in (:id)"; Query q ;List<Integer> idList = new ArrayList<Integer>();idList.add(1);idList.add(2);q.setParameterList("id", idList);