diff options
author | Sebastian | 2012-06-11 10:05:22 +0200 |
---|---|---|
committer | Sebastian | 2012-06-11 10:05:22 +0200 |
commit | 1de53b6763522342759abe2c0048f287e6ceb14d (patch) | |
tree | d4d7688f0838718c85057a43a44383ca1269a8c7 /src/main/java/nu/xss/jpa | |
parent | fix gernericdao; add logging (diff) | |
download | xss-jpa-1de53b6763522342759abe2c0048f287e6ceb14d.tar.gz xss-jpa-1de53b6763522342759abe2c0048f287e6ceb14d.tar.xz xss-jpa-1de53b6763522342759abe2c0048f287e6ceb14d.zip |
switch from merge to persist
Diffstat (limited to 'src/main/java/nu/xss/jpa')
-rw-r--r-- | src/main/java/nu/xss/jpa/dao/GenericJpaDao.java | 4 |
1 files changed, 3 insertions, 1 deletions
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<E,K> implements Dao<E,K>, 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) { |