I hereby claim:
- I am plutonicj on github.
- I am cybi (https://keybase.io/cybi) on keybase.
- I have a public key ASC1Rte2uWRwVULdGUyM0LDlHDpDJ71JkGtBOcxvEolAVAo
To claim this, I am signing this object:
I hereby claim:
To claim this, I am signing this object:
| public class EntityManagerHelper { | |
| public static <ENTITY_TYPE> void persistInTransaction(EntityManager entityManager, ENTITY_TYPE entity) { | |
| executeInTransaction(entityManager, () -> entityManager.persist(entity)); | |
| } | |
| public static <EC> void removeAll(EntityManager em, Class<EC> entityClass) { | |
| executeInTransaction(em, () -> { | |
| List<EC> all = findAll(em, entityClass); | |
| for (EC entity : all) { | |
| em.remove(entity); |