changeset 6408:efadb301549e

Backend: Re-inserted OfficialLine.fetchAllOfficalLines()
author Sascha L. Teichmann <teichmann@intevation.de>
date Mon, 24 Jun 2013 13:23:41 +0200
parents 3158f8f227bf
children 19066b1220b5
files backend/src/main/java/org/dive4elements/river/model/OfficialLine.java
diffstat 1 files changed, 9 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- 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 :

http://dive4elements.wald.intevation.org