I have the following data in my database table
1 myname@email.com 2323
2 myname@email.com 3432
3 myname2@gmail.com 4433
I want to remove all records in table where email == myname@email.com
Below is my EJBQL – I do not know where I go wrong, but the query does not work.
Query query = em.createQuery("DELETE FROM ResetPasswordEntity r WHERE r.email=:email");
query.setParameter("email", email);
The query is correct. I am missing a line of code. Here is it for the benefit for those who might face this issue.