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();
时间: 2024-11-04 17:07:49