I want to create SQL query for deleting rows. I tried this:
public void deleteByIds(List<Integer> ids)
{
String hql = "delete from " + OnboardingTasks.class.getName() + " e WHERE e.id IN :ids";
TypedQuery<OnboardingTasks> query = entityManager.createQuery(hql, OnboardingTasks.class).setParameter("ids", ids);
query.executeUpdate();
}
But I get exception: ption [Request processing failed; nested exception is java.lang.IllegalArgumentException: Update/delete queries cannot be typed] with root cause java.lang.IllegalArgumentException: Update/delete queries cannot be typed
Do you know what is the proper way to send a list of Id's to delete?