October 6, 2010 at 1:02 PM
JPA is very flexible and it provides required API for perform database related operations.
Deleting all the records (enteties) is very easy.
You can use the following code to achieve this:
Query query = em.createQuery("delete from InvoiceItems o ");
int deleted = query.executeUpdate();
Hope above example code will help in your programming.