jpa in查询

List<Integer> ids = new ArrayList<Integer>(); ids.add(1); ids.add(2); Map<String, Object> params = new HashMap<String, Object>(); params.put("ids", ids); String jpql = "select o from oa_usersroles o where o.role.id in(:ids)"; List<Module> modules = em.createQuery(jpql).setParameter("ids", ids).getResultList();
原文地址:https://www.cnblogs.com/yinchuan/p/6143213.html