changeset 1221:979ff070e368

Store HYK data structures to database. Needs testing. flys-backend/trunk@2347 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author Sascha L. Teichmann <sascha.teichmann@intevation.de>
date Sun, 17 Jul 2011 22:59:26 +0000
parents 3c860d3e79d9
children 1f21f162bcf3
files flys-backend/ChangeLog flys-backend/src/main/java/de/intevation/flys/importer/ImportHYK.java flys-backend/src/main/java/de/intevation/flys/importer/ImportHYKEntry.java flys-backend/src/main/java/de/intevation/flys/importer/ImportHYKFlowZone.java flys-backend/src/main/java/de/intevation/flys/importer/ImportHYKFormation.java flys-backend/src/main/java/de/intevation/flys/importer/ImportRiver.java
diffstat 6 files changed, 43 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/flys-backend/ChangeLog	Sun Jul 17 22:45:00 2011 +0000
+++ b/flys-backend/ChangeLog	Sun Jul 17 22:59:26 2011 +0000
@@ -1,3 +1,12 @@
+2011-07-18	Sascha L. Teichmann	<sascha.teichmann@intevation.de>
+
+	* src/main/java/de/intevation/flys/importer/ImportHYKFormation.java,
+	  src/main/java/de/intevation/flys/importer/ImportHYKFlowZone.java,
+	  src/main/java/de/intevation/flys/importer/ImportHYKEntry.java,
+	  src/main/java/de/intevation/flys/importer/ImportRiver.java,
+	  src/main/java/de/intevation/flys/importer/ImportHYK.java:
+	  Store HYK data structures to database. Needs testing.
+
 2011-07-18	Sascha L. Teichmann	<sascha.teichmann@intevation.de>
 
 	* src/main/java/de/intevation/flys/importer/ImportRiver.java:
--- a/flys-backend/src/main/java/de/intevation/flys/importer/ImportHYK.java	Sun Jul 17 22:45:00 2011 +0000
+++ b/flys-backend/src/main/java/de/intevation/flys/importer/ImportHYK.java	Sun Jul 17 22:59:26 2011 +0000
@@ -41,6 +41,13 @@
         entry.setHYK(this);
     }
 
+    public void storeDependencies() {
+        getPeer();
+        for (ImportHYKEntry entry: entries) {
+            entry.storeDependencies();
+        }
+    }
+
     public HYK getPeer() {
         if (peer == null) {
             River r = river.getPeer();
--- a/flys-backend/src/main/java/de/intevation/flys/importer/ImportHYKEntry.java	Sun Jul 17 22:45:00 2011 +0000
+++ b/flys-backend/src/main/java/de/intevation/flys/importer/ImportHYKEntry.java	Sun Jul 17 22:59:26 2011 +0000
@@ -51,6 +51,13 @@
         formation.setEntry(this);
     }
 
+    public void storeDependencies() {
+        getPeer();
+        for (ImportHYKFormation formation: formations) {
+            formation.storeDependencies();
+        }
+    }
+
     public HYKEntry getPeer() {
         if (peer == null) {
             HYK h = hyk.getPeer();
--- a/flys-backend/src/main/java/de/intevation/flys/importer/ImportHYKFlowZone.java	Sun Jul 17 22:45:00 2011 +0000
+++ b/flys-backend/src/main/java/de/intevation/flys/importer/ImportHYKFlowZone.java	Sun Jul 17 22:59:26 2011 +0000
@@ -43,6 +43,10 @@
         this.formation = formation;
     }
 
+    public void storeDependencies() {
+        getPeer();
+    }
+
     public HYKFlowZone getPeer() {
         if (peer == null) {
             HYKFormation    f = formation.getPeer();
--- a/flys-backend/src/main/java/de/intevation/flys/importer/ImportHYKFormation.java	Sun Jul 17 22:45:00 2011 +0000
+++ b/flys-backend/src/main/java/de/intevation/flys/importer/ImportHYKFormation.java	Sun Jul 17 22:59:26 2011 +0000
@@ -93,6 +93,13 @@
         this.distanceVR = distanceVR;
     }
 
+    public void storeDependencies() {
+        getPeer();
+        for (ImportHYKFlowZone zone: zones) {
+            zone.storeDependencies();
+        }
+    }
+
     public HYKFormation getPeer() {
         if (peer == null) {
             HYKEntry e = entry.getPeer();
--- a/flys-backend/src/main/java/de/intevation/flys/importer/ImportRiver.java	Sun Jul 17 22:45:00 2011 +0000
+++ b/flys-backend/src/main/java/de/intevation/flys/importer/ImportRiver.java	Sun Jul 17 22:59:26 2011 +0000
@@ -457,6 +457,7 @@
 
     public void storeDependencies() {
         storeAnnotations();
+        storeHYKs();
         storeCrossSections();
         storeGauges();
         storeWst();
@@ -467,6 +468,14 @@
         storeFloodProtection();
     }
 
+    public void storeHYKs() {
+        log.info("store HYKs");
+        getPeer();
+        for (ImportHYK hyk: hyks) {
+            hyk.storeDependencies();
+        }
+    }
+
     public void storeCrossSections() {
         log.info("store cross sections");
         for (ImportCrossSection crossSection: crossSections) {

http://dive4elements.wald.intevation.org