[PATCH 1 of 3] issue1393/backend: Add kind property to ImportSedimentYield and SedimentYield

Wald Commits scm-commit at wald.intevation.org
Wed Jul 31 11:03:52 CEST 2013


# HG changeset patch
# User Felix Wolfsteller <felix.wolfsteller at intevation.de>
# Date 1375261928 -7200
# Node ID 078d56dffc8c90cca4e4729db9eb2c1ab7c815fa
# Parent  df402b3e02810fe4a452380253c79de392eb6fee
issue1393/backend: Add kind property to ImportSedimentYield and SedimentYield.

diff -r df402b3e0281 -r 078d56dffc8c backend/src/main/java/org/dive4elements/river/importer/ImportSedimentYield.java
--- a/backend/src/main/java/org/dive4elements/river/importer/ImportSedimentYield.java	Wed Jul 31 11:10:11 2013 +0200
+++ b/backend/src/main/java/org/dive4elements/river/importer/ImportSedimentYield.java	Wed Jul 31 11:12:08 2013 +0200
@@ -35,6 +35,8 @@
 
     private String description;
 
+    private Integer kind;
+
     private List<ImportSedimentYieldValue> values;
 
     private SedimentYield peer;
@@ -56,6 +58,10 @@
         this.grainFraction = grainFraction;
     }
 
+    public void setKind(Integer kind) {
+        this.kind = kind;
+    }
+
     public void addValue(ImportSedimentYieldValue value) {
         this.values.add(value);
     }
@@ -116,6 +122,7 @@
                 log.debug("create new SedimentYield");
 
                 peer = new SedimentYield(river, u, ti, gf, description);
+                peer.setKind(this.kind);
                 session.save(peer);
             }
             else {
diff -r df402b3e0281 -r 078d56dffc8c backend/src/main/java/org/dive4elements/river/model/SedimentYield.java
--- a/backend/src/main/java/org/dive4elements/river/model/SedimentYield.java	Wed Jul 31 11:10:11 2013 +0200
+++ b/backend/src/main/java/org/dive4elements/river/model/SedimentYield.java	Wed Jul 31 11:12:08 2013 +0200
@@ -25,6 +25,7 @@
 import org.apache.log4j.Logger;
 
 
+/** SedimentYield of a certain Fraction with possibly many values. */
 @Entity
 @Table(name = "sediment_yield")
 public class SedimentYield
@@ -46,6 +47,8 @@
 
     private List<SedimentYieldValue> values;
 
+    private Integer kind;
+
 
     public SedimentYield() {
         this.values = new ArrayList<SedimentYieldValue>();
@@ -149,5 +152,15 @@
     public void setDescription(String description) {
         this.description = description;
     }
+
+    /** kind == 0: "normal", kind == 1: "official epoch". */
+    @Column(name = "kind")
+    public Integer getKind() {
+        return kind;
+    }
+
+    public void setKind(Integer newKind) {
+        this.kind = newKind;
+    }
 }
 // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 :


More information about the Dive4elements-commits mailing list