From 1de53b6763522342759abe2c0048f287e6ceb14d Mon Sep 17 00:00:00 2001 From: Sebastian Date: Mon, 11 Jun 2012 10:05:22 +0200 Subject: switch from merge to persist --- src/main/java/nu/xss/jpa/dao/GenericJpaDao.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/main/java/nu/xss/jpa/dao/GenericJpaDao.java b/src/main/java/nu/xss/jpa/dao/GenericJpaDao.java index c5c2d91..e282911 100644 --- a/src/main/java/nu/xss/jpa/dao/GenericJpaDao.java +++ b/src/main/java/nu/xss/jpa/dao/GenericJpaDao.java @@ -27,11 +27,13 @@ public abstract class GenericJpaDao implements Dao, Serializable { } public void save(E entity) { - entityManager.merge(entity); + entityManager.persist(entity); + logger.info("Saved entity: {}.", entity.toString()); } public void delete(E entity) { entityManager.remove(entity); + logger.info("Deleted entity: {}.", entity.toString()); } public E findById(K id) { -- cgit v1.2.3-55-g7522