# HG changeset patch # User Sascha L. Teichmann # Date 1310943566 0 # Node ID 979ff070e36846b85025f33aac0cdd5d1c301c22 # Parent 3c860d3e79d9a8bfb2bc8d50678c5a7948aecd55 Store HYK data structures to database. Needs testing. flys-backend/trunk@2347 c6561f87-3c4e-4783-a992-168aeb5c3f6f diff -r 3c860d3e79d9 -r 979ff070e368 flys-backend/ChangeLog --- 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 + + * 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 * src/main/java/de/intevation/flys/importer/ImportRiver.java: diff -r 3c860d3e79d9 -r 979ff070e368 flys-backend/src/main/java/de/intevation/flys/importer/ImportHYK.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(); diff -r 3c860d3e79d9 -r 979ff070e368 flys-backend/src/main/java/de/intevation/flys/importer/ImportHYKEntry.java --- 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(); diff -r 3c860d3e79d9 -r 979ff070e368 flys-backend/src/main/java/de/intevation/flys/importer/ImportHYKFlowZone.java --- 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(); diff -r 3c860d3e79d9 -r 979ff070e368 flys-backend/src/main/java/de/intevation/flys/importer/ImportHYKFormation.java --- 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(); diff -r 3c860d3e79d9 -r 979ff070e368 flys-backend/src/main/java/de/intevation/flys/importer/ImportRiver.java --- 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) {