[Lada-commits] [PATCH 1 of 2] Added method to persist database objects

Wald Commits scm-commit at wald.intevation.org
Thu Dec 5 09:55:24 CET 2013


# HG changeset patch
# User Raimund Renkert <raimund.renkert at intevation.de>
# Date 1386233659 -3600
# Node ID 9d5e4d4eb90f62810dab8f69666dc3a4b6ca0bb2
# Parent  f0671f400c2dc82fe3c4e497b5ae1a1bb3304d25
Added method to persist database objects.

diff -r f0671f400c2d -r 9d5e4d4eb90f src/main/java/de/intevation/lada/manage/DataManager.java
--- a/src/main/java/de/intevation/lada/manage/DataManager.java	Tue Dec 03 17:27:36 2013 +0100
+++ b/src/main/java/de/intevation/lada/manage/DataManager.java	Thu Dec 05 09:54:19 2013 +0100
@@ -38,10 +38,23 @@
         EJBTransactionRolledbackException,
         TransactionRequiredException {
         em.merge(object);
-        //em.persist(object);
     }
 
     /**
+     * Persist a database object.
+     *
+     * @param object    The new object.
+     */
+    @Override
+    @TransactionAttribute(TransactionAttributeType.REQUIRED)
+    public void persist(Object object)
+    throws EntityExistsException,
+        IllegalArgumentException,
+        EJBTransactionRolledbackException,
+        TransactionRequiredException {
+        em.persist(object);
+    }
+    /**
      * Update a database object.
      *
      * @param object    The object to update.
diff -r f0671f400c2d -r 9d5e4d4eb90f src/main/java/de/intevation/lada/manage/Manager.java
--- a/src/main/java/de/intevation/lada/manage/Manager.java	Tue Dec 03 17:27:36 2013 +0100
+++ b/src/main/java/de/intevation/lada/manage/Manager.java	Thu Dec 05 09:54:19 2013 +0100
@@ -31,4 +31,8 @@
     public void delete(Object object)
     throws IllegalArgumentException,
         TransactionRequiredException;
+
+	void persist(Object object) throws EntityExistsException,
+			IllegalArgumentException, EJBTransactionRolledbackException,
+			TransactionRequiredException;
 }


More information about the Lada-commits mailing list