# HG changeset patch # User Raimund Renkert # Date 1372076009 -7200 # Node ID 8d88224f8ffca4a108b5c983a95ae709c1b3fd9b # Parent 8bf3054109babf64b7d0a66d324089f7d10dcd92 Remove concrete managers. diff -r 8bf3054109ba -r 8d88224f8ffc src/main/java/de/intevation/lada/manage/LKommentarMManager.java --- a/src/main/java/de/intevation/lada/manage/LKommentarMManager.java Mon Jun 24 14:12:06 2013 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,72 +0,0 @@ -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.LKommentarM; - -/** - * This Manager provides databse operations for LKommentarM objects. - * - * @author Raimund Renkert - */ -@Stateless -public class LKommentarMManager -{ - @Inject - private EntityManager em; - - /** - * Delete a LKommentarM object by id. - * - * @param id - * @throws Exception - */ - @TransactionAttribute(TransactionAttributeType.REQUIRED) - public void delete(String id) throws Exception { - LKommentarM kommentar = em.find(LKommentarM.class, id); - em.remove(kommentar); - } - - /** - * Persist a new LKommentarM object in the database. - * - * @param kommentar The new LKommentarM object. - * - * @throws EntityExistsException - * @throws IllegalArgumentException - * @throws TransactionRequiredException - */ - @TransactionAttribute(TransactionAttributeType.REQUIRED) - public void create(LKommentarM kommentar) - throws EntityExistsException, - IllegalArgumentException, - EJBTransactionRolledbackException, - TransactionRequiredException { - em.persist(kommentar); - } - - /** - * Updates a LKommentarM object in the database. - * - * @param kommentar The new LKommentarM object. - * - * @throws EntityExistsException - * @throws IllegalArgumentException - * @throws TransactionRequiredException - */ - @TransactionAttribute(TransactionAttributeType.REQUIRED) - public void update(LKommentarM kommentar) - throws EntityExistsException, - IllegalArgumentException, - EJBTransactionRolledbackException, - TransactionRequiredException { - em.merge(kommentar); - } -} diff -r 8bf3054109ba -r 8d88224f8ffc src/main/java/de/intevation/lada/manage/LKommentarPManager.java --- a/src/main/java/de/intevation/lada/manage/LKommentarPManager.java Mon Jun 24 14:12:06 2013 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,36 +0,0 @@ -package de.intevation.lada.manage; - -import java.util.logging.Logger; - -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.LKommentarP; -import de.intevation.lada.model.LKommentarPId; - -@Stateless -public class LKommentarPManager -{ - @Inject - private EntityManager em; - - @Inject - private Logger logger; - - @TransactionAttribute(TransactionAttributeType.REQUIRED) - public void create(LKommentarP kommentar) - throws EntityExistsException, - IllegalArgumentException, - TransactionRequiredException - { - LKommentarPId id = new LKommentarPId(); - id.setProbeId(kommentar.getProbeId()); - kommentar.setId(id); - em.persist(kommentar); - } -} diff -r 8bf3054109ba -r 8d88224f8ffc src/main/java/de/intevation/lada/manage/LMessungManager.java --- a/src/main/java/de/intevation/lada/manage/LMessungManager.java Mon Jun 24 14:12:06 2013 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,72 +0,0 @@ -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.LMessung; - -/** - * This Manager provides database operations for LMessung objects. - * - * @author Raimund Renkert - */ -@Stateless -public class LMessungManager -{ - @Inject - private EntityManager em; - - /** - * Delete a LProbe object by id. - * - * @param id - * @throws Exception - */ - @TransactionAttribute(TransactionAttributeType.REQUIRED) - public void delete(String id) throws Exception { - LMessung probe = em.find(LMessung.class, id); - em.remove(probe); - } - - /** - * Persist a new LProbe object in the database using the LProbeValidator. - * - * @param probe The new LProbe object. - * - * @throws EntityExistsException - * @throws IllegalArgumentException - * @throws TransactionRequiredException - */ - @TransactionAttribute(TransactionAttributeType.REQUIRED) - public void create(LMessung probe) - throws EntityExistsException, - IllegalArgumentException, - EJBTransactionRolledbackException, - TransactionRequiredException { - em.persist(probe); - } - - /** - * Updates a LProbe object in the database. - * - * @param probe The new LProbe object. - * - * @throws EntityExistsException - * @throws IllegalArgumentException - * @throws TransactionRequiredException - */ - @TransactionAttribute(TransactionAttributeType.REQUIRED) - public void update(LMessung probe) - throws EntityExistsException, - IllegalArgumentException, - EJBTransactionRolledbackException, - TransactionRequiredException { - em.merge(probe); - } -} diff -r 8bf3054109ba -r 8d88224f8ffc src/main/java/de/intevation/lada/manage/LMesswertManager.java --- a/src/main/java/de/intevation/lada/manage/LMesswertManager.java Mon Jun 24 14:12:06 2013 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,72 +0,0 @@ -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.LMesswert; - -/** - * This Manager provides databse operations for LMesswert objects. - * - * @author Raimund Renkert - */ -@Stateless -public class LMesswertManager -{ - @Inject - private EntityManager em; - - /** - * Delete a LProbe object by id. - * - * @param id - * @throws Exception - */ - @TransactionAttribute(TransactionAttributeType.REQUIRED) - public void delete(String id) throws Exception { - LMesswert messwert = em.find(LMesswert.class, id); - em.remove(messwert); - } - - /** - * Persist a new LMesswert object in the database. - * - * @param messwert The new LMesswert object. - * - * @throws EntityExistsException - * @throws IllegalArgumentException - * @throws TransactionRequiredException - */ - @TransactionAttribute(TransactionAttributeType.REQUIRED) - public void create(LMesswert messwert) - throws EntityExistsException, - IllegalArgumentException, - EJBTransactionRolledbackException, - TransactionRequiredException { - em.persist(messwert); - } - - /** - * Updates a LMesswert object in the database. - * - * @param messwert The new LMesswert object. - * - * @throws EntityExistsException - * @throws IllegalArgumentException - * @throws TransactionRequiredException - */ - @TransactionAttribute(TransactionAttributeType.REQUIRED) - public void update(LMesswert messwert) - throws EntityExistsException, - IllegalArgumentException, - EJBTransactionRolledbackException, - TransactionRequiredException { - em.merge(messwert); - } -} diff -r 8bf3054109ba -r 8d88224f8ffc src/main/java/de/intevation/lada/manage/LOrtManager.java --- a/src/main/java/de/intevation/lada/manage/LOrtManager.java Mon Jun 24 14:12:06 2013 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,42 +0,0 @@ -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 Raimund Renkert - */ -@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); - } -} diff -r 8bf3054109ba -r 8d88224f8ffc src/main/java/de/intevation/lada/manage/LProbeManager.java --- a/src/main/java/de/intevation/lada/manage/LProbeManager.java Mon Jun 24 14:12:06 2013 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,78 +0,0 @@ -package de.intevation.lada.manage; - -import java.util.logging.Logger; - -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.LProbe; - -/** - * This Manager provides databse operations for LProbe objects. - * - * @author Raimund Renkert - */ -@Stateless -public class LProbeManager { - - @Inject - private Logger log; - - @Inject - private EntityManager em; - - /** - * Delete a LProbe object by id. - * - * @param id - * @throws Exception - */ - @TransactionAttribute(TransactionAttributeType.REQUIRED) - public void delete(String id) throws Exception { - LProbe probe = em.find(LProbe.class, id); - log.info("Deleting " + probe.getProbeId()); - em.remove(probe); - } - - /** - * Persist a new LProbe object in the database using the LProbeValidator. - * - * @param probe The new LProbe object. - * - * @throws EntityExistsException - * @throws IllegalArgumentException - * @throws TransactionRequiredException - */ - @TransactionAttribute(TransactionAttributeType.REQUIRED) - public void create(LProbe probe) - throws EntityExistsException, - IllegalArgumentException, - EJBTransactionRolledbackException, - TransactionRequiredException { - em.persist(probe); - } - - /** - * Updates a LProbe object in the database. - * - * @param probe The new LProbe object. - * - * @throws EntityExistsException - * @throws IllegalArgumentException - * @throws TransactionRequiredException - */ - @TransactionAttribute(TransactionAttributeType.REQUIRED) - public void update(LProbe probe) - throws EntityExistsException, - IllegalArgumentException, - EJBTransactionRolledbackException, - TransactionRequiredException { - em.merge(probe); - } -} diff -r 8bf3054109ba -r 8d88224f8ffc src/main/java/de/intevation/lada/manage/LStatusManager.java --- a/src/main/java/de/intevation/lada/manage/LStatusManager.java Mon Jun 24 14:12:06 2013 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,72 +0,0 @@ -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.LStatus; - -/** - * This Manager provides databse operations for LStatus objects. - * - * @author Raimund Renkert - */ -@Stateless -public class LStatusManager -{ - @Inject - private EntityManager em; - - /** - * Delete a LProbe object by id. - * - * @param id - * @throws Exception - */ - @TransactionAttribute(TransactionAttributeType.REQUIRED) - public void delete(String id) throws Exception { - LStatus messwert = em.find(LStatus.class, id); - em.remove(messwert); - } - - /** - * Persist a new LMesswert object in the database. - * - * @param messwert The new LMesswert object. - * - * @throws EntityExistsException - * @throws IllegalArgumentException - * @throws TransactionRequiredException - */ - @TransactionAttribute(TransactionAttributeType.REQUIRED) - public void create(LStatus status) - throws EntityExistsException, - IllegalArgumentException, - EJBTransactionRolledbackException, - TransactionRequiredException { - em.persist(status); - } - - /** - * Updates a LMesswert object in the database. - * - * @param messwert The new LMesswert object. - * - * @throws EntityExistsException - * @throws IllegalArgumentException - * @throws TransactionRequiredException - */ - @TransactionAttribute(TransactionAttributeType.REQUIRED) - public void update(LStatus status) - throws EntityExistsException, - IllegalArgumentException, - EJBTransactionRolledbackException, - TransactionRequiredException { - em.merge(status); - } -} diff -r 8bf3054109ba -r 8d88224f8ffc src/main/java/de/intevation/lada/manage/LZusatzwertManager.java --- a/src/main/java/de/intevation/lada/manage/LZusatzwertManager.java Mon Jun 24 14:12:06 2013 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,66 +0,0 @@ -package de.intevation.lada.manage; - -import javax.ejb.EJBTransactionRolledbackException; -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.LZusatzWert; - - -public class LZusatzwertManager -{ - @Inject - private EntityManager em; - - /** - * Delete a LProbe object by id. - * - * @param id - * @throws Exception - */ - @TransactionAttribute(TransactionAttributeType.REQUIRED) - public void delete(String id) throws Exception { - LZusatzWert zusatzwert = em.find(LZusatzWert.class, id); - em.remove(zusatzwert); - } - - /** - * Persist a new LProbe object in the database using the LProbeValidator. - * - * @param probe The new LProbe object. - * - * @throws EntityExistsException - * @throws IllegalArgumentException - * @throws TransactionRequiredException - */ - @TransactionAttribute(TransactionAttributeType.REQUIRED) - public void create(LZusatzWert zusatzwert) - throws EntityExistsException, - IllegalArgumentException, - EJBTransactionRolledbackException, - TransactionRequiredException { - em.persist(zusatzwert); - } - - /** - * Updates a LProbe object in the database. - * - * @param probe The new LProbe object. - * - * @throws EntityExistsException - * @throws IllegalArgumentException - * @throws TransactionRequiredException - */ - @TransactionAttribute(TransactionAttributeType.REQUIRED) - public void update(LZusatzWert zusatzwert) - throws EntityExistsException, - IllegalArgumentException, - EJBTransactionRolledbackException, - TransactionRequiredException { - em.merge(zusatzwert); - } -}