summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorSebastian2012-06-11 10:05:22 +0200
committerSebastian2012-06-11 10:05:22 +0200
commit1de53b6763522342759abe2c0048f287e6ceb14d (patch)
treed4d7688f0838718c85057a43a44383ca1269a8c7 /src
parentfix gernericdao; add logging (diff)
downloadxss-jpa-1de53b6763522342759abe2c0048f287e6ceb14d.tar.gz
xss-jpa-1de53b6763522342759abe2c0048f287e6ceb14d.tar.xz
xss-jpa-1de53b6763522342759abe2c0048f287e6ceb14d.zip
switch from merge to persist
Diffstat (limited to 'src')
-rw-r--r--src/main/java/nu/xss/jpa/dao/GenericJpaDao.java4
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) {