Mercurial > dive4elements > river
view backend/src/main/java/org/dive4elements/river/importer/uinfo/importitem/SalixSeriesImport.java @ 9661:9b8ba3b83a15
Importer (s/u-info) vegetation zones: new database column in vegetation_type table for german type name,
localized vegetation type names by querying the database instead of translating by resource property,
detecting and cancelling the import of a second vegetation zone file for a river,
detecting, logging, cancelling in case of wrong column titles,
detecting, logging and ignoring lines with missing (color) values,
comparing vegetation zone name and class with the database and logging+ignoring in case of inconsistencies,
starting the most elevated zone with 0 instead of -1 overflow days
author | mschaefer |
---|---|
date | Mon, 23 Mar 2020 16:38:12 +0100 |
parents | f0cad5212f49 |
children |
line wrap: on
line source
/* Copyright (C) 2017 by Bundesanstalt für Gewässerkunde * Software engineering by * Björnsen Beratende Ingenieure GmbH * Dr. Schumacher Ingenieurbüro für Wasser und Umwelt * * This file is Free Software under the GNU AGPL (>=v3) * and comes with ABSOLUTELY NO WARRANTY! Check out the * documentation coming with Dive4Elements River for details. */ package org.dive4elements.river.importer.uinfo.importitem; import java.util.List; import org.apache.log4j.Logger; import org.dive4elements.river.importer.common.AbstractSeriesImport; import org.dive4elements.river.model.River; import org.dive4elements.river.model.uinfo.Salix; import org.dive4elements.river.model.uinfo.SalixValue; import org.hibernate.Query; import org.hibernate.Session; /** * Imported salix data series of a river * * @author Matthias Schäfer * */ public class SalixSeriesImport extends AbstractSeriesImport<Salix, SalixValue, SalixKmLineImport> { /***** FIELDS *****/ private static Logger log = Logger.getLogger(SalixSeriesImport.class); private String evaluation_by; /***** CONSTRUCTORS *****/ public SalixSeriesImport(final String filename) { super(filename); } /***** METHODS *****/ public void setEvaluationBy(final String evaluation_by) { this.evaluation_by = evaluation_by; } @Override public Logger getLog() { return log; } @Override public List<Salix> querySeriesItem(final Session session, final River river, final boolean doQueryParent) { final Query query = session.createQuery("FROM Salix WHERE river=:river AND lower(filename)=:filename"); query.setParameter("river", river); query.setParameter("filename", this.filename.toLowerCase()); return query.list(); } @Override public Salix createSeriesItem(final River river) { return new Salix(river, this.filename, this.kmrange_info, this.notes, this.evaluation_by); } }