changeset 40:0dd63fcc9581

Code cleanup.
author Raimund Renkert <rrenkert@intevation.de>
date Thu, 23 May 2013 15:29:43 +0200
parents e0a5477f657e
children a0f6d3934bce
files src/main/java/de/intevation/lada/data/LProbeRepository.java src/main/java/de/intevation/lada/rest/SUmweltRESTService.java src/main/java/de/intevation/lada/service/LProbeService.java src/main/java/de/intevation/lada/utils/Resources.java
diffstat 4 files changed, 3 insertions(+), 25 deletions(-) [+]
line wrap: on
line diff
--- a/src/main/java/de/intevation/lada/data/LProbeRepository.java	Thu May 23 15:29:13 2013 +0200
+++ b/src/main/java/de/intevation/lada/data/LProbeRepository.java	Thu May 23 15:29:43 2013 +0200
@@ -29,7 +29,6 @@
      * The entitymanager managing the data.
      */
     @Inject
-    @PersistenceContext(type=PersistenceContextType.EXTENDED)
     private EntityManager em;
 
     /**
--- a/src/main/java/de/intevation/lada/rest/SUmweltRESTService.java	Thu May 23 15:29:13 2013 +0200
+++ b/src/main/java/de/intevation/lada/rest/SUmweltRESTService.java	Thu May 23 15:29:43 2013 +0200
@@ -41,7 +41,7 @@
      */
     @GET
     @Produces("text/json")
-    public List<SUmwelt> listAllMembers() {
+    public List<SUmwelt> findAll() {
         final List<SUmwelt> result = repository.findAll();
         return result;
     }
--- a/src/main/java/de/intevation/lada/service/LProbeService.java	Thu May 23 15:29:13 2013 +0200
+++ b/src/main/java/de/intevation/lada/service/LProbeService.java	Thu May 23 15:29:43 2013 +0200
@@ -19,14 +19,10 @@
     @Inject
     private EntityManager em;
 
-//    @Inject
-//    private Event<Member> memberEventSrc;
-
     @TransactionAttribute(TransactionAttributeType.REQUIRED)
     public void delete(String id) throws Exception {
-    	LProbe probe = em.find(LProbe.class, id);
+        LProbe probe = em.find(LProbe.class, id);
         log.info("Deleting " + probe.getProbeId());
         em.remove(probe);
-        //memberEventSrc.fire(member);
     }
 }
\ No newline at end of file
--- a/src/main/java/de/intevation/lada/utils/Resources.java	Thu May 23 15:29:13 2013 +0200
+++ b/src/main/java/de/intevation/lada/utils/Resources.java	Thu May 23 15:29:43 2013 +0200
@@ -27,19 +27,9 @@
 
 /**
  * This class uses CDI to alias Java EE resources, such as the persistence context, to CDI beans
- * 
- * <p>
- * Example injection on a managed bean field:
- * </p>
- * 
- * <pre>
- * &#064;Inject
- * private EntityManager em;
- * </pre>
  */
 public class Resources {
-    // use @SuppressWarnings to tell IDE to ignore warnings about field not being referenced directly
-    @SuppressWarnings("unused")
+
     @Produces
     @PersistenceContext
     private EntityManager em;
@@ -48,11 +38,4 @@
     public Logger produceLog(InjectionPoint injectionPoint) {
         return Logger.getLogger(injectionPoint.getMember().getDeclaringClass().getName());
     }
-
-    @Produces
-    @RequestScoped
-    public FacesContext produceFacesContext() {
-        return FacesContext.getCurrentInstance();
-    }
-
 }
This site is hosted by Intevation GmbH (Datenschutzerklärung und Impressum | Privacy Policy and Imprint)