[Dive4elements-commits] [PATCH] Backend: Re-inserted OfficialLine.fetchAllOfficalLines()

Wald Commits scm-commit at wald.intevation.org
Mon Jun 24 13:24:00 CEST 2013


# HG changeset patch
# User Sascha L. Teichmann <teichmann at intevation.de>
# Date 1372073021 -7200
# Node ID efadb301549e285811fab1430425764b3b5f53bd
# Parent  3158f8f227bf3b6497ed709f4b5fc31bd2a077e2
Backend: Re-inserted OfficialLine.fetchAllOfficalLines()

diff -r 3158f8f227bf -r efadb301549e backend/src/main/java/org/dive4elements/river/model/OfficialLine.java
--- a/backend/src/main/java/org/dive4elements/river/model/OfficialLine.java	Mon Jun 24 11:06:08 2013 +0200
+++ b/backend/src/main/java/org/dive4elements/river/model/OfficialLine.java	Mon Jun 24 13:23:41 2013 +0200
@@ -9,6 +9,7 @@
 package org.dive4elements.river.model;
 
 import java.io.Serializable;
+import java.util.List;
 
 import javax.persistence.Column;
 import javax.persistence.Entity;
@@ -20,6 +21,9 @@
 import javax.persistence.SequenceGenerator;
 import javax.persistence.Table;
 
+import org.dive4elements.river.backend.SessionHolder;
+import org.hibernate.Session;
+
 @Entity
 @Table(name = "official_lines")
 public class OfficialLine
@@ -74,5 +78,10 @@
     public void setNamedMainValue(NamedMainValue namedMainValue) {
         this.namedMainValue = namedMainValue;
     }
+
+    public static List<OfficialLine> fetchAllOfficalLines() {
+        Session session = SessionHolder.HOLDER.get();
+        return session.createQuery("select from OfficialLine").list();
+    }
 }
 // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 :


More information about the Dive4elements-commits mailing list