I have an array of ids, long[] ids, and I want to retrieve a List of entities that have the ids from the id array using CriteriaQuery.
I tried to achieve this with the following code:
for (int i = 0; i < orderIds.length; i++) {
criteriaQuery.select(root);
criteriaQuery.where(criteriaBuilder.equal(path,orderIds[i]));
List<E>certificates=super.entityManager.createQuery(criteriaQuery).getResultList();
map.put(orderIds[i], certificates);
}
This code returns a Map, but I want to retrieve a list of all the entities E that have the ids among the orderIds
list. How can I do it?
Thank you!