changeset 121:958e94029163

Added manager for LOrt.
author Raimund Renkert <rrenkert@intevation.de>
date Wed, 12 Jun 2013 16:10:54 +0200
parents 0fcd395c7d07
children 84e4f3aaf9ca
files src/main/java/de/intevation/lada/manage/LOrtManager.java
diffstat 1 files changed, 42 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/main/java/de/intevation/lada/manage/LOrtManager.java	Wed Jun 12 16:10:54 2013 +0200
@@ -0,0 +1,42 @@
+package de.intevation.lada.manage;
+
+import javax.ejb.EJBTransactionRolledbackException;
+import javax.ejb.Stateless;
+import javax.ejb.TransactionAttribute;
+import javax.ejb.TransactionAttributeType;
+import javax.inject.Inject;
+import javax.persistence.EntityExistsException;
+import javax.persistence.EntityManager;
+import javax.persistence.TransactionRequiredException;
+
+import de.intevation.lada.model.LOrt;
+
+/**
+ * This Manager provides databse operations for LOrt objects.
+ *
+ * @author <a href="mailto:rrenkert@intevation.de">Raimund Renkert</a>
+ */
+@Stateless
+public class LOrtManager
+{
+    @Inject
+    private EntityManager em;
+
+    @TransactionAttribute(TransactionAttributeType.REQUIRED)
+    public void create(LOrt ort)
+    throws EntityExistsException,
+        IllegalArgumentException,
+        EJBTransactionRolledbackException,
+        TransactionRequiredException{
+        em.persist(ort);
+    }
+
+    @TransactionAttribute(TransactionAttributeType.REQUIRED)
+    public void update(LOrt ort)
+    throws EntityExistsException,
+        IllegalArgumentException,
+        EJBTransactionRolledbackException,
+        TransactionRequiredException {
+        em.merge(ort);
+    }
+}
This site is hosted by Intevation GmbH (Datenschutzerklärung und Impressum | Privacy Policy and Imprint)