diff flys-backend/src/main/java/de/intevation/flys/model/Wst.java @ 2346:f834b411ca57

Added db table, model class and importer stuff for units. flys-backend/trunk@2877 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author Ingo Weinzierl <ingo.weinzierl@intevation.de>
date Tue, 04 Oct 2011 06:47:00 +0000
parents 9aa0eddc5221
children 0acf28a3d28a
line wrap: on
line diff
--- a/flys-backend/src/main/java/de/intevation/flys/model/Wst.java	Tue Oct 04 05:06:10 2011 +0000
+++ b/flys-backend/src/main/java/de/intevation/flys/model/Wst.java	Tue Oct 04 06:47:00 2011 +0000
@@ -34,6 +34,7 @@
     private River   river;
     private String  description;
     private Integer kind;
+    private Unit    unit;
 
     private List<WstColumn> columns;
 
@@ -41,13 +42,14 @@
     }
 
     public Wst(River river, String description) {
-        this(river, description, 0);
+        this(river, description, 0, null);
     }
 
-    public Wst(River river, String description, Integer kind) {
+    public Wst(River river, String description, Integer kind, Unit unit) {
         this.river       = river;
         this.description = description;
         this.kind        = kind;
+        this.unit        = unit;
     }
 
     @Id
@@ -105,6 +107,17 @@
         this.columns = columns;
     }
 
+
+    @OneToOne
+    @JoinColumn(name = "unit_id" )
+    public Unit getUnit() {
+        return unit;
+    }
+
+    public void setUnit(Unit unit) {
+        this.unit = unit;
+    }
+
     /**
      * Determines the min and max Q values of this WST. The min value is placed
      * in the first field of the resulting array - the max value is placed in

http://dive4elements.wald.intevation.org