[Lada-commits] [PATCH 2 of 2] merged

Wald Commits scm-commit at wald.intevation.org
Thu Oct 27 11:50:12 CEST 2016


# HG changeset patch
# User Raimund Renkert <raimund.renkert at intevation.de>
# Date 1477561787 -7200
# Node ID 5bc1260b55f1cc58d2d3f9c005b31f3774c539ea
# Parent  de7184e1370dd5c9d934de67b2bb03a00001b47b
# Parent  2c198f13270ba5bf3efb9a86a7f77be509c23156
merged.

diff -r de7184e1370d -r 5bc1260b55f1 db_schema/lada_data.sql
--- a/db_schema/lada_data.sql	Thu Oct 27 11:48:53 2016 +0200
+++ b/db_schema/lada_data.sql	Thu Oct 27 11:49:47 2016 +0200
@@ -90,6 +90,10 @@
 
 ALTER TABLE probe ENABLE TRIGGER ALL;
 
+SELECT setval(pg_get_serial_sequence('probe', 'id'),
+    (SELECT max(id) FROM probe));
+
+
 --
 -- TOC entry 4687 (class 0 OID 1170823)
 -- Dependencies: 289
@@ -186,6 +190,10 @@
 
 ALTER TABLE messung ENABLE TRIGGER ALL;
 
+SELECT setval(pg_get_serial_sequence('messung', 'id'),
+    (SELECT max(id) FROM messung));
+
+
 --
 -- TOC entry 4681 (class 0 OID 1170751)
 -- Dependencies: 283
@@ -202,6 +210,10 @@
 
 ALTER TABLE kommentar_m ENABLE TRIGGER ALL;
 
+SELECT setval(pg_get_serial_sequence('kommentar_m', 'id'),
+    (SELECT max(id) FROM kommentar_m));
+
+
 --
 -- TOC entry 4682 (class 0 OID 1170759)
 -- Dependencies: 284
@@ -226,6 +238,10 @@
 
 ALTER TABLE kommentar_p ENABLE TRIGGER ALL;
 
+SELECT setval(pg_get_serial_sequence('kommentar_p', 'id'),
+    (SELECT max(id) FROM kommentar_p));
+
+
 --
 -- TOC entry 4684 (class 0 OID 1170769)
 -- Dependencies: 286
@@ -801,6 +817,10 @@
 
 ALTER TABLE messwert ENABLE TRIGGER ALL;
 
+SELECT setval(pg_get_serial_sequence('messwert', 'id'),
+    (SELECT max(id) FROM messwert));
+
+
 --
 -- TOC entry 4691 (class 0 OID 1170844)
 -- Dependencies: 293
@@ -891,6 +911,10 @@
 
 ALTER TABLE ortszuordnung ENABLE TRIGGER ALL;
 
+SELECT setval(pg_get_serial_sequence('ortszuordnung', 'id'),
+    (SELECT max(id) FROM ortszuordnung));
+
+
 --
 -- TOC entry 4695 (class 0 OID 1170895)
 -- Dependencies: 297
@@ -987,6 +1011,10 @@
 
 ALTER TABLE status_protokoll ENABLE TRIGGER ALL;
 
+SELECT setval(pg_get_serial_sequence('status_protokoll', 'id'),
+    (SELECT max(id) FROM status_protokoll));
+
+
 --
 -- TOC entry 4696 (class 0 OID 1170904)
 -- Dependencies: 298
@@ -1004,6 +1032,9 @@
 
 ALTER TABLE zusatz_wert ENABLE TRIGGER ALL;
 
+SELECT setval(pg_get_serial_sequence('zusatz_wert', 'id'),
+    (SELECT max(id) FROM zusatz_wert));
+
 --
 -- PostgreSQL database dump complete
 --
diff -r de7184e1370d -r 5bc1260b55f1 src/main/java/de/intevation/lada/importer/laf/LafObjectListener.java
--- a/src/main/java/de/intevation/lada/importer/laf/LafObjectListener.java	Thu Oct 27 11:48:53 2016 +0200
+++ b/src/main/java/de/intevation/lada/importer/laf/LafObjectListener.java	Thu Oct 27 11:49:47 2016 +0200
@@ -86,9 +86,17 @@
         if (currentProbe != null) {
             data.addProbe(currentProbe);
             if (!currentErrors.isEmpty()) {
-                String identifier = currentProbe.getAttributes().get("PROBE_ID");
-                identifier = identifier == null ? currentProbe.getAttributes().get("PROBEN_NR") : null;
-                identifier = identifier == null ? currentProbe.getAttributes().get("HAUPTPROBEN_NR") : "not identified";
+                String identifier = currentProbe.getAttributes()
+                    .get("PROBE_ID");
+                identifier = identifier == null
+                    ? currentProbe.getAttributes().get("PROBEN_NR")
+                    : identifier;
+                identifier = identifier == null
+                    ? currentProbe.getAttributes().get("HAUPTPROBENNUMMER")
+                    : identifier;
+                identifier = identifier == null
+                    ? "not identified"
+                    : identifier;
                 System.out.println("exit: " + identifier);
                 errors.put(identifier, currentErrors);
             }
@@ -126,8 +134,12 @@
                 System.out.println("item: " + item.getKey());
             }
             String identifier = currentProbe.getAttributes().get("PROBE_ID");
-            identifier = identifier == null ? currentProbe.getAttributes().get("PROBEN_NR") : null;
-            identifier = identifier == null ? currentProbe.getAttributes().get("HAUPTPROBEN_NR") : null;
+            identifier = identifier == null
+                ? currentProbe.getAttributes().get("PROBEN_NR")
+                : identifier;
+            identifier = identifier == null
+                ? currentProbe.getAttributes().get("HAUPTPROBENNUMMER")
+                : identifier;
             identifier = identifier == null ? "not identified" : identifier;
             System.out.println("exit probe: " + identifier);
             errors.put(identifier, currentErrors);


More information about the Lada-commits mailing list