diff backend/src/main/java/org/dive4elements/river/importer/ImportSedimentLoadLS.java @ 8032:fd3a24336e6a

SCHEMA CHANGE and Importer (only longitudinal section data so far): only grain fractions given now in schema are valid. We are handling sediment loads, not yields.
author "Tom Gottfried <tom@intevation.de>"
date Mon, 14 Jul 2014 15:36:44 +0200
parents 6954ac9b7591
children d86cc6a17b7a
line wrap: on
line diff
--- a/backend/src/main/java/org/dive4elements/river/importer/ImportSedimentLoadLS.java	Fri Jul 11 13:10:05 2014 +0200
+++ b/backend/src/main/java/org/dive4elements/river/importer/ImportSedimentLoadLS.java	Mon Jul 14 15:36:44 2014 +0200
@@ -83,7 +83,7 @@
                 i++;
             }
 
-            log.info("stored " + i + " sediment yield values.");
+            log.info("stored " + i + " sediment load values.");
         }
     }
 
@@ -98,14 +98,14 @@
         TimeInterval ti = timeInterval != null ? timeInterval.getPeer() : null;
 
         if (ti == null || u == null) {
-            log.warn("Skip invalid SedimentYield: time interval or unit null!");
+            log.warn("Skip invalid SedimentLoadLS: time interval or unit null!");
             return null;
         }
 
         if (peer == null) {
             Session session = ImporterSession.getInstance()
                 .getDatabaseSession();
-            Query query = session.createQuery("from SedimentYield where "
+            Query query = session.createQuery("from SedimentLoadLS where "
                 + "   river=:river and "
                 + "   grainFraction=:grainFraction and " + "   unit=:unit and "
                 + "   timeInterval=:timeInterval and "
@@ -117,16 +117,16 @@
             query.setParameter("timeInterval", ti);
             query.setParameter("description", description);
 
-            List<SedimentLoadLS> yields = query.list();
-            if (yields.isEmpty()) {
-                log.debug("create new SedimentYield");
+            List<SedimentLoadLS> loads = query.list();
+            if (loads.isEmpty()) {
+                log.debug("create new SedimentLoadLS");
 
                 peer = new SedimentLoadLS(river, u, ti, gf, description);
                 peer.setKind(this.kind);
                 session.save(peer);
             }
             else {
-                peer = yields.get(0);
+                peer = loads.get(0);
             }
         }
 

http://dive4elements.wald.intevation.org