changeset 5828:dfb26b03b179

Moved directories to org.dive4elements.river
author Sascha L. Teichmann <teichmann@intevation.de>
date Thu, 25 Apr 2013 11:53:11 +0200
parents e308d4ecd35a
children 18619c1e7c2a
files flys-backend/src/main/java/de/intevation/flys/App.java flys-backend/src/main/java/de/intevation/flys/backend/Credentials.java flys-backend/src/main/java/de/intevation/flys/backend/FLYSCredentials.java flys-backend/src/main/java/de/intevation/flys/backend/SedDBCredentials.java flys-backend/src/main/java/de/intevation/flys/backend/SedDBSessionHolder.java flys-backend/src/main/java/de/intevation/flys/backend/SessionFactoryProvider.java flys-backend/src/main/java/de/intevation/flys/backend/SessionHolder.java flys-backend/src/main/java/de/intevation/flys/backend/SpatialInfo.java flys-backend/src/main/java/de/intevation/flys/importer/Config.java flys-backend/src/main/java/de/intevation/flys/importer/ImportAnnotation.java flys-backend/src/main/java/de/intevation/flys/importer/ImportAnnotationType.java flys-backend/src/main/java/de/intevation/flys/importer/ImportAttribute.java flys-backend/src/main/java/de/intevation/flys/importer/ImportBedHeight.java flys-backend/src/main/java/de/intevation/flys/importer/ImportBedHeightEpoch.java flys-backend/src/main/java/de/intevation/flys/importer/ImportBedHeightEpochValue.java flys-backend/src/main/java/de/intevation/flys/importer/ImportBedHeightSingle.java flys-backend/src/main/java/de/intevation/flys/importer/ImportBedHeightSingleValue.java flys-backend/src/main/java/de/intevation/flys/importer/ImportBedHeightType.java flys-backend/src/main/java/de/intevation/flys/importer/ImportBedHeightValue.java flys-backend/src/main/java/de/intevation/flys/importer/ImportCrossSection.java flys-backend/src/main/java/de/intevation/flys/importer/ImportCrossSectionLine.java flys-backend/src/main/java/de/intevation/flys/importer/ImportDepth.java flys-backend/src/main/java/de/intevation/flys/importer/ImportDischargeTable.java flys-backend/src/main/java/de/intevation/flys/importer/ImportDischargeTableValue.java flys-backend/src/main/java/de/intevation/flys/importer/ImportDischargeZone.java flys-backend/src/main/java/de/intevation/flys/importer/ImportEdge.java flys-backend/src/main/java/de/intevation/flys/importer/ImportElevationModel.java flys-backend/src/main/java/de/intevation/flys/importer/ImportFlowVelocityMeasurement.java flys-backend/src/main/java/de/intevation/flys/importer/ImportFlowVelocityMeasurementValue.java flys-backend/src/main/java/de/intevation/flys/importer/ImportFlowVelocityModel.java flys-backend/src/main/java/de/intevation/flys/importer/ImportFlowVelocityModelValue.java flys-backend/src/main/java/de/intevation/flys/importer/ImportGauge.java flys-backend/src/main/java/de/intevation/flys/importer/ImportGrainFraction.java 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/ImportHYKFlowZoneType.java flys-backend/src/main/java/de/intevation/flys/importer/ImportHYKFormation.java flys-backend/src/main/java/de/intevation/flys/importer/ImportLocationSystem.java flys-backend/src/main/java/de/intevation/flys/importer/ImportMainValue.java flys-backend/src/main/java/de/intevation/flys/importer/ImportMainValueType.java flys-backend/src/main/java/de/intevation/flys/importer/ImportMeasurementStation.java flys-backend/src/main/java/de/intevation/flys/importer/ImportMorphWidth.java flys-backend/src/main/java/de/intevation/flys/importer/ImportMorphWidthValue.java flys-backend/src/main/java/de/intevation/flys/importer/ImportNamedMainValue.java flys-backend/src/main/java/de/intevation/flys/importer/ImportPosition.java flys-backend/src/main/java/de/intevation/flys/importer/ImportRange.java flys-backend/src/main/java/de/intevation/flys/importer/ImportRiver.java flys-backend/src/main/java/de/intevation/flys/importer/ImportSQRelation.java flys-backend/src/main/java/de/intevation/flys/importer/ImportSQRelationValue.java flys-backend/src/main/java/de/intevation/flys/importer/ImportSedimentDensity.java flys-backend/src/main/java/de/intevation/flys/importer/ImportSedimentDensityValue.java flys-backend/src/main/java/de/intevation/flys/importer/ImportSedimentYield.java flys-backend/src/main/java/de/intevation/flys/importer/ImportSedimentYieldValue.java flys-backend/src/main/java/de/intevation/flys/importer/ImportTimeInterval.java flys-backend/src/main/java/de/intevation/flys/importer/ImportUnit.java flys-backend/src/main/java/de/intevation/flys/importer/ImportWst.java flys-backend/src/main/java/de/intevation/flys/importer/ImportWstColumn.java flys-backend/src/main/java/de/intevation/flys/importer/ImportWstColumnQRange.java flys-backend/src/main/java/de/intevation/flys/importer/ImportWstColumnValue.java flys-backend/src/main/java/de/intevation/flys/importer/ImportWstQRange.java flys-backend/src/main/java/de/intevation/flys/importer/Importer.java flys-backend/src/main/java/de/intevation/flys/importer/ImporterSession.java flys-backend/src/main/java/de/intevation/flys/importer/ValueKey.java flys-backend/src/main/java/de/intevation/flys/importer/XY.java flys-backend/src/main/java/de/intevation/flys/importer/parsers/AnnotationClassifier.java flys-backend/src/main/java/de/intevation/flys/importer/parsers/AnnotationsParser.java flys-backend/src/main/java/de/intevation/flys/importer/parsers/AtFileParser.java flys-backend/src/main/java/de/intevation/flys/importer/parsers/BedHeightEpochParser.java flys-backend/src/main/java/de/intevation/flys/importer/parsers/BedHeightParser.java flys-backend/src/main/java/de/intevation/flys/importer/parsers/BedHeightSingleParser.java flys-backend/src/main/java/de/intevation/flys/importer/parsers/BundesWasserStrassenParser.java flys-backend/src/main/java/de/intevation/flys/importer/parsers/CrossSectionParser.java flys-backend/src/main/java/de/intevation/flys/importer/parsers/DA50Parser.java flys-backend/src/main/java/de/intevation/flys/importer/parsers/DA66Parser.java flys-backend/src/main/java/de/intevation/flys/importer/parsers/FlowVelocityMeasurementParser.java flys-backend/src/main/java/de/intevation/flys/importer/parsers/FlowVelocityModelParser.java flys-backend/src/main/java/de/intevation/flys/importer/parsers/HYKParser.java flys-backend/src/main/java/de/intevation/flys/importer/parsers/InfoGewParser.java flys-backend/src/main/java/de/intevation/flys/importer/parsers/LineParser.java flys-backend/src/main/java/de/intevation/flys/importer/parsers/MeasurementStationsParser.java flys-backend/src/main/java/de/intevation/flys/importer/parsers/MorphologicalWidthParser.java flys-backend/src/main/java/de/intevation/flys/importer/parsers/PRFParser.java flys-backend/src/main/java/de/intevation/flys/importer/parsers/PegelGltParser.java flys-backend/src/main/java/de/intevation/flys/importer/parsers/SQRelationParser.java flys-backend/src/main/java/de/intevation/flys/importer/parsers/SedimentDensityParser.java flys-backend/src/main/java/de/intevation/flys/importer/parsers/SedimentYieldParser.java flys-backend/src/main/java/de/intevation/flys/importer/parsers/StaFileParser.java flys-backend/src/main/java/de/intevation/flys/importer/parsers/W80CSVParser.java flys-backend/src/main/java/de/intevation/flys/importer/parsers/W80Parser.java flys-backend/src/main/java/de/intevation/flys/importer/parsers/WaterlevelDifferencesParser.java flys-backend/src/main/java/de/intevation/flys/importer/parsers/WaterlevelParser.java flys-backend/src/main/java/de/intevation/flys/importer/parsers/WstParser.java flys-backend/src/main/java/de/intevation/flys/importer/parsers/tim/Coordinate.java flys-backend/src/main/java/de/intevation/flys/importer/parsers/tim/LexiComparator.java flys-backend/src/main/java/de/intevation/flys/importer/parsers/tim/Line.java flys-backend/src/main/java/de/intevation/flys/importer/parsers/tim/TIMParser.java flys-backend/src/main/java/de/intevation/flys/model/Annotation.java flys-backend/src/main/java/de/intevation/flys/model/AnnotationType.java flys-backend/src/main/java/de/intevation/flys/model/Attribute.java flys-backend/src/main/java/de/intevation/flys/model/AxisKind.java flys-backend/src/main/java/de/intevation/flys/model/BedHeightEpoch.java flys-backend/src/main/java/de/intevation/flys/model/BedHeightEpochValue.java flys-backend/src/main/java/de/intevation/flys/model/BedHeightSingle.java flys-backend/src/main/java/de/intevation/flys/model/BedHeightSingleValue.java flys-backend/src/main/java/de/intevation/flys/model/BedHeightType.java flys-backend/src/main/java/de/intevation/flys/model/BoundaryKind.java flys-backend/src/main/java/de/intevation/flys/model/Building.java flys-backend/src/main/java/de/intevation/flys/model/CrossSection.java flys-backend/src/main/java/de/intevation/flys/model/CrossSectionLine.java flys-backend/src/main/java/de/intevation/flys/model/CrossSectionPoint.java flys-backend/src/main/java/de/intevation/flys/model/CrossSectionTrack.java flys-backend/src/main/java/de/intevation/flys/model/CrossSectionTrackKind.java flys-backend/src/main/java/de/intevation/flys/model/DGM.java flys-backend/src/main/java/de/intevation/flys/model/Depth.java flys-backend/src/main/java/de/intevation/flys/model/DischargeTable.java flys-backend/src/main/java/de/intevation/flys/model/DischargeTableValue.java flys-backend/src/main/java/de/intevation/flys/model/DischargeZone.java flys-backend/src/main/java/de/intevation/flys/model/Edge.java flys-backend/src/main/java/de/intevation/flys/model/ElevationModel.java flys-backend/src/main/java/de/intevation/flys/model/FastAnnotations.java flys-backend/src/main/java/de/intevation/flys/model/FastCrossSectionLine.java flys-backend/src/main/java/de/intevation/flys/model/FedState.java flys-backend/src/main/java/de/intevation/flys/model/Fixpoint.java flys-backend/src/main/java/de/intevation/flys/model/Floodmaps.java flys-backend/src/main/java/de/intevation/flys/model/Floodmark.java flys-backend/src/main/java/de/intevation/flys/model/Floodplain.java flys-backend/src/main/java/de/intevation/flys/model/FloodplainKind.java flys-backend/src/main/java/de/intevation/flys/model/FlowVelocityMeasurement.java flys-backend/src/main/java/de/intevation/flys/model/FlowVelocityMeasurementValue.java flys-backend/src/main/java/de/intevation/flys/model/FlowVelocityModel.java flys-backend/src/main/java/de/intevation/flys/model/FlowVelocityModelValue.java flys-backend/src/main/java/de/intevation/flys/model/Gauge.java flys-backend/src/main/java/de/intevation/flys/model/GaugeLocation.java flys-backend/src/main/java/de/intevation/flys/model/GrainFraction.java flys-backend/src/main/java/de/intevation/flys/model/HWSKind.java flys-backend/src/main/java/de/intevation/flys/model/HWSLine.java flys-backend/src/main/java/de/intevation/flys/model/HWSPoint.java flys-backend/src/main/java/de/intevation/flys/model/HYK.java flys-backend/src/main/java/de/intevation/flys/model/HYKEntry.java flys-backend/src/main/java/de/intevation/flys/model/HYKFlowZone.java flys-backend/src/main/java/de/intevation/flys/model/HYKFlowZoneType.java flys-backend/src/main/java/de/intevation/flys/model/HYKFormation.java flys-backend/src/main/java/de/intevation/flys/model/HydrBoundary.java flys-backend/src/main/java/de/intevation/flys/model/HydrBoundaryPoly.java flys-backend/src/main/java/de/intevation/flys/model/Jetty.java flys-backend/src/main/java/de/intevation/flys/model/LocationSystem.java flys-backend/src/main/java/de/intevation/flys/model/MainValue.java flys-backend/src/main/java/de/intevation/flys/model/MainValueType.java flys-backend/src/main/java/de/intevation/flys/model/MeasurementStation.java flys-backend/src/main/java/de/intevation/flys/model/MinMaxWQ.java flys-backend/src/main/java/de/intevation/flys/model/MorphologicalWidth.java flys-backend/src/main/java/de/intevation/flys/model/MorphologicalWidthValue.java flys-backend/src/main/java/de/intevation/flys/model/NamedMainValue.java flys-backend/src/main/java/de/intevation/flys/model/Position.java flys-backend/src/main/java/de/intevation/flys/model/Range.java flys-backend/src/main/java/de/intevation/flys/model/River.java flys-backend/src/main/java/de/intevation/flys/model/RiverAxis.java flys-backend/src/main/java/de/intevation/flys/model/RiverAxisKm.java flys-backend/src/main/java/de/intevation/flys/model/SQRelation.java flys-backend/src/main/java/de/intevation/flys/model/SQRelationValue.java flys-backend/src/main/java/de/intevation/flys/model/SectieKind.java flys-backend/src/main/java/de/intevation/flys/model/SedimentDensity.java flys-backend/src/main/java/de/intevation/flys/model/SedimentDensityValue.java flys-backend/src/main/java/de/intevation/flys/model/SedimentYield.java flys-backend/src/main/java/de/intevation/flys/model/SedimentYieldValue.java flys-backend/src/main/java/de/intevation/flys/model/SobekKind.java flys-backend/src/main/java/de/intevation/flys/model/TimeInterval.java flys-backend/src/main/java/de/intevation/flys/model/Unit.java flys-backend/src/main/java/de/intevation/flys/model/Wst.java flys-backend/src/main/java/de/intevation/flys/model/WstColumn.java flys-backend/src/main/java/de/intevation/flys/model/WstColumnQRange.java flys-backend/src/main/java/de/intevation/flys/model/WstColumnValue.java flys-backend/src/main/java/de/intevation/flys/model/WstQRange.java flys-backend/src/main/java/de/intevation/flys/utils/DBCPConnectionProvider.java flys-backend/src/main/java/de/intevation/flys/utils/DateGuesser.java flys-backend/src/main/java/de/intevation/flys/utils/EpsilonComparator.java flys-backend/src/main/java/de/intevation/flys/utils/StringUtil.java flys-backend/src/main/java/org/dive4elements/river/App.java flys-backend/src/main/java/org/dive4elements/river/backend/Credentials.java flys-backend/src/main/java/org/dive4elements/river/backend/FLYSCredentials.java flys-backend/src/main/java/org/dive4elements/river/backend/SedDBCredentials.java flys-backend/src/main/java/org/dive4elements/river/backend/SedDBSessionHolder.java flys-backend/src/main/java/org/dive4elements/river/backend/SessionFactoryProvider.java flys-backend/src/main/java/org/dive4elements/river/backend/SessionHolder.java flys-backend/src/main/java/org/dive4elements/river/backend/SpatialInfo.java flys-backend/src/main/java/org/dive4elements/river/importer/Config.java flys-backend/src/main/java/org/dive4elements/river/importer/ImportAnnotation.java flys-backend/src/main/java/org/dive4elements/river/importer/ImportAnnotationType.java flys-backend/src/main/java/org/dive4elements/river/importer/ImportAttribute.java flys-backend/src/main/java/org/dive4elements/river/importer/ImportBedHeight.java flys-backend/src/main/java/org/dive4elements/river/importer/ImportBedHeightEpoch.java flys-backend/src/main/java/org/dive4elements/river/importer/ImportBedHeightEpochValue.java flys-backend/src/main/java/org/dive4elements/river/importer/ImportBedHeightSingle.java flys-backend/src/main/java/org/dive4elements/river/importer/ImportBedHeightSingleValue.java flys-backend/src/main/java/org/dive4elements/river/importer/ImportBedHeightType.java flys-backend/src/main/java/org/dive4elements/river/importer/ImportBedHeightValue.java flys-backend/src/main/java/org/dive4elements/river/importer/ImportCrossSection.java flys-backend/src/main/java/org/dive4elements/river/importer/ImportCrossSectionLine.java flys-backend/src/main/java/org/dive4elements/river/importer/ImportDepth.java flys-backend/src/main/java/org/dive4elements/river/importer/ImportDischargeTable.java flys-backend/src/main/java/org/dive4elements/river/importer/ImportDischargeTableValue.java flys-backend/src/main/java/org/dive4elements/river/importer/ImportDischargeZone.java flys-backend/src/main/java/org/dive4elements/river/importer/ImportEdge.java flys-backend/src/main/java/org/dive4elements/river/importer/ImportElevationModel.java flys-backend/src/main/java/org/dive4elements/river/importer/ImportFlowVelocityMeasurement.java flys-backend/src/main/java/org/dive4elements/river/importer/ImportFlowVelocityMeasurementValue.java flys-backend/src/main/java/org/dive4elements/river/importer/ImportFlowVelocityModel.java flys-backend/src/main/java/org/dive4elements/river/importer/ImportFlowVelocityModelValue.java flys-backend/src/main/java/org/dive4elements/river/importer/ImportGauge.java flys-backend/src/main/java/org/dive4elements/river/importer/ImportGrainFraction.java flys-backend/src/main/java/org/dive4elements/river/importer/ImportHYK.java flys-backend/src/main/java/org/dive4elements/river/importer/ImportHYKEntry.java flys-backend/src/main/java/org/dive4elements/river/importer/ImportHYKFlowZone.java flys-backend/src/main/java/org/dive4elements/river/importer/ImportHYKFlowZoneType.java flys-backend/src/main/java/org/dive4elements/river/importer/ImportHYKFormation.java flys-backend/src/main/java/org/dive4elements/river/importer/ImportLocationSystem.java flys-backend/src/main/java/org/dive4elements/river/importer/ImportMainValue.java flys-backend/src/main/java/org/dive4elements/river/importer/ImportMainValueType.java flys-backend/src/main/java/org/dive4elements/river/importer/ImportMeasurementStation.java flys-backend/src/main/java/org/dive4elements/river/importer/ImportMorphWidth.java flys-backend/src/main/java/org/dive4elements/river/importer/ImportMorphWidthValue.java flys-backend/src/main/java/org/dive4elements/river/importer/ImportNamedMainValue.java flys-backend/src/main/java/org/dive4elements/river/importer/ImportPosition.java flys-backend/src/main/java/org/dive4elements/river/importer/ImportRange.java flys-backend/src/main/java/org/dive4elements/river/importer/ImportRiver.java flys-backend/src/main/java/org/dive4elements/river/importer/ImportSQRelation.java flys-backend/src/main/java/org/dive4elements/river/importer/ImportSQRelationValue.java flys-backend/src/main/java/org/dive4elements/river/importer/ImportSedimentDensity.java flys-backend/src/main/java/org/dive4elements/river/importer/ImportSedimentDensityValue.java flys-backend/src/main/java/org/dive4elements/river/importer/ImportSedimentYield.java flys-backend/src/main/java/org/dive4elements/river/importer/ImportSedimentYieldValue.java flys-backend/src/main/java/org/dive4elements/river/importer/ImportTimeInterval.java flys-backend/src/main/java/org/dive4elements/river/importer/ImportUnit.java flys-backend/src/main/java/org/dive4elements/river/importer/ImportWst.java flys-backend/src/main/java/org/dive4elements/river/importer/ImportWstColumn.java flys-backend/src/main/java/org/dive4elements/river/importer/ImportWstColumnQRange.java flys-backend/src/main/java/org/dive4elements/river/importer/ImportWstColumnValue.java flys-backend/src/main/java/org/dive4elements/river/importer/ImportWstQRange.java flys-backend/src/main/java/org/dive4elements/river/importer/Importer.java flys-backend/src/main/java/org/dive4elements/river/importer/ImporterSession.java flys-backend/src/main/java/org/dive4elements/river/importer/ValueKey.java flys-backend/src/main/java/org/dive4elements/river/importer/XY.java flys-backend/src/main/java/org/dive4elements/river/importer/parsers/AnnotationClassifier.java flys-backend/src/main/java/org/dive4elements/river/importer/parsers/AnnotationsParser.java flys-backend/src/main/java/org/dive4elements/river/importer/parsers/AtFileParser.java flys-backend/src/main/java/org/dive4elements/river/importer/parsers/BedHeightEpochParser.java flys-backend/src/main/java/org/dive4elements/river/importer/parsers/BedHeightParser.java flys-backend/src/main/java/org/dive4elements/river/importer/parsers/BedHeightSingleParser.java flys-backend/src/main/java/org/dive4elements/river/importer/parsers/BundesWasserStrassenParser.java flys-backend/src/main/java/org/dive4elements/river/importer/parsers/CrossSectionParser.java flys-backend/src/main/java/org/dive4elements/river/importer/parsers/DA50Parser.java flys-backend/src/main/java/org/dive4elements/river/importer/parsers/DA66Parser.java flys-backend/src/main/java/org/dive4elements/river/importer/parsers/FlowVelocityMeasurementParser.java flys-backend/src/main/java/org/dive4elements/river/importer/parsers/FlowVelocityModelParser.java flys-backend/src/main/java/org/dive4elements/river/importer/parsers/HYKParser.java flys-backend/src/main/java/org/dive4elements/river/importer/parsers/InfoGewParser.java flys-backend/src/main/java/org/dive4elements/river/importer/parsers/LineParser.java flys-backend/src/main/java/org/dive4elements/river/importer/parsers/MeasurementStationsParser.java flys-backend/src/main/java/org/dive4elements/river/importer/parsers/MorphologicalWidthParser.java flys-backend/src/main/java/org/dive4elements/river/importer/parsers/PRFParser.java flys-backend/src/main/java/org/dive4elements/river/importer/parsers/PegelGltParser.java flys-backend/src/main/java/org/dive4elements/river/importer/parsers/SQRelationParser.java flys-backend/src/main/java/org/dive4elements/river/importer/parsers/SedimentDensityParser.java flys-backend/src/main/java/org/dive4elements/river/importer/parsers/SedimentYieldParser.java flys-backend/src/main/java/org/dive4elements/river/importer/parsers/StaFileParser.java flys-backend/src/main/java/org/dive4elements/river/importer/parsers/W80CSVParser.java flys-backend/src/main/java/org/dive4elements/river/importer/parsers/W80Parser.java flys-backend/src/main/java/org/dive4elements/river/importer/parsers/WaterlevelDifferencesParser.java flys-backend/src/main/java/org/dive4elements/river/importer/parsers/WaterlevelParser.java flys-backend/src/main/java/org/dive4elements/river/importer/parsers/WstParser.java flys-backend/src/main/java/org/dive4elements/river/importer/parsers/tim/Coordinate.java flys-backend/src/main/java/org/dive4elements/river/importer/parsers/tim/LexiComparator.java flys-backend/src/main/java/org/dive4elements/river/importer/parsers/tim/Line.java flys-backend/src/main/java/org/dive4elements/river/importer/parsers/tim/TIMParser.java flys-backend/src/main/java/org/dive4elements/river/model/Annotation.java flys-backend/src/main/java/org/dive4elements/river/model/AnnotationType.java flys-backend/src/main/java/org/dive4elements/river/model/Attribute.java flys-backend/src/main/java/org/dive4elements/river/model/AxisKind.java flys-backend/src/main/java/org/dive4elements/river/model/BedHeightEpoch.java flys-backend/src/main/java/org/dive4elements/river/model/BedHeightEpochValue.java flys-backend/src/main/java/org/dive4elements/river/model/BedHeightSingle.java flys-backend/src/main/java/org/dive4elements/river/model/BedHeightSingleValue.java flys-backend/src/main/java/org/dive4elements/river/model/BedHeightType.java flys-backend/src/main/java/org/dive4elements/river/model/BoundaryKind.java flys-backend/src/main/java/org/dive4elements/river/model/Building.java flys-backend/src/main/java/org/dive4elements/river/model/CrossSection.java flys-backend/src/main/java/org/dive4elements/river/model/CrossSectionLine.java flys-backend/src/main/java/org/dive4elements/river/model/CrossSectionPoint.java flys-backend/src/main/java/org/dive4elements/river/model/CrossSectionTrack.java flys-backend/src/main/java/org/dive4elements/river/model/CrossSectionTrackKind.java flys-backend/src/main/java/org/dive4elements/river/model/DGM.java flys-backend/src/main/java/org/dive4elements/river/model/Depth.java flys-backend/src/main/java/org/dive4elements/river/model/DischargeTable.java flys-backend/src/main/java/org/dive4elements/river/model/DischargeTableValue.java flys-backend/src/main/java/org/dive4elements/river/model/DischargeZone.java flys-backend/src/main/java/org/dive4elements/river/model/Edge.java flys-backend/src/main/java/org/dive4elements/river/model/ElevationModel.java flys-backend/src/main/java/org/dive4elements/river/model/FastAnnotations.java flys-backend/src/main/java/org/dive4elements/river/model/FastCrossSectionLine.java flys-backend/src/main/java/org/dive4elements/river/model/FedState.java flys-backend/src/main/java/org/dive4elements/river/model/Fixpoint.java flys-backend/src/main/java/org/dive4elements/river/model/Floodmaps.java flys-backend/src/main/java/org/dive4elements/river/model/Floodmark.java flys-backend/src/main/java/org/dive4elements/river/model/Floodplain.java flys-backend/src/main/java/org/dive4elements/river/model/FloodplainKind.java flys-backend/src/main/java/org/dive4elements/river/model/FlowVelocityMeasurement.java flys-backend/src/main/java/org/dive4elements/river/model/FlowVelocityMeasurementValue.java flys-backend/src/main/java/org/dive4elements/river/model/FlowVelocityModel.java flys-backend/src/main/java/org/dive4elements/river/model/FlowVelocityModelValue.java flys-backend/src/main/java/org/dive4elements/river/model/Gauge.java flys-backend/src/main/java/org/dive4elements/river/model/GaugeLocation.java flys-backend/src/main/java/org/dive4elements/river/model/GrainFraction.java flys-backend/src/main/java/org/dive4elements/river/model/HWSKind.java flys-backend/src/main/java/org/dive4elements/river/model/HWSLine.java flys-backend/src/main/java/org/dive4elements/river/model/HWSPoint.java flys-backend/src/main/java/org/dive4elements/river/model/HYK.java flys-backend/src/main/java/org/dive4elements/river/model/HYKEntry.java flys-backend/src/main/java/org/dive4elements/river/model/HYKFlowZone.java flys-backend/src/main/java/org/dive4elements/river/model/HYKFlowZoneType.java flys-backend/src/main/java/org/dive4elements/river/model/HYKFormation.java flys-backend/src/main/java/org/dive4elements/river/model/HydrBoundary.java flys-backend/src/main/java/org/dive4elements/river/model/HydrBoundaryPoly.java flys-backend/src/main/java/org/dive4elements/river/model/Jetty.java flys-backend/src/main/java/org/dive4elements/river/model/LocationSystem.java flys-backend/src/main/java/org/dive4elements/river/model/MainValue.java flys-backend/src/main/java/org/dive4elements/river/model/MainValueType.java flys-backend/src/main/java/org/dive4elements/river/model/MeasurementStation.java flys-backend/src/main/java/org/dive4elements/river/model/MinMaxWQ.java flys-backend/src/main/java/org/dive4elements/river/model/MorphologicalWidth.java flys-backend/src/main/java/org/dive4elements/river/model/MorphologicalWidthValue.java flys-backend/src/main/java/org/dive4elements/river/model/NamedMainValue.java flys-backend/src/main/java/org/dive4elements/river/model/Position.java flys-backend/src/main/java/org/dive4elements/river/model/Range.java flys-backend/src/main/java/org/dive4elements/river/model/River.java flys-backend/src/main/java/org/dive4elements/river/model/RiverAxis.java flys-backend/src/main/java/org/dive4elements/river/model/RiverAxisKm.java flys-backend/src/main/java/org/dive4elements/river/model/SQRelation.java flys-backend/src/main/java/org/dive4elements/river/model/SQRelationValue.java flys-backend/src/main/java/org/dive4elements/river/model/SectieKind.java flys-backend/src/main/java/org/dive4elements/river/model/SedimentDensity.java flys-backend/src/main/java/org/dive4elements/river/model/SedimentDensityValue.java flys-backend/src/main/java/org/dive4elements/river/model/SedimentYield.java flys-backend/src/main/java/org/dive4elements/river/model/SedimentYieldValue.java flys-backend/src/main/java/org/dive4elements/river/model/SobekKind.java flys-backend/src/main/java/org/dive4elements/river/model/TimeInterval.java flys-backend/src/main/java/org/dive4elements/river/model/Unit.java flys-backend/src/main/java/org/dive4elements/river/model/Wst.java flys-backend/src/main/java/org/dive4elements/river/model/WstColumn.java flys-backend/src/main/java/org/dive4elements/river/model/WstColumnQRange.java flys-backend/src/main/java/org/dive4elements/river/model/WstColumnValue.java flys-backend/src/main/java/org/dive4elements/river/model/WstQRange.java flys-backend/src/main/java/org/dive4elements/river/utils/DBCPConnectionProvider.java flys-backend/src/main/java/org/dive4elements/river/utils/DateGuesser.java flys-backend/src/main/java/org/dive4elements/river/utils/EpsilonComparator.java flys-backend/src/main/java/org/dive4elements/river/utils/StringUtil.java flys-backend/src/test/java/de/intevation/flys/AppTest.java flys-backend/src/test/java/org/dive4elements/river/AppTest.java
diffstat 358 files changed, 25643 insertions(+), 25643 deletions(-) [+]
line wrap: on
line diff
--- a/flys-backend/src/main/java/de/intevation/flys/App.java	Thu Apr 25 11:48:36 2013 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,30 +0,0 @@
-package de.intevation.flys;
-
-import de.intevation.flys.backend.SessionFactoryProvider;
-import de.intevation.flys.backend.FLYSCredentials;
-
-import org.hibernate.cfg.Configuration;
-
-import org.hibernate.dialect.resolver.DialectFactory;
-
-public class App
-{
-    public static void dumpSchema(Configuration cfg) {
-        System.out.println("BEGIN;");
-
-        String [] setupScript = cfg.generateSchemaCreationScript(
-            DialectFactory.constructDialect(
-                FLYSCredentials.getDefault().getDialect()));
-
-        for (String line: setupScript) {
-            System.out.println(line + ";");
-        }
-
-        System.out.println("COMMIT;");
-    }
-
-    public static void main(String [] args) {
-        dumpSchema(SessionFactoryProvider.createConfiguration());
-    }
-}
-// vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 :
--- a/flys-backend/src/main/java/de/intevation/flys/backend/Credentials.java	Thu Apr 25 11:48:36 2013 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,90 +0,0 @@
-package de.intevation.flys.backend;
-
-public abstract class Credentials
-{
-    protected String   user;
-    protected String   password;
-    protected String   dialect;
-    protected String   driver;
-    protected String   url;
-    protected String   connectionInitSqls;
-    protected Class [] classes;
-
-    public Credentials() {
-    }
-
-    public Credentials(
-        String   user,
-        String   password,
-        String   dialect,
-        String   driver,
-        String   url,
-        String   connectionInitSqls,
-        Class [] classes
-    ) {
-        this.user               = user;
-        this.password           = password;
-        this.dialect            = dialect;
-        this.driver             = driver;
-        this.url                = url;
-        this.connectionInitSqls = connectionInitSqls;
-        this.classes            = classes;
-    }
-
-    public String getUser() {
-        return user;
-    }
-
-    public void setUser(String user) {
-        this.user = user;
-    }
-
-    public String getPassword() {
-        return password;
-    }
-
-    public void setPassword(String password) {
-        this.password = password;
-    }
-
-    public String getDialect() {
-        return dialect;
-    }
-
-    public void setDialect(String dialect) {
-        this.dialect = dialect;
-    }
-
-    public String getDriver() {
-        return driver;
-    }
-
-    public void setDriver(String driver) {
-        this.driver = driver;
-    }
-
-    public String getUrl() {
-        return url;
-    }
-
-    public void setUrl(String url) {
-        this.url = url;
-    }
-
-    public String getConnectionInitSqls() {
-        return connectionInitSqls;
-    }
-
-    public void setConnectionInitSqls(String connectionInitSqls) {
-        this.connectionInitSqls = connectionInitSqls;
-    }
-
-    public Class [] getClasses() {
-        return classes;
-    }
-
-    public void setClasses(Class [] classes) {
-        this.classes = classes;
-    }
-}
-// vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 :
--- a/flys-backend/src/main/java/de/intevation/flys/backend/FLYSCredentials.java	Thu Apr 25 11:48:36 2013 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,253 +0,0 @@
-package de.intevation.flys.backend;
-
-import de.intevation.artifacts.common.utils.Config;
-
-import de.intevation.flys.model.Annotation;
-import de.intevation.flys.model.AnnotationType;
-import de.intevation.flys.model.Attribute;
-import de.intevation.flys.model.AxisKind;
-import de.intevation.flys.model.BedHeightEpoch;
-import de.intevation.flys.model.BedHeightEpochValue;
-import de.intevation.flys.model.BedHeightSingle;
-import de.intevation.flys.model.BedHeightSingleValue;
-import de.intevation.flys.model.BedHeightType;
-import de.intevation.flys.model.Building;
-import de.intevation.flys.model.BoundaryKind;
-import de.intevation.flys.model.CrossSection;
-import de.intevation.flys.model.CrossSectionLine;
-import de.intevation.flys.model.CrossSectionPoint;
-import de.intevation.flys.model.CrossSectionTrack;
-import de.intevation.flys.model.CrossSectionTrackKind;
-import de.intevation.flys.model.DGM;
-import de.intevation.flys.model.Depth;
-import de.intevation.flys.model.DischargeTable;
-import de.intevation.flys.model.DischargeTableValue;
-import de.intevation.flys.model.DischargeZone;
-import de.intevation.flys.model.Edge;
-import de.intevation.flys.model.ElevationModel;
-import de.intevation.flys.model.FedState;
-import de.intevation.flys.model.Fixpoint;
-import de.intevation.flys.model.Floodmaps;
-import de.intevation.flys.model.Floodmark;
-import de.intevation.flys.model.Floodplain;
-import de.intevation.flys.model.FloodplainKind;
-import de.intevation.flys.model.FlowVelocityMeasurement;
-import de.intevation.flys.model.FlowVelocityMeasurementValue;
-import de.intevation.flys.model.FlowVelocityModel;
-import de.intevation.flys.model.FlowVelocityModelValue;
-import de.intevation.flys.model.Gauge;
-import de.intevation.flys.model.GaugeLocation;
-import de.intevation.flys.model.GrainFraction;
-import de.intevation.flys.model.HWSKind;
-import de.intevation.flys.model.HWSLine;
-import de.intevation.flys.model.HWSPoint;
-import de.intevation.flys.model.HYK;
-import de.intevation.flys.model.HYKEntry;
-import de.intevation.flys.model.HYKFlowZone;
-import de.intevation.flys.model.HYKFlowZoneType;
-import de.intevation.flys.model.HYKFormation;
-import de.intevation.flys.model.HydrBoundary;
-import de.intevation.flys.model.HydrBoundaryPoly;
-import de.intevation.flys.model.Jetty;
-import de.intevation.flys.model.LocationSystem;
-import de.intevation.flys.model.MainValue;
-import de.intevation.flys.model.MainValueType;
-import de.intevation.flys.model.MeasurementStation;
-import de.intevation.flys.model.MorphologicalWidth;
-import de.intevation.flys.model.MorphologicalWidthValue;
-import de.intevation.flys.model.NamedMainValue;
-import de.intevation.flys.model.Position;
-import de.intevation.flys.model.Range;
-import de.intevation.flys.model.River;
-import de.intevation.flys.model.RiverAxis;
-import de.intevation.flys.model.RiverAxisKm;
-import de.intevation.flys.model.SQRelation;
-import de.intevation.flys.model.SQRelationValue;
-import de.intevation.flys.model.SectieKind;
-import de.intevation.flys.model.SobekKind;
-import de.intevation.flys.model.SedimentDensity;
-import de.intevation.flys.model.SedimentDensityValue;
-import de.intevation.flys.model.SedimentYield;
-import de.intevation.flys.model.SedimentYieldValue;
-import de.intevation.flys.model.TimeInterval;
-import de.intevation.flys.model.Unit;
-import de.intevation.flys.model.Wst;
-import de.intevation.flys.model.WstColumn;
-import de.intevation.flys.model.WstColumnQRange;
-import de.intevation.flys.model.WstColumnValue;
-import de.intevation.flys.model.WstQRange;
-
-public class FLYSCredentials
-extends      Credentials
-{
-    public static final String XPATH_USER =
-        "/artifact-database/backend-database/user/text()";
-
-    public static final String XPATH_PASSWORD =
-        "/artifact-database/backend-database/password/text()";
-
-    public static final String XPATH_DIALECT =
-        "/artifact-database/backend-database/dialect/text()";
-
-    public static final String XPATH_DRIVER =
-        "/artifact-database/backend-database/driver/text()";
-
-    public static final String XPATH_URL =
-        "/artifact-database/backend-database/url/text()";
-
-    public static final String XPATH_CONNECTION_INIT_SQLS =
-        "/artifact-database/backend-database/connection-init-sqls/text()";
-
-    public static final String DEFAULT_USER =
-        System.getProperty("flys.backend.user", "flys");
-
-    public static final String DEFAULT_PASSWORD =
-        System.getProperty("flys.backend.password", "flys");
-
-    public static final String DEFAULT_DIALECT =
-        System.getProperty(
-            "flys.backend.dialect",
-            "org.hibernate.dialect.PostgreSQLDialect");
-
-    public static final String DEFAULT_DRIVER =
-        System.getProperty(
-            "flys.backend.driver",
-            "org.postgresql.Driver");
-
-    public static final String DEFAULT_URL =
-        System.getProperty(
-            "flys.backend.url",
-            "jdbc:postgresql://localhost:5432/flys");
-
-    public static final String DEFAULT_CONNECTION_INIT_SQLS =
-        System.getProperty(
-            "flys.backend.connection.init.sqls");
-
-    public static final Class [] CLASSES = {
-        Annotation.class,
-        AnnotationType.class,
-        Attribute.class,
-        AxisKind.class,
-        BedHeightEpoch.class,
-        BedHeightEpochValue.class,
-        BedHeightSingle.class,
-        BedHeightSingleValue.class,
-        BedHeightType.class,
-        Building.class,
-        BoundaryKind.class,
-        CrossSection.class,
-        CrossSectionLine.class,
-        CrossSectionPoint.class,
-        CrossSectionTrack.class,
-        CrossSectionTrackKind.class,
-        Depth.class,
-        DGM.class,
-        DischargeTable.class,
-        DischargeTableValue.class,
-        DischargeZone.class,
-        Edge.class,
-        ElevationModel.class,
-        FedState.class,
-        Fixpoint.class,
-        Floodmark.class,
-        Floodplain.class,
-        FloodplainKind.class,
-        Floodmaps.class,
-        FlowVelocityMeasurement.class,
-        FlowVelocityMeasurementValue.class,
-        FlowVelocityModel.class,
-        FlowVelocityModelValue.class,
-        Gauge.class,
-        GaugeLocation.class,
-        GrainFraction.class,
-        HWSKind.class,
-        HWSLine.class,
-        HWSPoint.class,
-        HydrBoundary.class,
-        HydrBoundaryPoly.class,
-        HYK.class,
-        HYKEntry.class,
-        HYKFormation.class,
-        HYKFlowZoneType.class,
-        HYKFlowZone.class,
-        Jetty.class,
-        LocationSystem.class,
-        MainValueType.class,
-        MeasurementStation.class,
-        MorphologicalWidth.class,
-        MorphologicalWidthValue.class,
-        NamedMainValue.class,
-        MainValue.class,
-        Position.class,
-        Range.class,
-        River.class,
-        RiverAxis.class,
-        RiverAxisKm.class,
-        SectieKind.class,
-        SobekKind.class,
-        SedimentDensity.class,
-        SedimentDensityValue.class,
-        SedimentYield.class,
-        SedimentYieldValue.class,
-        SQRelation.class,
-        SQRelationValue.class,
-        TimeInterval.class,
-        Unit.class,
-        WstColumn.class,
-        WstColumnQRange.class,
-        WstColumnValue.class,
-        Wst.class,
-        WstQRange.class
-    };
-
-    public FLYSCredentials() {
-    }
-
-    public FLYSCredentials(
-        String user,
-        String password,
-        String dialect,
-        String driver,
-        String url,
-        String connectionInitSqls
-    ) {
-        super(
-            user, password, dialect, driver, url, connectionInitSqls, CLASSES);
-    }
-
-    private static Credentials instance;
-
-    public static synchronized Credentials getInstance() {
-        if (instance == null) {
-            String user =
-                Config.getStringXPath(XPATH_USER, DEFAULT_USER);
-            String password =
-                Config.getStringXPath(XPATH_PASSWORD, DEFAULT_PASSWORD);
-            String dialect =
-                Config.getStringXPath(XPATH_DIALECT, DEFAULT_DIALECT);
-            String driver =
-                Config.getStringXPath(XPATH_DRIVER, DEFAULT_DRIVER);
-            String url =
-                Config.getStringXPath(XPATH_URL, DEFAULT_URL);
-            String connectionInitSqls =
-                Config.getStringXPath(
-                    XPATH_CONNECTION_INIT_SQLS,
-                    DEFAULT_CONNECTION_INIT_SQLS);
-
-            instance = new FLYSCredentials(
-                user, password, dialect, driver, url, connectionInitSqls);
-        }
-        return instance;
-    }
-
-    public static Credentials getDefault() {
-        return new FLYSCredentials(
-            DEFAULT_USER,
-            DEFAULT_PASSWORD,
-            DEFAULT_DIALECT,
-            DEFAULT_DRIVER,
-            DEFAULT_URL,
-            DEFAULT_CONNECTION_INIT_SQLS);
-    }
-}
-// vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 :
--- a/flys-backend/src/main/java/de/intevation/flys/backend/SedDBCredentials.java	Thu Apr 25 11:48:36 2013 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,209 +0,0 @@
-package de.intevation.flys.backend;
-
-import de.intevation.artifacts.common.utils.Config;
-
-import de.intevation.seddb.model.Bezugspegel;
-import de.intevation.seddb.model.Bezugspegelgew;
-import de.intevation.seddb.model.BezugspegelgewId;
-import de.intevation.seddb.model.Bild;
-import de.intevation.seddb.model.Gewaesser;
-import de.intevation.seddb.model.Gfaenger;
-import de.intevation.seddb.model.Glotlinks;
-import de.intevation.seddb.model.GlotlinksId;
-import de.intevation.seddb.model.Glotrechte;
-import de.intevation.seddb.model.Gprobe;
-import de.intevation.seddb.model.GprobeId;
-import de.intevation.seddb.model.Gsiebsatz;
-import de.intevation.seddb.model.Gsiebung;
-import de.intevation.seddb.model.Gsiebungsieb;
-import de.intevation.seddb.model.GsiebungsiebId;
-import de.intevation.seddb.model.Hpeilpunkt;
-import de.intevation.seddb.model.HpeilpunktId;
-import de.intevation.seddb.model.Hpeilung;
-import de.intevation.seddb.model.Messung;
-import de.intevation.seddb.model.Messunglotcount;
-import de.intevation.seddb.model.MessunglotcountId;
-import de.intevation.seddb.model.Messungsta;
-import de.intevation.seddb.model.MessungstaId;
-import de.intevation.seddb.model.Messunguferbezug;
-import de.intevation.seddb.model.MessunguferbezugId;
-import de.intevation.seddb.model.Mpeilpunkt;
-import de.intevation.seddb.model.MpeilpunktId;
-import de.intevation.seddb.model.Mpeilung;
-import de.intevation.seddb.model.Probebild;
-import de.intevation.seddb.model.Siebanalyse;
-import de.intevation.seddb.model.Slotlinks;
-import de.intevation.seddb.model.SlotlinksId;
-import de.intevation.seddb.model.Slotrechte;
-import de.intevation.seddb.model.Sohlprobe;
-import de.intevation.seddb.model.Sohltest;
-import de.intevation.seddb.model.Sprobe;
-import de.intevation.seddb.model.SprobeId;
-import de.intevation.seddb.model.Ssiebung;
-import de.intevation.seddb.model.Ssiebungsieb;
-import de.intevation.seddb.model.SsiebungsiebId;
-import de.intevation.seddb.model.Station;
-import de.intevation.seddb.model.Stationgew;
-import de.intevation.seddb.model.StationgewId;
-import de.intevation.seddb.model.TmpGloChanged;
-import de.intevation.seddb.model.TmpMesAchanged;
-import de.intevation.seddb.model.TmpMesGchanged;
-import de.intevation.seddb.model.TmpMesQchanged;
-import de.intevation.seddb.model.TmpMesSchanged;
-import de.intevation.seddb.model.Zzarchiv;
-import de.intevation.seddb.model.Zzprobenahmeart;
-import de.intevation.seddb.model.Zzsondierungart;
-import de.intevation.seddb.model.Zzthema;
-
-public class SedDBCredentials
-extends      Credentials
-{
-    public static final String XPATH_USER =
-        "/artifact-database/seddb-database/user/text()";
-
-    public static final String XPATH_PASSWORD =
-        "/artifact-database/seddb-database/password/text()";
-
-    public static final String XPATH_DIALECT =
-        "/artifact-database/seddb-database/dialect/text()";
-
-    public static final String XPATH_DRIVER =
-        "/artifact-database/seddb-database/driver/text()";
-
-    public static final String XPATH_URL =
-        "/artifact-database/seddb-database/url/text()";
-
-    public static final String XPATH_CONNECTION_INIT_SQLS =
-        "/artifact-database/seddb-database/connection-init-sqls/text()";
-
-    public static final String DEFAULT_USER =
-        System.getProperty("flys.seddb.user", "seddb");
-
-    public static final String DEFAULT_PASSWORD =
-        System.getProperty("flys.seddb.password", "seddb");
-
-    public static final String DEFAULT_DIALECT =
-        System.getProperty(
-            "flys.seddb.dialect",
-            "org.hibernate.dialect.PostgreSQLDialect");
-
-    public static final String DEFAULT_DRIVER =
-        System.getProperty(
-            "flys.seddb.driver",
-            "org.postgresql.Driver");
-
-    public static final String DEFAULT_URL =
-        System.getProperty(
-            "flys.seddb.url",
-            "jdbc:postgresql://localhost:5432/seddb");
-
-    public static final String DEFAULT_CONNECTION_INIT_SQLS =
-        System.getProperty(
-            "flys.seddb.connection.init.sqls");
-
-    public static final Class [] CLASSES = {
-        BezugspegelgewId.class,
-        Bezugspegelgew.class,
-        Bezugspegel.class,
-        Bild.class,
-        Gewaesser.class,
-        Gfaenger.class,
-        GlotlinksId.class,
-        Glotlinks.class,
-        Glotrechte.class,
-        GprobeId.class,
-        Gprobe.class,
-        Gsiebsatz.class,
-        Gsiebung.class,
-        GsiebungsiebId.class,
-        Gsiebungsieb.class,
-        HpeilpunktId.class,
-        Hpeilpunkt.class,
-        Hpeilung.class,
-        Messung.class,
-        MessunglotcountId.class,
-        Messunglotcount.class,
-        MessungstaId.class,
-        Messungsta.class,
-        MessunguferbezugId.class,
-        Messunguferbezug.class,
-        MpeilpunktId.class,
-        Mpeilpunkt.class,
-        Mpeilung.class,
-        Probebild.class,
-        Siebanalyse.class,
-        SlotlinksId.class,
-        Slotlinks.class,
-        Slotrechte.class,
-        Sohlprobe.class,
-        Sohltest.class,
-        SprobeId.class,
-        Sprobe.class,
-        Ssiebung.class,
-        SsiebungsiebId.class,
-        Ssiebungsieb.class,
-        StationgewId.class,
-        Stationgew.class,
-        Station.class,
-        TmpGloChanged.class,
-        TmpMesAchanged.class,
-        TmpMesGchanged.class,
-        TmpMesQchanged.class,
-        TmpMesSchanged.class,
-        Zzarchiv.class,
-        Zzprobenahmeart.class,
-        Zzsondierungart.class,
-        Zzthema.class
-    };
-
-    private static Credentials instance;
-
-    public SedDBCredentials() {
-    }
-
-    public SedDBCredentials(
-        String user,
-        String password,
-        String dialect,
-        String driver,
-        String url,
-        String connectionInitSqls
-    ) {
-        super(
-            user, password, dialect, driver, url, connectionInitSqls, CLASSES);
-    }
-
-    public static synchronized Credentials getInstance() {
-        if (instance == null) {
-            String user =
-                Config.getStringXPath(XPATH_USER, DEFAULT_USER);
-            String password =
-                Config.getStringXPath(XPATH_PASSWORD, DEFAULT_PASSWORD);
-            String dialect =
-                Config.getStringXPath(XPATH_DIALECT, DEFAULT_DIALECT);
-            String driver =
-                Config.getStringXPath(XPATH_DRIVER, DEFAULT_DRIVER);
-            String url =
-                Config.getStringXPath(XPATH_URL, DEFAULT_URL);
-            String connectionInitSqls =
-                Config.getStringXPath(
-                    XPATH_CONNECTION_INIT_SQLS,
-                    DEFAULT_CONNECTION_INIT_SQLS);
-
-            instance = new SedDBCredentials(
-                user, password, dialect, driver, url, connectionInitSqls);
-        }
-        return instance;
-    }
-
-    public static Credentials getDefault() {
-        return new SedDBCredentials(
-            DEFAULT_USER,
-            DEFAULT_PASSWORD,
-            DEFAULT_DIALECT,
-            DEFAULT_DRIVER,
-            DEFAULT_URL,
-            DEFAULT_CONNECTION_INIT_SQLS);
-    }
-}
-// vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 :
--- a/flys-backend/src/main/java/de/intevation/flys/backend/SedDBSessionHolder.java	Thu Apr 25 11:48:36 2013 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,43 +0,0 @@
-package de.intevation.flys.backend;
-
-import org.apache.log4j.Logger;
-
-import org.hibernate.Session;
-import org.hibernate.SessionFactory;
-
-public class SedDBSessionHolder
-{
-    private static Logger log =
-        Logger.getLogger(SedDBSessionHolder.class);
-
-    public static final ThreadLocal<Session> HOLDER =
-        new ThreadLocal<Session>() {
-            @Override
-            protected Session initialValue() {
-                return create();
-            }
-        };
-
-    private SedDBSessionHolder() {
-    }
-
-    public synchronized static Session create() {
-        log.debug("create");
-        SessionFactory sessionFactory =
-            SessionFactoryProvider.getSedDBSessionFactory();
-        return sessionFactory.openSession();
-    }
-
-    public static Session acquire() {
-        log.debug("acquire");
-        Session session = create();
-        HOLDER.set(session);
-        return session;
-    }
-
-    public static void release() {
-        log.debug("release");
-        HOLDER.remove();
-    }
-}
-// vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 :
--- a/flys-backend/src/main/java/de/intevation/flys/backend/SessionFactoryProvider.java	Thu Apr 25 11:48:36 2013 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,170 +0,0 @@
-package de.intevation.flys.backend;
-
-import java.util.Properties;
-
-import org.apache.log4j.Logger;
-
-import org.hibernate.SessionFactory;
-
-import org.hibernate.cfg.Configuration;
-import org.hibernate.cfg.Environment;
-
-import org.hibernate.impl.SessionFactoryImpl;
-
-public final class SessionFactoryProvider
-{
-    private static Logger log = Logger.getLogger(SessionFactoryProvider.class);
-
-    //public static final boolean ENABLE_JMX =
-    //    Boolean.getBoolean("flys.backend.enablejmx");
-
-    private static SessionFactory flysSessionFactory;
-    private static SessionFactory sedDBSessionFactory;
-
-    private SessionFactoryProvider() {
-    }
-
-    public static synchronized SessionFactory getSessionFactory() {
-        if (flysSessionFactory == null) {
-            flysSessionFactory =
-                createSessionFactory(FLYSCredentials.getInstance());
-        }
-        return flysSessionFactory;
-    }
-
-    public static SessionFactory createSessionFactory() {
-        return createSessionFactory(FLYSCredentials.getDefault());
-    }
-
-    public static synchronized SessionFactory getSedDBSessionFactory() {
-        if (sedDBSessionFactory == null) {
-            sedDBSessionFactory =
-                createSessionFactory(SedDBCredentials.getInstance());
-        }
-        return sedDBSessionFactory;
-    }
-
-    public static SessionFactory createSedDBSessionFactory() {
-        return createSessionFactory(SedDBCredentials.getDefault());
-    }
-
-    public static SessionFactory createSessionFactory(
-        Credentials credentials
-    ) {
-        Configuration cfg = createConfiguration(credentials);
-
-        SessionFactory factory = cfg.buildSessionFactory();
-
-        /*
-        if (ENABLE_JMX) {
-            registerAsMBean(factory);
-        }
-        else {
-            log.info("No JMX support for hibernate.");
-        }
-        */
-
-        return factory;
-    }
-
-    /** XXX: Commented out till it is configured correctly.
-    public static void registerAsMBean(SessionFactory factory) {
-
-        // 
-
-        StatisticsService statsMBean = new StatisticsService();
-        statsMBean.setSessionFactory(factory);
-        statsMBean.setStatisticsEnabled(true);
-
-        try {
-            MBeanServer mbs = ManagementFactory.getPlatformMBeanServer();
-            mbs.registerMBean(
-                statsMBean,
-                new ObjectName("Hibernate:application=Statistics"));
-
-            log.info("Enabled JMX support for hibernate.");
-        }
-        catch (MalformedObjectNameException mone) {
-            log.warn(mone, mone);
-        }
-        catch (InstanceAlreadyExistsException iaee) {
-            log.warn(iaee, iaee);
-        }
-        catch (MBeanRegistrationException mbre) {
-            log.warn(mbre, mbre);
-        }
-        catch (NotCompliantMBeanException ncmbe) {
-            log.warn(ncmbe, ncmbe);
-        }
-    }
-    */
-
-    public static Configuration createConfiguration() {
-        return createConfiguration(FLYSCredentials.getInstance());
-    }
-
-    public static Configuration createConfiguration(
-        Credentials credentials
-    ) {
-        Configuration cfg = new Configuration();
-
-        for (Class<?> clazz: credentials.getClasses()) {
-            cfg.addAnnotatedClass(clazz);
-        }
-
-        if (log.isDebugEnabled()) {
-            log.debug("user: "    + credentials.getUser());
-            log.debug("dialect: " + credentials.getDialect());
-            log.debug("driver: "  + credentials.getDriver());
-            log.debug("url: "     + credentials.getUrl());
-        }
-
-        Properties props = new Properties();
-
-        // We rely on our own connection pool
-        props.setProperty(
-            "hibernate.connection.provider_class",
-            "de.intevation.flys.utils.DBCPConnectionProvider");
-
-        props.setProperty(Environment.DIALECT, credentials.getDialect());
-        props.setProperty(Environment.USER,    credentials.getUser());
-        props.setProperty(Environment.PASS,    credentials.getPassword());
-        props.setProperty(Environment.DRIVER,  credentials.getDriver());
-        props.setProperty(Environment.URL,     credentials.getUrl());
-
-        String connectionInitSqls = credentials.getConnectionInitSqls();
-        if (connectionInitSqls != null) {
-            props.setProperty("connectionInitSqls", connectionInitSqls);
-        }
-
-        cfg.mergeProperties(props);
-
-        return cfg;
-    }
-
-
-    public static String getProperty(SessionFactoryImpl factory, String key) {
-        Properties props = factory.getProperties();
-        return props.getProperty(key);
-    }
-
-    public static String getUser(SessionFactoryImpl factory) {
-        return getProperty(factory, Environment.USER);
-    }
-
-
-    public static String getPass(SessionFactoryImpl factory) {
-        return getProperty(factory, Environment.PASS);
-    }
-
-
-    public static String getURL(SessionFactoryImpl factory) {
-        return getProperty(factory, Environment.URL);
-    }
-
-
-    public static String getDriver(SessionFactoryImpl factory) {
-        return getProperty(factory, Environment.DRIVER);
-    }
-}
-// vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 :
--- a/flys-backend/src/main/java/de/intevation/flys/backend/SessionHolder.java	Thu Apr 25 11:48:36 2013 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,44 +0,0 @@
-package de.intevation.flys.backend;
-
-import org.apache.log4j.Logger;
-
-import org.hibernate.Session;
-import org.hibernate.SessionFactory;
-
-
-public class SessionHolder
-{
-    private static Logger log =
-        Logger.getLogger(SessionHolder.class);
-
-    public static final ThreadLocal<Session> HOLDER =
-        new ThreadLocal<Session>() {
-            @Override
-            protected Session initialValue() {
-                return create();
-            }
-        };
-
-    private SessionHolder() {
-    }
-
-    public synchronized static Session create() {
-        log.debug("create");
-        SessionFactory sessionFactory =
-            SessionFactoryProvider.getSessionFactory();
-        return sessionFactory.openSession();
-    }
-
-    public static Session acquire() {
-        log.debug("acquire");
-        Session session = create();
-        HOLDER.set(session);
-        return session;
-    }
-
-    public static void release() {
-        log.debug("release");
-        HOLDER.remove();
-    }
-}
-// vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 :
--- a/flys-backend/src/main/java/de/intevation/flys/backend/SpatialInfo.java	Thu Apr 25 11:48:36 2013 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,176 +0,0 @@
-package de.intevation.flys.backend;
-
-import java.util.List;
-
-import org.apache.log4j.Logger;
-
-import org.hibernate.HibernateException;
-import org.hibernate.Query;
-import org.hibernate.Session;
-
-import de.intevation.flys.model.Building;
-import de.intevation.flys.model.CrossSectionTrack;
-import de.intevation.flys.model.Fixpoint;
-import de.intevation.flys.model.River;
-import de.intevation.flys.model.RiverAxis;
-import de.intevation.flys.model.HWSLine;
-
-
-public class SpatialInfo {
-
-    private static Logger logger = Logger.getLogger(SpatialInfo.class);
-
-    protected static String RIVERNAME = System.getProperty(
-        "flys.backend.spatial.river", "Saar");
-
-    protected Session session;
-
-
-    public static void main(String[] args) {
-        logger.info("Start SpatialInfo application.");
-
-        SpatialInfo spatial = null;
-
-        try {
-            spatial = new SpatialInfo();
-
-            River river = spatial.getRiver(RIVERNAME);
-            if (river == null) {
-                logger.warn("Could not find river '" + RIVERNAME + "'!");
-                return;
-            }
-
-            logger.info("Spatial information of River '" + RIVERNAME + "'");
-            spatial.doRiverAxisInfo(river);
-            spatial.doCrossSectionTracksInfo(river);
-            spatial.doBuildingsInfo(river);
-            spatial.doFixpointsInfo(river);
-        }
-        finally {
-            if (spatial != null) {
-                spatial.close();
-            }
-        }
-
-        logger.info("Finish SpatialInfo application.");
-    }
-
-
-    public SpatialInfo() {
-        session = SessionFactoryProvider
-            .createSessionFactory()
-            .openSession();
-    }
-
-
-    public void close() {
-        session.close();
-    }
-
-
-    protected River getRiver(String rivername) {
-        Query query = session.createQuery(
-            "from River where name =:name");
-        query.setParameter("name", rivername);
-
-        List<River> list = query.list();
-
-        if (list == null || list.size() == 0) {
-            logger.warn("No river '" + rivername + "' found!");
-            return null;
-        }
-
-        return list.get(0);
-    }
-
-
-    protected void doRiverAxisInfo(River river) {
-        try {
-            List<RiverAxis> axis = RiverAxis.getRiverAxis(river.getName());
-            if (axis != null && axis.size() > 0) {
-                logger.debug("TODO: Compute length and boundary.");
-            }
-            else {
-                logger.warn("River has no RiverAxis.");
-            }
-        }
-        catch(HibernateException iae) {
-            logger.warn("No vaild river axis found for " + river.getName());
-            return;
-        }
-
-    }
-
-
-    protected void doCrossSectionTracksInfo(River river) {
-        Query query = session.createQuery(
-            "from CrossSectionTrack where river =:river");
-        query.setParameter("river", river);
-
-        List<CrossSectionTrack> list = query.list();
-
-        if (list == null || list.size() == 0) {
-            logger.warn("No CrossSectionTracks for '" + river.getName() + "' found!");
-            return;
-        }
-        else {
-            logger.info("River contains " + list.size() + " CrossSectionTracks.");
-        }
-    }
-
-
-    protected void doBuildingsInfo(River river) {
-        Query query = session.createQuery(
-            "from Building where river =:river");
-        query.setParameter("river", river);
-
-        List<Building> list = query.list();
-
-        if (list == null || list.size() == 0) {
-            logger.warn("No Buildings for '" + river.getName() + "' found!");
-            return;
-        }
-        else {
-            logger.info("River contains " + list.size() + " Buildings.");
-        }
-    }
-
-
-    protected void doFixpointsInfo(River river) {
-        Query query = session.createQuery(
-            "from Fixpoint where river =:river");
-        query.setParameter("river", river);
-
-        List<Fixpoint> list = query.list();
-
-        if (list == null || list.size() == 0) {
-            logger.warn("No Fixpoints for '" + river.getName() + "' found!");
-            return;
-        }
-        else {
-            logger.info("River contains " + list.size() + " Fixpoints.");
-        }
-    }
-
-    @Deprecated
-    protected void doLinesInfo(River river) {
-        doHWSLinesInfo(river);
-    }
-
-    protected void doHWSLinesInfo(River river) {
-        Query query = session.createQuery(
-            "from hws_lines where river =:river");
-        query.setParameter("river", river);
-
-        List<HWSLine> list = query.list();
-
-        if (list == null || list.size() == 0) {
-            logger.warn("No Lines for '" + river.getName() + "' found!");
-            return;
-        }
-        else {
-            logger.info("River contains " + list.size() + " Lines.");
-        }
-    }
-}
-// vim:set ts=4 sw=4 si et sta sts=4 fenc=utf-8 :
--- a/flys-backend/src/main/java/de/intevation/flys/importer/Config.java	Thu Apr 25 11:48:36 2013 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,224 +0,0 @@
-package de.intevation.flys.importer;
-
-public class Config
-{
-    public static final String SKIP_DEFAULT =
-        "flys.backend.importer.skip.default";
-
-    public static final String DRY_RUN =
-        "flys.backend.importer.dry.run";
-
-    public static final String INFO_GEW_FILE =
-        "flys.backend.importer.infogew.file";
-
-    public static final String ANNOTATION_TYPES =
-        "flys.backend.importer.annotation.types";
-
-    public static final String SKIP_GAUGES =
-        "flys.backend.importer.skip.gauges";
-
-    public static final String SKIP_BWASTR =
-        "flys.backend.importer.skip.bwastr";
-
-    public static final String SKIP_HISTORICAL_DISCHARGE_TABLES =
-        "flys.backend.importer.skip.historical.discharge.tables";
-
-    public static final String SKIP_ANNOTATIONS =
-        "flys.backend.importer.skip.annotations";
-
-    public static final String SKIP_PRFS =
-        "flys.backend.importer.skip.prfs";
-
-    public static final String SKIP_DA50S =
-        "flys.backend.importer.skip.da50s";
-
-    public static final String SKIP_W80S =
-        "flys.backend.importer.skip.w80s";
-
-    public static final String SKIP_W80_CSVS =
-        "flys.backend.importer.skip.w80.csvs";
-
-    public static final String SKIP_HYKS =
-        "flys.backend.importer.skip.hyks";
-
-    public static final String SKIP_WST =
-        "flys.backend.importer.skip.wst";
-
-    public static final String SKIP_EXTRA_WSTS =
-        "flys.backend.importer.skip.extra.wsts";
-
-    public static final String SKIP_FIXATIONS =
-        "flys.backend.importer.skip.fixations";
-
-    public static final String SKIP_OFFICIAL_LINES =
-        "flys.backend.importer.skip.official.lines";
-
-    public static final String SKIP_FLOOD_WATER =
-        "flys.backend.importer.skip.flood.water";
-
-    public static final String SKIP_FLOOD_PROTECTION =
-        "flys.backend.importer.skip.flood.protection";
-
-    public static final String SKIP_BED_HEIGHT_SINGLE =
-        "flys.backend.importer.skip.bed.height.single";
-
-    public static final String SKIP_DA66S =
-        "flys.backend.importer.skip.da66s";
-
-    public static final String SKIP_BED_HEIGHT_EPOCH =
-        "flys.backend.importer.skip.bed.height.epoch";
-
-    public static final String SKIP_SEDIMENT_DENSITY =
-        "flys.backend.importer.skip.sediment.density";
-
-    public static final String SKIP_MORPHOLOGICAL_WIDTH =
-        "flys.backend.importer.skip.morphological.width";
-
-    public static final String SKIP_FLOW_VELOCITY =
-        "flys.backend.importer.skip.flow.velocity";
-
-    public static final String SKIP_SEDIMENT_YIELD =
-        "flys.backend.importer.skip.sediment.yield";
-
-    public static final String SKIP_WATERLEVELS =
-        "flys.backend.importer.skip.waterlevels";
-
-    public static final String SKIP_WATERLEVEL_DIFFERENCES =
-        "flys.backend.importer.skip.waterlevel.differences";
-
-    public static final String SKIP_MEASUREMENT_STATIONS =
-        "flys.backend.importer.skip.measurement.stations";
-
-    public static final String SKIP_SQ_RELATION =
-        "flys.backend.importer.skip.sq.relation";
-
-
-    public static final Config INSTANCE = new Config();
-
-    private Config () {
-    }
-
-    public static final boolean getFlag(String key) {
-        String flag = System.getProperty(key);
-        return flag != null
-            ? Boolean.valueOf(flag)
-            : Boolean.getBoolean(SKIP_DEFAULT);
-    }
-
-    public boolean dryRun() {
-        return getFlag(DRY_RUN);
-    }
-
-    public String getInfoGewFile() {
-        return System.getProperty(INFO_GEW_FILE);
-    }
-
-    public String getAnnotationTypes() {
-        return System.getProperty(ANNOTATION_TYPES);
-    }
-
-    public boolean skipGauges() {
-        return getFlag(SKIP_GAUGES);
-    }
-
-    public boolean skipHistoricalDischargeTables() {
-        return getFlag(SKIP_HISTORICAL_DISCHARGE_TABLES);
-    }
-
-    public boolean skipBWASTR() {
-        return getFlag(SKIP_BWASTR);
-    }
-
-    public boolean skipAnnotations() {
-        return getFlag(SKIP_ANNOTATIONS);
-    }
-
-    public boolean skipPRFs() {
-        return getFlag(SKIP_PRFS);
-    }
-
-    public boolean skipDA50s() {
-        return getFlag(SKIP_DA50S);
-    }
-
-    public boolean skipW80CSVs() {
-        return getFlag(SKIP_W80_CSVS);
-    }
-
-    public boolean skipW80s() {
-        return getFlag(SKIP_W80S);
-    }
-
-    public boolean skipHYKs() {
-        return getFlag(SKIP_HYKS);
-    }
-
-    public boolean skipWst() {
-        return getFlag(SKIP_WST);
-    }
-
-    public boolean skipExtraWsts() {
-        return getFlag(SKIP_EXTRA_WSTS);
-    }
-
-    public boolean skipFixations() {
-        return getFlag(SKIP_FIXATIONS);
-    }
-
-    public boolean skipOfficialLines() {
-        return getFlag(SKIP_OFFICIAL_LINES);
-    }
-
-    public boolean skipFloodWater() {
-        return getFlag(SKIP_FLOOD_WATER);
-    }
-
-    public boolean skipFloodProtection() {
-        return getFlag(SKIP_FLOOD_PROTECTION);
-    }
-
-    public boolean skipDA66s() {
-        return getFlag(SKIP_DA66S);
-    }
-
-    public boolean skipBedHeightSingle() {
-        return getFlag(SKIP_BED_HEIGHT_SINGLE);
-    }
-
-    public boolean skipBedHeightEpoch() {
-        return getFlag(SKIP_BED_HEIGHT_EPOCH);
-    }
-
-    public boolean skipSedimentDensity() {
-        return getFlag(SKIP_SEDIMENT_DENSITY);
-    }
-
-    public boolean skipMorphologicalWidth() {
-        return getFlag(SKIP_MORPHOLOGICAL_WIDTH);
-    }
-
-    public boolean skipFlowVelocity() {
-        return getFlag(SKIP_FLOW_VELOCITY);
-    }
-
-    public boolean skipSedimentYield() {
-        return getFlag(SKIP_SEDIMENT_YIELD);
-    }
-
-    public boolean skipWaterlevels() {
-        return getFlag(SKIP_WATERLEVELS);
-    }
-
-    public boolean skipWaterlevelDifferences() {
-        return getFlag(SKIP_WATERLEVEL_DIFFERENCES);
-    }
-
-    public boolean skipMeasurementStations() {
-        return getFlag(SKIP_MEASUREMENT_STATIONS);
-    }
-
-    public boolean skipSQRelation() {
-        return getFlag(SKIP_SQ_RELATION);
-    }
-}
-// vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 :
--- a/flys-backend/src/main/java/de/intevation/flys/importer/ImportAnnotation.java	Thu Apr 25 11:48:36 2013 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,146 +0,0 @@
-package de.intevation.flys.importer;
-
-import de.intevation.flys.model.Annotation;
-import de.intevation.flys.model.AnnotationType;
-import de.intevation.flys.model.Range;
-import de.intevation.flys.model.Position;
-import de.intevation.flys.model.Attribute;
-import de.intevation.flys.model.River;
-import de.intevation.flys.model.Edge;
-
-import org.hibernate.Session;
-import org.hibernate.Query;
-
-import java.util.List;
-
-public class ImportAnnotation
-implements   Comparable<ImportAnnotation>
-{
-    protected ImportAttribute      attribute;
-    protected ImportPosition       position;
-    protected ImportRange          range;
-    protected ImportEdge           edge;
-    protected ImportAnnotationType type;
-
-    protected Annotation      peer;
-
-    public ImportAnnotation() {
-    }
-
-    public ImportAnnotation(
-        ImportAttribute      attribute,
-        ImportPosition       position,
-        ImportRange          range,
-        ImportEdge           edge,
-        ImportAnnotationType type
-    ) {
-        this.attribute = attribute;
-        this.position  = position;
-        this.range     = range;
-        this.edge      = edge;
-        this.type      = type;
-    }
-
-    public int compareTo(ImportAnnotation other) {
-        int d = attribute.compareTo(other.attribute);
-        if (d != 0) {
-            return d;
-        }
-
-        if ((d = position.compareTo(other.position)) != 0) {
-            return d;
-        }
-
-        if ((d = range.compareTo(other.range)) != 0) {
-            return d;
-        }
-
-        if (edge == null && other.edge != null) return -1;
-        if (edge != null && other.edge == null) return +1;
-        if (edge == null && other.edge == null) return 0;
-
-        if ((d = edge.compareTo(other.edge)) != 0) {
-            return d;
-        }
-
-        if (type == null && other.type != null) return -1;
-        if (type != null && other.type == null) return +1;
-        if (type == null && other.type == null) return 0;
-
-        return type.compareTo(other.type);
-    }
-
-    public ImportAttribute getAttribute() {
-        return attribute;
-    }
-
-    public void setAttribute(ImportAttribute attribute) {
-        this.attribute = attribute;
-    }
-
-    public ImportPosition getPosition() {
-        return position;
-    }
-
-    public void setPosition(ImportPosition position) {
-        this.position = position;
-    }
-
-    public ImportRange getRange() {
-        return range;
-    }
-
-    public void setRange(ImportRange range) {
-        this.range = range;
-    }
-
-    public ImportEdge getEdge() {
-        return edge;
-    }
-
-    public void setEdge(ImportEdge edge) {
-        this.edge = edge;
-    }
-
-    public ImportAnnotationType getType() {
-        return type;
-    }
-
-    public void setType(ImportAnnotationType type) {
-        this.type = type;
-    }
-
-    public Annotation getPeer(River river) {
-        if (peer == null) {
-            Range          r = range.getPeer(river);
-            Attribute      a = attribute.getPeer();
-            Position       p = position.getPeer();
-            Edge           e = edge != null ? edge.getPeer() : null;
-            AnnotationType t = type != null ? type.getPeer() : null;
-
-            Session session = ImporterSession.getInstance().getDatabaseSession();
-            Query query = session.createQuery(
-                "from Annotation where "    +
-                "range=:range and "         +
-                "attribute=:attribute and " +
-                "position=:position and "   +
-                "edge=:edge and "           +
-                "type=:type");
-            query.setParameter("range",     r);
-            query.setParameter("attribute", a);
-            query.setParameter("position",  p);
-            query.setParameter("edge",      e);
-            query.setParameter("type",      t);
-            List<Annotation> annotations = query.list();
-            if (annotations.isEmpty()) {
-                peer = new Annotation(r, a, p, e, t);
-                session.save(peer);
-            }
-            else {
-                peer = annotations.get(0);
-            }
-        }
-        return peer;
-    }
-}
-// vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 :
--- a/flys-backend/src/main/java/de/intevation/flys/importer/ImportAnnotationType.java	Thu Apr 25 11:48:36 2013 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,54 +0,0 @@
-package de.intevation.flys.importer;
-
-import de.intevation.flys.model.AnnotationType;
-
-import org.hibernate.Session;
-import org.hibernate.Query;
-
-import java.util.List;
-
-public class ImportAnnotationType
-implements   Comparable<ImportAnnotationType>
-{
-    protected String         name;
-    protected AnnotationType peer;
-
-    public ImportAnnotationType() {
-    }
-
-    public ImportAnnotationType(String name) {
-        this.name = name;
-    }
-
-    public int compareTo(ImportAnnotationType other) {
-        return name.compareTo(other.name);
-    }
-
-    public String getName() {
-        return name;
-    }
-
-    public void setName(String name) {
-        this.name = name;
-    }
-
-
-    public AnnotationType getPeer() {
-        if (peer == null) {
-            Session session = ImporterSession.getInstance().getDatabaseSession();
-            Query query = session.createQuery(
-                "from AnnotationType where name=:name");
-            query.setParameter("name", name);
-            List<AnnotationType> types = query.list();
-            if (types.isEmpty()) {
-                peer = new AnnotationType(name);
-                session.save(peer);
-            }
-            else {
-                peer = types.get(0);
-            }
-        }
-        return peer;
-    }
-}
-// vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 :
--- a/flys-backend/src/main/java/de/intevation/flys/importer/ImportAttribute.java	Thu Apr 25 11:48:36 2013 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,65 +0,0 @@
-package de.intevation.flys.importer;
-
-import de.intevation.flys.model.Attribute;
-
-import org.hibernate.Session;
-import org.hibernate.Query;
-
-import java.util.List;
-
-public class ImportAttribute
-implements   Comparable<ImportAttribute>
-{
-    protected String value;
-
-    protected Attribute peer;
-
-    public ImportAttribute() {
-    }
-
-    public ImportAttribute(String value) {
-        this.value = value;
-    }
-
-    public String getValue() {
-        return value;
-    }
-
-    public void setValue(String value) {
-        this.value = value;
-    }
-
-    public int compareTo(ImportAttribute other) {
-        return value.compareTo(other.value);
-    }
-
-    @Override
-    public boolean equals(Object other) {
-        if (other == this) return true;
-        if (!(other instanceof ImportAttribute)) return false;
-        return value.equals(((ImportAttribute)other).value);
-    }
-
-    @Override
-    public int hashCode() {
-        return value.hashCode();
-    }
-
-    public Attribute getPeer() {
-        if (peer == null) {
-            Session session = ImporterSession.getInstance().getDatabaseSession();
-            Query query = session.createQuery("from Attribute where value=:value");
-            query.setString("value", value);
-            List<Attribute> attributes = query.list();
-            if (attributes.isEmpty()) {
-                peer = new Attribute(value);
-                session.save(peer);
-            }
-            else {
-                peer = attributes.get(0);
-            }
-        }
-        return peer;
-    }
-}
-// vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 :
--- a/flys-backend/src/main/java/de/intevation/flys/importer/ImportBedHeight.java	Thu Apr 25 11:48:36 2013 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,44 +0,0 @@
-package de.intevation.flys.importer;
-
-
-import java.sql.SQLException;
-
-import org.hibernate.exception.ConstraintViolationException;
-
-import de.intevation.flys.model.River;
-
-
-public interface ImportBedHeight {
-
-    String getDescription();
-
-    void addValue(ImportBedHeightValue value);
-
-    void storeDependencies(River river)
-    throws SQLException, ConstraintViolationException;
-
-    Object getPeer(River river);
-
-    int getValueCount();
-
-    void setYear(int year);
-
-    void setTimeInterval(ImportTimeInterval timeInterval);
-
-    void setSoundingWidth(int soundingWidth);
-
-    void setDescription(String description);
-
-    void setEvaluationBy(String evaluationBy);
-
-    void setRange(ImportRange range);
-
-    void setType(ImportBedHeightType type);
-
-    void setLocationSystem(ImportLocationSystem locationSystem);
-
-    void setCurElevationModel(ImportElevationModel model);
-
-    void setOldElevationModel(ImportElevationModel model);
-}
-// vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 :
--- a/flys-backend/src/main/java/de/intevation/flys/importer/ImportBedHeightEpoch.java	Thu Apr 25 11:48:36 2013 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,198 +0,0 @@
-package de.intevation.flys.importer;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import org.apache.log4j.Logger;
-import org.hibernate.Query;
-import org.hibernate.Session;
-
-import de.intevation.flys.model.BedHeightEpoch;
-import de.intevation.flys.model.ElevationModel;
-import de.intevation.flys.model.Range;
-import de.intevation.flys.model.River;
-import de.intevation.flys.model.TimeInterval;
-
-
-/** Import Bed Height Data, 'epoch' type from csv file. */
-public class ImportBedHeightEpoch implements ImportBedHeight {
-
-    /** Private logger. */
-    private static Logger log = Logger.getLogger(ImportBedHeightEpoch.class);
-
-    protected String evaluationBy;
-
-    /** De facto the file name. */
-    protected String description;
-
-    protected ImportTimeInterval timeInterval;
-    protected ImportRange range;
-    protected ImportElevationModel curElevationModel;
-    protected ImportElevationModel oldElevationModel;
-
-    protected List<ImportBedHeightEpochValue> values;
-
-    protected BedHeightEpoch peer;
-
-    public ImportBedHeightEpoch(String description) {
-        this.description = description;
-        this.values = new ArrayList<ImportBedHeightEpochValue>();
-    }
-
-    public String getDescription() {
-        return description;
-    }
-
-    public int getValueCount() {
-        return values.size();
-    }
-
-    public void setTimeInterval(ImportTimeInterval timeInterval) {
-        this.timeInterval = timeInterval;
-    }
-
-    public void setEvaluationBy(String evaluationBy) {
-        this.evaluationBy = evaluationBy;
-    }
-
-    public void setDescription(String description) {
-        this.description = description;
-    }
-
-    public void setRange(ImportRange range) {
-        this.range = range;
-    }
-
-    public void setCurElevationModel(ImportElevationModel curElevationModel) {
-        this.curElevationModel = curElevationModel;
-    }
-
-    public void setOldElevationModel(ImportElevationModel oldElevationModel) {
-        this.oldElevationModel = oldElevationModel;
-    }
-
-    /** Does nothing. */
-    public void setYear(int year) {
-        // do nothing
-    }
-
-    /** Does nothing. */
-    public void setSoundingWidth(int soundingWidth) {
-        // do nothing
-    }
-
-
-    /** Does nothing. */
-    public void setLocationSystem(ImportLocationSystem locationSystem) {
-        // do nothing
-    }
-
-
-    /** Does nothing. */
-    public void setType(ImportBedHeightType type) {
-        // do nothing
-    }
-
-    @Override
-    public void addValue(ImportBedHeightValue value) {
-        values.add((ImportBedHeightEpochValue) value);
-    }
-
-    @Override
-    public void storeDependencies(River river) {
-        log.info("Store dependencies for epoch: '" + getDescription() + "'");
-
-        BedHeightEpoch peer = getPeer(river);
-
-        if (curElevationModel != null) {
-            curElevationModel.storeDependencies();
-        }
-
-        if (oldElevationModel != null) {
-            oldElevationModel.storeDependencies();
-        }
-
-        if (peer != null) {
-            log.debug("store values now...");
-
-            for (ImportBedHeightEpochValue value : values) {
-                value.storeDependencies(peer);
-            }
-        }
-
-        Session session = ImporterSession.getInstance().getDatabaseSession();
-        session.flush();
-    }
-
-    /**
-     * Asserts all dependent entities (ElevationModel, TimeInterval, Range,
-     * BedHeighEpoch) are in db and returns bound (either newly created or
-     * freshly fetched) BedHeightEpoch.
-     */
-    @Override
-    public BedHeightEpoch getPeer(River river) {
-        if (peer == null) {
-            ElevationModel theCurModel = null;
-            if (curElevationModel != null) {
-                curElevationModel.storeDependencies();
-                theCurModel = curElevationModel.getPeer();
-            }
-
-            if (theCurModel == null) {
-                log.warn("BHE: Skip file - invalid current elevation model.");
-                return null;
-            }
-
-            TimeInterval theTime = null;
-            if (timeInterval != null) {
-                theTime = timeInterval.getPeer();
-            }
-
-            if (theTime == null) {
-                log.warn("BHE: Skip file - invalid time range.");
-                return null;
-            }
-
-            Range theRange = range != null ? range.getPeer(river) : null;
-
-            if (theRange == null) {
-                log.warn("BHE: invalid km range.");
-            }
-
-            Session session = ImporterSession.getInstance()
-                .getDatabaseSession();
-
-            Query query = session.createQuery("from BedHeightEpoch where "
-                + "   river=:river and " + "   timeInterval=:timeInterval and "
-                + "   curElevationModel=:curElevationModel and "
-                + "   range=:range and " + "   evaluationBy=:evaluationBy and "
-                + "   description=:description");
-
-            query.setParameter("river", river);
-            query.setParameter("timeInterval", theTime);
-            query.setParameter("curElevationModel", theCurModel);
-            query.setParameter("range", theRange);
-            query.setParameter("evaluationBy", evaluationBy);
-            query.setParameter("description", description);
-
-            List<BedHeightEpoch> bedHeights = query.list();
-
-            if (bedHeights.isEmpty()) {
-                log.info("Create new BedHeightEpoch DB instance.");
-
-                peer = new BedHeightEpoch(river, theTime, theRange,
-                    theCurModel,
-                    oldElevationModel != null ? oldElevationModel.getPeer()
-                        : null, evaluationBy, description);
-
-                session.save(peer);
-            }
-            else {
-                peer = bedHeights.get(0);
-            }
-        }
-
-        return peer;
-    }
-}
-// vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 :
--- a/flys-backend/src/main/java/de/intevation/flys/importer/ImportBedHeightEpochValue.java	Thu Apr 25 11:48:36 2013 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,75 +0,0 @@
-package de.intevation.flys.importer;
-
-import java.util.List;
-
-import java.math.BigDecimal;
-
-import org.apache.log4j.Logger;
-
-import org.hibernate.Session;
-import org.hibernate.Query;
-
-import de.intevation.flys.model.BedHeightEpoch;
-import de.intevation.flys.model.BedHeightEpochValue;
-
-
-public class ImportBedHeightEpochValue implements ImportBedHeightValue {
-
-    private static final Logger log =
-        Logger.getLogger(ImportBedHeightEpochValue.class);
-
-
-    private BigDecimal station;
-    private BigDecimal height;
-
-    private BedHeightEpochValue peer;
-
-
-    public ImportBedHeightEpochValue() {
-    }
-
-
-    public ImportBedHeightEpochValue(BigDecimal station, BigDecimal height) {
-        this.station = station;
-        this.height  = height;
-    }
-
-
-    public void storeDependencies(BedHeightEpoch bedHeight) {
-        getPeer(bedHeight);
-    }
-
-
-    public BedHeightEpochValue getPeer(BedHeightEpoch bedHeight) {
-        if (peer == null) {
-            Session session = ImporterSession.getInstance().getDatabaseSession();
-
-            Query query = session.createQuery(
-                "from BedHeightEpochValue where " +
-                "   bedHeight=:bedHeight and " +
-                "   station=:station and " +
-                "   height=:height");
-
-            query.setParameter("bedHeight", bedHeight);
-            query.setParameter("station", station);
-            query.setParameter("height", height);
-
-            List<BedHeightEpochValue> values = query.list();
-
-            if (values.isEmpty()) {
-                peer = new BedHeightEpochValue(
-                    bedHeight,
-                    station,
-                    height
-                );
-                session.save(peer);
-            }
-            else {
-                peer = values.get(0);
-            }
-        }
-
-        return peer;
-    }
-}
-// vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 :
--- a/flys-backend/src/main/java/de/intevation/flys/importer/ImportBedHeightSingle.java	Thu Apr 25 11:48:36 2013 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,198 +0,0 @@
-package de.intevation.flys.importer;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import org.apache.log4j.Logger;
-
-import org.hibernate.Session;
-import org.hibernate.Query;
-
-import de.intevation.flys.model.BedHeightSingle;
-import de.intevation.flys.model.BedHeightType;
-import de.intevation.flys.model.ElevationModel;
-import de.intevation.flys.model.Range;
-import de.intevation.flys.model.River;
-
-
-public class ImportBedHeightSingle implements ImportBedHeight
-{
-    private static Logger log = Logger.getLogger(ImportBedHeightSingle.class);
-
-    protected Integer year;
-    protected int soundingWidth;
-
-    protected String evaluationBy;
-    protected String description;
-
-    protected ImportRange          range;
-    protected ImportBedHeightType  type;
-    protected ImportLocationSystem locationSystem;
-    protected ImportElevationModel curElevationModel;
-    protected ImportElevationModel oldElevationModel;
-
-    protected List<ImportBedHeightSingleValue> values;
-
-    protected BedHeightSingle peer;
-
-
-    public ImportBedHeightSingle(String description) {
-        this.description = description;
-        this.values      = new ArrayList<ImportBedHeightSingleValue>();
-    }
-
-
-    public String getDescription() {
-        return description;
-    }
-
-    public int getValueCount() {
-        return values.size();
-    }
-
-
-    public void setYear(int year) {
-        this.year = year;
-    }
-
-    public void setTimeInterval(ImportTimeInterval timeInterval) {
-        // do nothing
-    }
-
-    public void setSoundingWidth(int soundingWidth) {
-        this.soundingWidth = soundingWidth;
-    }
-
-    public void setEvaluationBy(String evaluationBy) {
-        this.evaluationBy = evaluationBy;
-    }
-
-    public void setDescription(String description) {
-        this.description = description;
-    }
-
-    public void setRange(ImportRange range) {
-        this.range = range;
-    }
-
-    public void setType(ImportBedHeightType type) {
-        this.type = type;
-    }
-
-    public void setLocationSystem(ImportLocationSystem locationSystem) {
-        this.locationSystem = locationSystem;
-    }
-
-    public void setCurElevationModel(ImportElevationModel curElevationModel) {
-        this.curElevationModel = curElevationModel;
-    }
-
-    public void setOldElevationModel(ImportElevationModel oldElevationModel) {
-        this.oldElevationModel = oldElevationModel;
-    }
-
-    @Override
-    public void addValue(ImportBedHeightValue value) {
-        values.add((ImportBedHeightSingleValue) value);
-    }
-
-    @Override
-    public void storeDependencies(River river) {
-        log.info("Store dependencies for single: '" + getDescription() + "'");
-
-        if (type != null) {
-            type.storeDependencies();
-        }
-
-        if (locationSystem != null) {
-            locationSystem.storeDependencies();
-        }
-
-        if (curElevationModel != null) {
-            curElevationModel.storeDependencies();
-        }
-
-        if (oldElevationModel != null) {
-            oldElevationModel.storeDependencies();
-        }
-
-        BedHeightSingle peer = getPeer(river);
-
-        if (peer != null) {
-            for (ImportBedHeightSingleValue value: values) {
-                value.storeDependencies(peer);
-            }
-        }
-
-        Session session = ImporterSession.getInstance().getDatabaseSession();
-        session.flush();
-    }
-
-    @Override
-    public BedHeightSingle getPeer(River river) {
-        if (peer == null) {
-            BedHeightType  theType     = type != null ? type.getPeer() : null;
-            ElevationModel theCurModel = curElevationModel.getPeer();
-            Range          theRange    = range != null ? range.getPeer(river) : null;
-
-            if (theType == null) {
-                log.warn("BHS: No bed height type given. Skip file '" + 
-			 description + "'");
-                return null;
-            }
-
-            if (theCurModel == null) {
-                log.warn("BHS: No elevation model given. Skip file '" + 
-			 description + "'");
-                return null;
-            }
-
-            if (theRange == null) {
-                log.warn("BHS: No km-range given: '" + 
-			 description + "'");
-            }
-
-            Session session = ImporterSession.getInstance().getDatabaseSession();
-
-            Query query = session.createQuery(
-                "from BedHeightSingle where " +
-                "river=:river and year=:year and soundingWidth=:soundingWidth " +
-                "and type=:type and locationSystem=:locationSystem and " +
-                "curElevationModel=:curElevationModel and range=:range");
-
-            query.setParameter("river", river);
-            query.setParameter("year", year);
-            query.setParameter("soundingWidth", soundingWidth);
-            query.setParameter("type", theType);
-            query.setParameter("locationSystem", locationSystem.getPeer());
-            query.setParameter("curElevationModel", theCurModel);
-            query.setParameter("range", range.getPeer(river));
-
-            List<BedHeightSingle> bedHeights = query.list();
-            if (bedHeights.isEmpty()) {
-                log.info("Create new BedHeightSingle DB instance.");
-
-                peer = new BedHeightSingle(
-                    river,
-                    year,
-                    soundingWidth,
-                    theType,
-                    locationSystem.getPeer(),
-                    theCurModel,
-                    oldElevationModel != null ? oldElevationModel.getPeer() : null,
-                    range.getPeer(river),
-                    evaluationBy,
-                    description
-                );
-
-                session.save(peer);
-            }
-            else {
-                peer = bedHeights.get(0);
-            }
-        }
-
-        return peer;
-    }
-}
-// vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 :
--- a/flys-backend/src/main/java/de/intevation/flys/importer/ImportBedHeightSingleValue.java	Thu Apr 25 11:48:36 2013 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,105 +0,0 @@
-package de.intevation.flys.importer;
-
-import java.util.List;
-
-import java.math.BigDecimal;
-
-import org.apache.log4j.Logger;
-
-import org.hibernate.Session;
-import org.hibernate.Query;
-
-import de.intevation.flys.model.BedHeightSingle;
-import de.intevation.flys.model.BedHeightSingleValue;
-
-
-public class ImportBedHeightSingleValue implements ImportBedHeightValue {
-
-    private static final Logger log =
-        Logger.getLogger(ImportBedHeightSingleValue.class);
-
-
-    protected ImportBedHeightSingle bedHeight;
-
-    protected BigDecimal station;
-    protected BigDecimal height;
-    protected BigDecimal uncertainty;
-    protected BigDecimal dataGap;
-    protected BigDecimal soundingWidth;
-    protected BigDecimal width;
-
-    protected BedHeightSingleValue peer;
-
-
-    public ImportBedHeightSingleValue(
-        ImportBedHeightSingle bedHeight,
-        BigDecimal station,
-        BigDecimal height,
-        BigDecimal uncertainty,
-        BigDecimal dataGap,
-        BigDecimal soundingWidth,
-        BigDecimal width
-    ) {
-        this.bedHeight     = bedHeight;
-        this.station       = station;
-        this.height        = height;
-        this.uncertainty   = uncertainty;
-        this.dataGap       = dataGap;
-        this.soundingWidth = soundingWidth;
-        this.width         = width;
-    }
-
-
-    public void storeDependencies(BedHeightSingle bedHeight) {
-        getPeer(bedHeight);
-    }
-
-
-    /**
-     * Add this value to database or return database bound Value, assuring
-     * that the BedHeightSingle exists in db already.
-     */
-    public BedHeightSingleValue getPeer(BedHeightSingle bedHeight) {
-        if (peer == null) {
-            Session session = ImporterSession.getInstance().getDatabaseSession();
-
-            Query query = session.createQuery(
-                "from BedHeightSingleValue where " +
-                "   bedHeight=:bedHeight and " +
-                "   station=:station and " +
-                "   height=:height and " +
-                "   uncertainty=:uncertainty and " +
-                "   dataGap=:dataGap and " +
-                "   soundingWidth=:soundingWidth and " +
-                "   width=:width");
-
-            query.setParameter("bedHeight", bedHeight);
-            query.setParameter("station", station);
-            query.setParameter("height", height);
-            query.setParameter("uncertainty", uncertainty);
-            query.setParameter("dataGap", dataGap);
-            query.setParameter("soundingWidth", soundingWidth);
-            query.setParameter("width", width);
-
-            List<BedHeightSingleValue> values = query.list();
-            if (values.isEmpty()) {
-                peer = new BedHeightSingleValue(
-                    bedHeight,
-                    station,
-                    height,
-                    uncertainty,
-                    dataGap,
-                    soundingWidth,
-                    width
-                );
-                session.save(peer);
-            }
-            else {
-                peer = values.get(0);
-            }
-        }
-
-        return peer;
-    }
-}
-// vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 :
--- a/flys-backend/src/main/java/de/intevation/flys/importer/ImportBedHeightType.java	Thu Apr 25 11:48:36 2013 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,61 +0,0 @@
-package de.intevation.flys.importer;
-
-import java.util.List;
-
-import org.apache.log4j.Logger;
-
-import org.hibernate.Session;
-import org.hibernate.Query;
-
-import de.intevation.flys.model.BedHeightType;
-
-
-public class ImportBedHeightType {
-
-    private static final Logger log =
-        Logger.getLogger(ImportBedHeightType.class);
-
-    protected String name;
-
-    protected BedHeightType peer;
-
-    public ImportBedHeightType(BedHeightType peer)  {
-        this.peer = peer;
-        name = peer.getName();
-    }
-
-
-    public ImportBedHeightType(String name) {
-        this.name        = name;
-    }
-
-
-    public void storeDependencies() {
-        getPeer();
-    }
-
-
-    public BedHeightType getPeer() {
-        if (peer == null) {
-            Session session = ImporterSession.getInstance().getDatabaseSession();
-
-            Query query = session.createQuery(
-                "from BedHeightType where name=:name and description=:description");
-
-            query.setParameter("name", name);
-
-            List<BedHeightType> types = query.list();
-
-            if (types.isEmpty()) {
-                peer = new BedHeightType(name);
-                session.save(peer);
-            }
-            else {
-                peer = types.get(0);
-            }
-        }
-
-        return peer;
-    }
-}
-// vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 :
--- a/flys-backend/src/main/java/de/intevation/flys/importer/ImportBedHeightValue.java	Thu Apr 25 11:48:36 2013 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,7 +0,0 @@
-package de.intevation.flys.importer;
-
-
-public interface ImportBedHeightValue {
-
-}
-// vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 :
--- a/flys-backend/src/main/java/de/intevation/flys/importer/ImportCrossSection.java	Thu Apr 25 11:48:36 2013 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,120 +0,0 @@
-package de.intevation.flys.importer;
-
-import de.intevation.flys.model.River;
-import de.intevation.flys.model.CrossSection;
-import de.intevation.flys.model.TimeInterval;
-
-import org.hibernate.Session;
-import org.hibernate.Query;
-
-import java.util.List;
-
-import org.apache.log4j.Logger;
-
-/** CrossSection to be imported, holds list of ImportCrossSectionLines. */
-public class ImportCrossSection
-{
-    private static Logger log = Logger.getLogger(ImportRiver.class);
-
-    protected ImportRiver                  river;
-    protected String                       description;
-    protected ImportTimeInterval           timeInterval;
-    protected List<ImportCrossSectionLine> lines;
-
-    protected CrossSection peer;
-
-    public ImportCrossSection() {
-    }
-
-    public ImportCrossSection(
-        ImportRiver                  river,
-        String                       description,
-        ImportTimeInterval           timeInterval,
-        List<ImportCrossSectionLine> lines
-    ) {
-        this.river        = river;
-        this.description  = description;
-        this.timeInterval = timeInterval;
-        this.lines        = lines;
-        wireWithLines();
-    }
-
-    public void wireWithLines() {
-        for (ImportCrossSectionLine line: lines) {
-            line.setCrossSection(this);
-        }
-    }
-
-    public ImportRiver getRiver() {
-        return river;
-    }
-
-    public void setRiver(ImportRiver river) {
-        this.river = river;
-    }
-
-    public String getDescription() {
-        return description;
-    }
-
-    public void setDescription(String description) {
-        this.description = description;
-    }
-
-    public ImportTimeInterval getTimeInterval() {
-        return timeInterval;
-    }
-
-    public void setTimeInterval(ImportTimeInterval timeInterval) {
-        this.timeInterval = timeInterval;
-    }
-
-    public void storeDependencies() {
-
-        log.info("store cross section '" + description + "'");
-
-        getPeer();
-
-        int i = 1, N = lines.size();
-
-        for (ImportCrossSectionLine line: lines) {
-            line.storeDependencies();
-            log.info("  stored " + i + " lines. remaining: " + (N-i));
-            ++i;
-        }
-    }
-
-    public CrossSection getPeer() {
-
-        if (peer == null) {
-            River r = river.getPeer();
-            TimeInterval t = timeInterval != null
-                ? timeInterval.getPeer()
-                : null;
-
-            Session session =
-                ImporterSession.getInstance().getDatabaseSession();
-
-            Query query = session.createQuery(
-                "from CrossSection where " +
-                "river=:r and "            +
-                "timeInterval=:t and "     +
-                "description=:d");
-
-            query.setParameter("r", r);
-            query.setParameter("t", t);
-            query.setParameter("d", description);
-
-            List<CrossSection> crossSections = query.list();
-            if (crossSections.isEmpty()) {
-                peer = new CrossSection(r, t, description);
-                session.save(peer);
-            }
-            else {
-                peer = crossSections.get(0);
-            }
-        }
-        return peer;
-    }
-}
-// vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 :
--- a/flys-backend/src/main/java/de/intevation/flys/importer/ImportCrossSectionLine.java	Thu Apr 25 11:48:36 2013 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,127 +0,0 @@
-package de.intevation.flys.importer;
-
-import de.intevation.flys.model.CrossSection;
-import de.intevation.flys.model.CrossSectionPoint;
-import de.intevation.flys.model.CrossSectionLine;
-
-import org.hibernate.Session;
-import org.hibernate.Query;
-
-import java.util.List;
-import java.util.Comparator;
-import java.util.Map;
-import java.util.TreeMap;
-
-/**
- * A CrossSectionLine (containing points) ready to be transformed into a mapped
- * object and written to db (used in importer).
- */
-public class ImportCrossSectionLine
-{
-    public static final Comparator<CrossSectionPoint> INDEX_CMP =
-        new Comparator<CrossSectionPoint>() {
-            public int compare(CrossSectionPoint a, CrossSectionPoint b) {
-                return a.getColPos().compareTo(b.getColPos());
-            }
-        };
-
-    protected Double km;
-    protected ImportCrossSection crossSection;
-    protected List<XY> points;
-
-    protected CrossSectionLine peer;
-
-    public ImportCrossSectionLine() {
-    }
-
-    public ImportCrossSectionLine(Double km, List<XY> points) {
-        this.km     = km;
-        this.points = points;
-    }
-
-    public ImportCrossSection getCrossSection() {
-        return crossSection;
-    }
-
-    public void setCrossSection(ImportCrossSection crossSection) {
-        this.crossSection = crossSection;
-    }
-
-    public Double getKm() {
-        return km;
-    }
-
-    public void setKm(Double km) {
-        this.km = km;
-    }
-
-    public void storeDependencies() {
-        storePoints();
-    }
-
-
-    /** Write a line and its points. */
-    protected void storePoints() {
-        CrossSectionLine csl = getPeer();
-
-        Map<CrossSectionPoint, CrossSectionPoint> map =
-            new TreeMap<CrossSectionPoint, CrossSectionPoint>(INDEX_CMP);
-
-        // Build index for faster (index) collision lookup.
-        List<CrossSectionPoint> ps = csl.getPoints();
-        if (ps != null) {
-            for (CrossSectionPoint point: ps) {
-                map.put(point, point);
-            }
-        }
-
-        Session session =
-            ImporterSession.getInstance().getDatabaseSession();
-
-        CrossSectionPoint key = new CrossSectionPoint();
-
-        // Somehow it looks as if even with the map it is still possible that
-        // multiple points with same id enter hibernate (and then violate a
-        // constraint). -> TODO
-        for (XY xy: points) {
-            key.setColPos(xy.getIndex());
-            CrossSectionPoint csp = map.get(key);
-            if (csp == null) { // create new
-                csp = new CrossSectionPoint(
-                    csl, key.getColPos(),
-                    Double.valueOf(xy.getX()),
-                    Double.valueOf(xy.getY()));
-            }
-            else { // update old
-                csp.setX(Double.valueOf(xy.getX()));
-                csp.setY(Double.valueOf(xy.getY()));
-            }
-            session.save(csp);
-        }
-    }
-
-    public CrossSectionLine getPeer() {
-        if (peer == null) {
-            CrossSection cs = crossSection.getPeer();
-
-            Session session =
-                ImporterSession.getInstance().getDatabaseSession();
-
-            Query query = session.createQuery(
-                "from CrossSectionLine where crossSection=:cs and km=:km");
-            query.setParameter("cs", cs);
-            query.setParameter("km", km);
-
-            List<CrossSectionLine> lines = query.list();
-            if (lines.isEmpty()) {
-                peer = new CrossSectionLine(cs, km);
-                session.save(peer);
-            }
-            else {
-                peer = lines.get(0);
-            }
-        }
-        return peer;
-    }
-}
-// vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 :
--- a/flys-backend/src/main/java/de/intevation/flys/importer/ImportDepth.java	Thu Apr 25 11:48:36 2013 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,70 +0,0 @@
-package de.intevation.flys.importer;
-
-import java.math.BigDecimal;
-
-import java.util.List;
-
-import org.apache.log4j.Logger;
-
-import org.hibernate.Session;
-import org.hibernate.Query;
-
-import de.intevation.flys.model.Depth;
-
-
-public class ImportDepth {
-
-    private static Logger log = Logger.getLogger(ImportDepth.class);
-
-
-    protected Depth peer;
-
-    protected BigDecimal lower;
-    protected BigDecimal upper;
-
-
-    public ImportDepth(BigDecimal lower, BigDecimal upper) {
-        this.lower = lower;
-        this.upper = upper;
-    }
-
-
-    public void storeDependencies() {
-        log.info("store dependencies");
-
-        getPeer();
-    }
-
-
-    public Depth getPeer() {
-        log.info("get peer");
-
-        if (peer == null) {
-            Session session = ImporterSession.getInstance().getDatabaseSession();
-
-            Query query = session.createQuery(
-                "from Depth where " +
-                "   lower=:lower and " +
-                "   upper=:upper");
-
-            query.setParameter("lower", lower);
-            query.setParameter("upper", upper);
-
-            List<Depth> depths = query.list();
-
-            if (depths.isEmpty()) {
-                log.debug("Create new Depth DB instance.");
-
-                peer = new Depth(lower, upper);
-
-                session.save(peer);
-            }
-            else {
-                peer = depths.get(0);
-            }
-        }
-
-        return peer;
-    }
-}
-// vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 :
--- a/flys-backend/src/main/java/de/intevation/flys/importer/ImportDischargeTable.java	Thu Apr 25 11:48:36 2013 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,116 +0,0 @@
-package de.intevation.flys.importer;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import org.hibernate.Session;
-import org.hibernate.Query;
-
-import de.intevation.flys.model.DischargeTable;
-import de.intevation.flys.model.Gauge;
-import de.intevation.flys.model.TimeInterval;
-
-import org.apache.log4j.Logger;
-
-public class ImportDischargeTable
-{
-    private static Logger log = Logger.getLogger(ImportDischargeTable.class);
-
-    protected DischargeTable peer;
-
-    protected String         description;
-
-    protected Integer        kind;
-
-    protected List<ImportDischargeTableValue> dischargeTableValues;
-
-    protected ImportTimeInterval timeInterval;
-
-    public ImportDischargeTable() {
-        this(0, null);
-    }
-
-    public ImportDischargeTable(int kind, String description) {
-        this.kind            = kind;
-        this.description     = description;
-        dischargeTableValues = new ArrayList<ImportDischargeTableValue>();
-    }
-
-
-    public String getDescription() {
-        return description;
-    }
-
-    public void setDescription(String description) {
-        this.description = description;
-    }
-
-
-    public void addDischargeTableValue(ImportDischargeTableValue value) {
-        dischargeTableValues.add(value);
-    }
-
-
-    public void setDischargeTableValues(List<ImportDischargeTableValue> values){
-        this.dischargeTableValues = values;
-    }
-
-
-    public List<ImportDischargeTableValue> getDischargeTableValues() {
-        return dischargeTableValues;
-    }
-
-    public ImportTimeInterval getTimeInterval() {
-        return timeInterval;
-    }
-
-    public void setTimeInterval(ImportTimeInterval timeInterval) {
-        this.timeInterval = timeInterval;
-    }
-
-
-    public DischargeTable getPeer(Gauge gauge) {
-        if (peer == null) {
-            TimeInterval ti = timeInterval != null
-                ? timeInterval.getPeer()
-                : null;
-            Session session = ImporterSession.getInstance().getDatabaseSession();
-
-            Query query = session.createQuery(
-                "from DischargeTable where " +
-                "gauge.id=:gauge and kind=:kind and " +
-                "description=:description and timeInterval=:interval");
-            query.setParameter("gauge",       gauge.getId());
-            query.setParameter("description", description);
-            query.setParameter("kind",        kind);
-            query.setParameter("interval",    ti);
-
-            List<DischargeTable> dischargeTables = query.list();
-            if (dischargeTables.isEmpty()) {
-                peer = new DischargeTable(gauge, description, null, kind, ti);
-                session.save(peer);
-            }
-            else {
-                peer = dischargeTables.get(0);
-            }
-        }
-
-        return peer;
-    }
-
-
-    public void storeDependencies(Gauge gauge) {
-        log.info("store discharge table '" + description + "'");
-        storeDischargeTableValues(gauge);
-    }
-
-
-    public void storeDischargeTableValues(Gauge gauge) {
-        DischargeTable dischargeTable = getPeer(gauge);
-
-        for (ImportDischargeTableValue value: dischargeTableValues) {
-            value.getPeer(dischargeTable);
-        }
-    }
-}
-// vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 :
--- a/flys-backend/src/main/java/de/intevation/flys/importer/ImportDischargeTableValue.java	Thu Apr 25 11:48:36 2013 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,34 +0,0 @@
-package de.intevation.flys.importer;
-
-import java.math.BigDecimal;
-
-import de.intevation.flys.model.DischargeTable;
-import de.intevation.flys.model.DischargeTableValue;
-
-
-public class ImportDischargeTableValue
-{
-    private BigDecimal q;
-    private BigDecimal w;
-
-    private DischargeTableValue peer;
-
-    public ImportDischargeTableValue() {
-    }
-
-
-    public ImportDischargeTableValue(BigDecimal q, BigDecimal w) {
-        this.q = q;
-        this.w = w;
-    }
-
-
-    public DischargeTableValue getPeer(DischargeTable dischargeTable) {
-        if (peer == null) {
-            peer = ImporterSession.getInstance()
-                .getDischargeTableValue(dischargeTable, q, w);
-        }
-
-        return peer;
-    }
-}
--- a/flys-backend/src/main/java/de/intevation/flys/importer/ImportDischargeZone.java	Thu Apr 25 11:48:36 2013 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,86 +0,0 @@
-package de.intevation.flys.importer;
-
-import java.math.BigDecimal;
-import java.util.List;
-
-import org.apache.log4j.Logger;
-
-import org.hibernate.Session;
-import org.hibernate.Query;
-
-import de.intevation.flys.model.DischargeZone;
-import de.intevation.flys.model.River;
-
-
-public class ImportDischargeZone {
-
-    private static final Logger log =
-        Logger.getLogger(ImportDischargeZone.class);
-
-
-    private String gaugeName;
-
-    private BigDecimal value;
-
-    private String lowerDischarge;
-    private String upperDischarge;
-
-    private DischargeZone peer;
-
-
-    public ImportDischargeZone(
-        String     gaugeName,
-        BigDecimal value,
-        String     lowerDischarge,
-        String     upperDischarge
-    ) {
-        this.gaugeName      = gaugeName;
-        this.value          = value;
-        this.lowerDischarge = lowerDischarge;
-        this.upperDischarge = upperDischarge;
-    }
-
-
-    public void storeDependencies(River river) {
-        log.debug("store dependencies");
-
-        getPeer(river);
-    }
-
-
-    public DischargeZone getPeer(River river) {
-        if (peer == null) {
-            Session session = ImporterSession.getInstance().getDatabaseSession();
-
-            Query query = session.createQuery(
-                "from DischargeZone where " +
-                "   river=:river and " +
-                "   gaugeName=:gaugeName and " +
-                "   value=:value"
-            );
-
-            query.setParameter("river", river);
-            query.setParameter("gaugeName", gaugeName);
-            query.setParameter("value", value);
-
-            List<DischargeZone> zone = query.list();
-
-            if (zone.isEmpty()) {
-                peer = new DischargeZone(
-                    river,
-                    gaugeName,
-                    value,
-                    lowerDischarge,
-                    upperDischarge);
-
-                session.save(peer);
-            }
-            else {
-                peer = zone.get(0);
-            }
-        }
-
-        return peer;
-    }
-}
-// vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 :
--- a/flys-backend/src/main/java/de/intevation/flys/importer/ImportEdge.java	Thu Apr 25 11:48:36 2013 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,75 +0,0 @@
-package de.intevation.flys.importer;
-
-import de.intevation.flys.model.Edge;
-
-import org.hibernate.Session;
-import org.hibernate.Query;
-
-import java.util.List;
-
-import java.math.BigDecimal;
-
-public class ImportEdge
-implements   Comparable<ImportEdge>
-{
-    protected BigDecimal top;
-    protected BigDecimal bottom;
-
-    protected Edge peer;
-
-    public ImportEdge() {
-    }
-
-    public ImportEdge(BigDecimal top, BigDecimal bottom) {
-        this.top    = top;
-        this.bottom = bottom;
-    }
-
-    public BigDecimal getTop() {
-        return top;
-    }
-
-    public void setTop(BigDecimal top) {
-        this.top = top;
-    }
-
-    public BigDecimal getBottom() {
-        return bottom;
-    }
-
-    public void setBottom(BigDecimal bottom) {
-        this.bottom = bottom;
-    }
-
-    private static final int compare(BigDecimal a, BigDecimal b) {
-        if (a == null && b != null) return -1;
-        if (a != null && b == null) return +1;
-        if (a == null && b == null) return  0;
-        return a.compareTo(b);
-    }
-
-    public int compareTo(ImportEdge other) {
-        int cmp = compare(top, other.top);
-        return cmp != 0 ? cmp : compare(bottom, other.bottom);
-    }
-
-    public Edge getPeer() {
-        if (peer == null) {
-            Session session = ImporterSession.getInstance().getDatabaseSession();
-            Query query = session.createQuery(
-                "from Edge where top=:top and bottom=:bottom");
-            query.setParameter("top", top);
-            query.setParameter("bottom", bottom);
-            List<Edge> edges = query.list();
-            if (edges.isEmpty()) {
-                peer = new Edge(top, bottom);
-                session.save(peer);
-            }
-            else {
-                peer = edges.get(0);
-            }
-        }
-        return peer;
-    }
-}
-// vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 :
--- a/flys-backend/src/main/java/de/intevation/flys/importer/ImportElevationModel.java	Thu Apr 25 11:48:36 2013 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,64 +0,0 @@
-package de.intevation.flys.importer;
-
-import java.util.List;
-
-import org.apache.log4j.Logger;
-
-import org.hibernate.Session;
-import org.hibernate.Query;
-
-import de.intevation.flys.model.ElevationModel;
-
-
-public class ImportElevationModel {
-
-    private static final Logger log =
-        Logger.getLogger(ImportElevationModel.class);
-
-    protected String name;
-
-    protected ImportUnit unit;
-
-    protected ElevationModel peer;
-
-
-    public ImportElevationModel(String name, ImportUnit unit) {
-        this.name = name;
-        this.unit = unit;
-    }
-
-
-    public void storeDependencies() {
-        ElevationModel model = getPeer();
-    }
-
-    public ElevationModel getPeer() {
-        if (unit == null) {
-            log.warn("No elevation model specified.");
-            return null;
-        }
-
-        if (peer == null) {
-            Session session = ImporterSession.getInstance().getDatabaseSession();
-            Query query = session.createQuery(
-                "from ElevationModel where " +
-                "name=:name and unit=:unit");
-            query.setParameter("name", name);
-            query.setParameter("unit", unit.getPeer());
-            List<ElevationModel> models = query.list();
-
-            if (models.isEmpty()) {
-                log.info("Create new ElevationModel DB instance.");
-
-                peer = new ElevationModel(name, unit.getPeer());
-                session.save(peer);
-            }
-            else {
-                peer = models.get(0);
-            }
-        }
-
-        return peer;
-    }
-}
-// vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 :
--- a/flys-backend/src/main/java/de/intevation/flys/importer/ImportFlowVelocityMeasurement.java	Thu Apr 25 11:48:36 2013 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,82 +0,0 @@
-package de.intevation.flys.importer;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import org.apache.log4j.Logger;
-
-import org.hibernate.Session;
-import org.hibernate.Query;
-
-import de.intevation.flys.model.FlowVelocityMeasurement;
-import de.intevation.flys.model.River;
-
-
-public class ImportFlowVelocityMeasurement {
-
-    private static final Logger log = Logger
-        .getLogger(ImportFlowVelocityMeasurement.class);
-
-    private String description;
-
-    private List<ImportFlowVelocityMeasurementValue> values;
-
-    private FlowVelocityMeasurement peer;
-
-    public ImportFlowVelocityMeasurement() {
-        this(null);
-    }
-
-    public ImportFlowVelocityMeasurement(String description) {
-        this.description = description;
-        this.values = new ArrayList<ImportFlowVelocityMeasurementValue>();
-    }
-
-    public void setDescription(String description) {
-        this.description = description;
-    }
-
-    public void addValue(ImportFlowVelocityMeasurementValue value) {
-        this.values.add(value);
-    }
-
-    public void storeDependencies(River river) {
-        log.debug("store dependencies");
-
-        FlowVelocityMeasurement peer = getPeer(river);
-
-        if (peer != null) {
-            for (ImportFlowVelocityMeasurementValue value : values) {
-                value.storeDependencies(peer);
-            }
-        }
-    }
-
-    public FlowVelocityMeasurement getPeer(River river) {
-        if (peer == null) {
-            Session session = ImporterSession.getInstance()
-                .getDatabaseSession();
-
-            Query query = session
-                .createQuery("from FlowVelocityMeasurement where "
-                    + "   river=:river and " + "   description=:description");
-
-            query.setParameter("river", river);
-            query.setParameter("description", description);
-
-            List<FlowVelocityMeasurement> measurement = query.list();
-
-            if (measurement.isEmpty()) {
-                peer = new FlowVelocityMeasurement(river, description);
-
-                session.save(peer);
-            }
-            else {
-                peer = measurement.get(0);
-            }
-        }
-
-        return peer;
-    }
-}
-// vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 :
--- a/flys-backend/src/main/java/de/intevation/flys/importer/ImportFlowVelocityMeasurementValue.java	Thu Apr 25 11:48:36 2013 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,97 +0,0 @@
-package de.intevation.flys.importer;
-
-import java.math.BigDecimal;
-
-import java.util.Date;
-import java.util.List;
-
-import org.apache.log4j.Logger;
-
-import org.hibernate.Session;
-import org.hibernate.Query;
-
-import de.intevation.flys.model.FlowVelocityMeasurement;
-import de.intevation.flys.model.FlowVelocityMeasurementValue;
-
-
-public class ImportFlowVelocityMeasurementValue {
-
-    private static final Logger log =
-        Logger.getLogger(ImportFlowVelocityMeasurementValue.class);
-
-
-    private Date datetime;
-
-    private String description;
-
-    private BigDecimal station;
-    private BigDecimal w;
-    private BigDecimal q;
-    private BigDecimal v;
-
-    private FlowVelocityMeasurementValue peer;
-
-
-    public ImportFlowVelocityMeasurementValue(
-        Date       datetime,
-        BigDecimal station,
-        BigDecimal w,
-        BigDecimal q,
-        BigDecimal v,
-        String     description
-    ) {
-        this.datetime    = datetime;
-        this.station     = station;
-        this.w           = w;
-        this.q           = q;
-        this.v           = v;
-        this.description = description;
-    }
-
-
-
-    public void storeDependencies(FlowVelocityMeasurement measurement) {
-        log.debug("store dependencies");
-
-        getPeer(measurement);
-    }
-
-
-    public FlowVelocityMeasurementValue getPeer(FlowVelocityMeasurement m) {
-        if (peer == null) {
-            Session session = ImporterSession.getInstance().getDatabaseSession();
-
-            Query query = session.createQuery(
-                "from FlowVelocityMeasurementValue where " +
-                "   measurement=:measurement and " +
-                "   station=:station and " +
-                "   datetime=:datetime"
-            );
-
-            query.setParameter("measurement", m);
-            query.setParameter("station", station);
-            query.setParameter("datetime", datetime);
-
-            List<FlowVelocityMeasurementValue> values = query.list();
-
-            if (values.isEmpty()) {
-                peer = new FlowVelocityMeasurementValue(
-                    m,
-                    datetime,
-                    station,
-                    w,
-                    q,
-                    v,
-                    description);
-
-                session.save(peer);
-            }
-            else {
-                peer = values.get(0);
-            }
-        }
-
-        return peer;
-    }
-}
-// vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 :
--- a/flys-backend/src/main/java/de/intevation/flys/importer/ImportFlowVelocityModel.java	Thu Apr 25 11:48:36 2013 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,109 +0,0 @@
-package de.intevation.flys.importer;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import org.apache.log4j.Logger;
-
-import org.hibernate.Session;
-import org.hibernate.Query;
-
-import de.intevation.flys.model.DischargeZone;
-import de.intevation.flys.model.FlowVelocityModel;
-import de.intevation.flys.model.River;
-
-
-public class ImportFlowVelocityModel {
-
-    private static final Logger log = Logger
-        .getLogger(ImportFlowVelocityModel.class);
-
-    private String description;
-
-    private ImportDischargeZone dischargeZone;
-
-    private List<ImportFlowVelocityModelValue> values;
-
-    private FlowVelocityModel peer;
-
-    public ImportFlowVelocityModel() {
-        values = new ArrayList<ImportFlowVelocityModelValue>();
-    }
-
-    public ImportFlowVelocityModel(String description) {
-        this();
-
-        this.description = description;
-    }
-
-    public ImportFlowVelocityModel(ImportDischargeZone dischargeZone,
-        String description) {
-        this();
-
-        this.dischargeZone = dischargeZone;
-        this.description = description;
-    }
-
-    public void setDischargeZone(ImportDischargeZone dischargeZone) {
-        this.dischargeZone = dischargeZone;
-    }
-
-    public void setDescription(String description) {
-        this.description = description;
-    }
-
-    public void addValue(ImportFlowVelocityModelValue value) {
-        this.values.add(value);
-    }
-
-    public void storeDependencies(River river) {
-        log.debug("store dependencies");
-
-        if (dischargeZone == null) {
-            log.warn("skip flow velocity model: No discharge zone specified.");
-            return;
-        }
-
-        dischargeZone.storeDependencies(river);
-
-        FlowVelocityModel peer = getPeer(river);
-
-        if (peer != null) {
-            int i = 0;
-
-            for (ImportFlowVelocityModelValue value : values) {
-                value.storeDependencies(peer);
-                i++;
-            }
-
-            log.info("stored " + i + " flow velocity model values.");
-        }
-    }
-
-    public FlowVelocityModel getPeer(River river) {
-        if (peer == null) {
-            Session session = ImporterSession.getInstance()
-                .getDatabaseSession();
-
-            DischargeZone zone = dischargeZone.getPeer(river);
-
-            Query query = session.createQuery("from FlowVelocityModel where "
-                + "   dischargeZone=:dischargeZone");
-
-            query.setParameter("dischargeZone", zone);
-
-            List<FlowVelocityModel> model = query.list();
-
-            if (model.isEmpty()) {
-                peer = new FlowVelocityModel(zone, description);
-                session.save(peer);
-            }
-            else {
-                peer = model.get(0);
-            }
-        }
-
-        return peer;
-    }
-}
-// vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 :
--- a/flys-backend/src/main/java/de/intevation/flys/importer/ImportFlowVelocityModelValue.java	Thu Apr 25 11:48:36 2013 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,74 +0,0 @@
-package de.intevation.flys.importer;
-
-import java.math.BigDecimal;
-
-import java.util.List;
-
-import org.hibernate.Session;
-import org.hibernate.Query;
-
-import de.intevation.flys.model.FlowVelocityModel;
-import de.intevation.flys.model.FlowVelocityModelValue;
-
-
-public class ImportFlowVelocityModelValue {
-
-    private BigDecimal station;
-    private BigDecimal q;
-    private BigDecimal totalChannel;
-    private BigDecimal mainChannel;
-    private BigDecimal shearStress;
-
-    private FlowVelocityModelValue peer;
-
-
-    public ImportFlowVelocityModelValue(
-        BigDecimal station,
-        BigDecimal q,
-        BigDecimal totalChannel,
-        BigDecimal mainChannel,
-        BigDecimal shearStress
-    ) {
-        this.station      = station;
-        this.q            = q;
-        this.totalChannel = totalChannel;
-        this.mainChannel  = mainChannel;
-        this.shearStress  = shearStress;
-    }
-
-
-    public void storeDependencies(FlowVelocityModel model) {
-        getPeer(model);
-    }
-
-
-    public FlowVelocityModelValue getPeer(FlowVelocityModel model) {
-        if (peer == null) {
-            Session session = ImporterSession.getInstance().getDatabaseSession();
-
-            Query query = session.createQuery(
-                "from FlowVelocityModelValue where " +
-                "   flowVelocity=:model and " +
-                "   station between :station - 0.00001 and :station + 0.00001"
-            );
-
-            query.setParameter("model", model);
-            query.setParameter("station", station.doubleValue());
-
-            List<FlowVelocityModelValue> values = query.list();
-
-            if (values.isEmpty()) {
-                peer = new FlowVelocityModelValue(
-                    model, station, q, totalChannel, mainChannel, shearStress);
-
-                session.save(peer);
-            }
-            else {
-                peer = values.get(0);
-            }
-        }
-
-        return peer;
-    }
-}
-// vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 :
--- a/flys-backend/src/main/java/de/intevation/flys/importer/ImportGauge.java	Thu Apr 25 11:48:36 2013 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,274 +0,0 @@
-package de.intevation.flys.importer;
-
-import java.io.File;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import java.math.BigDecimal;
-
-import de.intevation.artifacts.common.utils.FileTools;
-
-import de.intevation.flys.model.River;
-import de.intevation.flys.model.Gauge;
-
-import org.hibernate.Session;
-import org.hibernate.Query;
-
-import java.io.IOException;
-
-import org.apache.log4j.Logger;
-
-import de.intevation.flys.importer.parsers.AtFileParser;
-import de.intevation.flys.importer.parsers.StaFileParser;
-
-/** Gauge not in DB. */
-public class ImportGauge
-{
-    private static Logger log = Logger.getLogger(ImportGauge.class);
-
-    public static final String HISTORICAL_DISCHARGE_TABLES =
-        "Histor.Abflusstafeln";
-
-    protected ImportRange range;
-
-    protected File        staFile;
-    protected File        atFile;
-
-    protected String      name;
-    protected BigDecimal  aeo;
-    protected BigDecimal  datum;
-    protected BigDecimal  station;
-    protected Long        officialNumber;
-
-    protected Gauge  peer;
-
-    protected ImportDischargeTable dischargeTable;
-
-    protected List<ImportMainValueType>  mainValueTypes;
-    protected List<ImportNamedMainValue> namedMainValues;
-    protected List<ImportMainValue>      mainValues;
-    protected List<ImportDischargeTable> historicalDischargeTables;
-
-    public ImportGauge() {
-        historicalDischargeTables = new ArrayList<ImportDischargeTable>();
-    }
-
-    public ImportGauge(ImportRange range, File staFile, File atFile) {
-        this();
-        this.range   = range;
-        this.staFile = staFile;
-        this.atFile  = atFile;
-    }
-
-    public void setRange(ImportRange range) {
-        this.range = range;
-    }
-
-    public void setStaFile(File staFile) {
-        this.staFile = staFile;
-    }
-
-    public File getStaFile() {
-        return staFile;
-    }
-
-    public void setAtFile(File atFile) {
-        this.atFile = atFile;
-    }
-
-    public File getAtFile() {
-        return atFile;
-    }
-
-    public BigDecimal getAeo() {
-        return aeo;
-    }
-
-    public void setAeo(BigDecimal aeo) {
-        this.aeo = aeo;
-    }
-
-    public String getName() {
-        return name;
-    }
-
-    public void setName(String name) {
-        this.name = name;
-    }
-
-    public BigDecimal getDatum() {
-        return datum;
-    }
-
-    public void setDatum(BigDecimal datum) {
-        this.datum = datum;
-    }
-
-    public BigDecimal getStation() {
-        return station;
-    }
-
-    public void setStation(BigDecimal station) {
-        this.station = station;
-    }
-
-    public Long getOfficialNumber() {
-        return officialNumber;
-    }
-
-    public void setOfficialNumber(Long officialNumber) {
-        this.officialNumber = officialNumber;
-    }
-
-    public ImportDischargeTable getDischargeTable() {
-        return dischargeTable;
-    }
-
-    public void setDischargeTable(ImportDischargeTable dischargeTable) {
-        this.dischargeTable = dischargeTable;
-    }
-
-    public List<ImportMainValueType> getMainValueTypes() {
-        return mainValueTypes;
-    }
-
-    public void setMainValueTypes(List<ImportMainValueType> mainValueTypes) {
-        this.mainValueTypes = mainValueTypes;
-    }
-
-    public List<ImportNamedMainValue> getNamedMainValues() {
-        return namedMainValues;
-    }
-
-    public void setNamedMainValues(List<ImportNamedMainValue> namedMainValues) {
-        this.namedMainValues = namedMainValues;
-    }
-
-    public List<ImportMainValue> getMainValues() {
-        return mainValues;
-    }
-
-    public void setMainValues(List<ImportMainValue> mainValues) {
-        this.mainValues = mainValues;
-    }
-
-    public void parseDependencies() throws IOException {
-        StaFileParser sfp = new StaFileParser();
-        sfp.parse(this);
-
-        AtFileParser afp = new AtFileParser();
-        setDischargeTable(afp.parse(getAtFile()));
-        parseHistoricalDischargeTables();
-    }
-
-    public void parseHistoricalDischargeTables() throws IOException {
-        if (Config.INSTANCE.skipHistoricalDischargeTables()) {
-            log.info("skip historical discharge tables");
-            return;
-        }
-
-        log.info("parse historical discharge tables");
-
-        File riverDir = atFile.getParentFile().getParentFile();
-
-        File histDischargeDir = FileTools.repair(
-            new File(riverDir, HISTORICAL_DISCHARGE_TABLES));
-
-        if (!histDischargeDir.isDirectory() || !histDischargeDir.canRead()) {
-            log.info("cannot find '" + histDischargeDir + "'");
-            return;
-        }
-
-        histDischargeDir = FileTools.repair(
-            new File(histDischargeDir, getName()));
-
-        if (!histDischargeDir.isDirectory() || !histDischargeDir.canRead()) {
-            log.info("cannot find '" + histDischargeDir + "'");
-            return;
-        }
-
-        File [] files = histDischargeDir.listFiles();
-
-        if (files == null) {
-            log.info("cannot read directory '" + histDischargeDir + "'");
-            return;
-        }
-
-        for (File file: files) {
-            if (!file.isFile() || !file.canRead()) {
-                continue;
-            }
-            String name = file.getName().toLowerCase();
-            if (!name.endsWith(".at")) {
-                continue;
-            }
-            log.info("found at file '" + file.getName() + "'");
-
-            AtFileParser afp = new AtFileParser();
-            historicalDischargeTables.add(
-                afp.parse(file, HISTORICAL_DISCHARGE_TABLES + "/", 1));
-        }
-    }
-
-    public void storeDependencies(River river) {
-
-        Gauge gauge = getPeer(river);
-
-        log.info("store main value types");
-        for (ImportMainValueType mainValueType: mainValueTypes) {
-            mainValueType.getPeer();
-        }
-
-        log.info("store named main values");
-        for (ImportNamedMainValue namedMainValue: namedMainValues) {
-            namedMainValue.getPeer();
-        }
-
-        log.info("store main values");
-        for (ImportMainValue mainValue: mainValues) {
-            mainValue.getPeer(river);
-        }
-
-        storeDischargeTable(gauge);
-        storeHistoricalDischargeTable(gauge);
-    }
-
-    public void storeDischargeTable(Gauge gauge) {
-        log.info("store discharge table");
-        dischargeTable.getPeer(gauge);
-        dischargeTable.storeDependencies(gauge);
-    }
-
-    public void storeHistoricalDischargeTable(Gauge gauge) {
-        log.info("store historical discharge tables");
-        for (ImportDischargeTable hdt: historicalDischargeTables) {
-            hdt.storeDependencies(gauge);
-        }
-    }
-
-    public Gauge getPeer(River river) {
-        if (peer == null) {
-            Session session = ImporterSession.getInstance().getDatabaseSession();
-            Query query = session.createQuery(
-                "from Gauge where name=:name " +
-                "and river.id=:river");
-            query.setString("name", name);
-            query.setParameter("river", river.getId());
-            List<Gauge> gauges = query.list();
-            if (gauges.isEmpty()) {
-                peer = new Gauge(
-                    name, river,
-                    station, aeo, datum,
-                    officialNumber,
-                    range.getPeer(river));
-                session.save(peer);
-            }
-            else {
-                peer = gauges.get(0);
-            }
-        }
-        return peer;
-    }
-}
-// vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 :
--- a/flys-backend/src/main/java/de/intevation/flys/importer/ImportGrainFraction.java	Thu Apr 25 11:48:36 2013 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,80 +0,0 @@
-package de.intevation.flys.importer;
-
-import java.util.List;
-
-import org.apache.log4j.Logger;
-
-import org.hibernate.Session;
-import org.hibernate.Query;
-
-import de.intevation.flys.model.GrainFraction;
-
-
-public class ImportGrainFraction {
-
-    private static final Logger log =
-        Logger.getLogger(ImportGrainFraction.class);
-
-    private String name;
-
-    private Double lower;
-    private Double upper;
-
-    private GrainFraction peer;
-
-
-    public ImportGrainFraction(String name) {
-        this.name = name;
-    }
-
-
-    public ImportGrainFraction(
-        String     name,
-        Double     lower,
-        Double     upper
-    ) {
-        this.name  = name;
-        this.lower = lower;
-        this.upper = upper;
-    }
-
-
-    public void storeDependencies() {
-        log.debug("store dependencies");
-
-        getPeer();
-    }
-
-
-    public GrainFraction getPeer() {
-        log.debug("get peer");
-
-        if (peer == null) {
-            Session session = ImporterSession.getInstance().getDatabaseSession();
-            Query query = session.createQuery(
-                "from GrainFraction where " +
-                "   name=:name and " +
-                "   lower=:lower and " +
-                "   upper=:upper"
-            );
-
-            query.setParameter("name", name);
-            query.setParameter("lower", lower);
-            query.setParameter("upper", upper);
-
-            List<GrainFraction> fractions = query.list();
-            if (fractions.isEmpty()) {
-                log.info("create new GrainFraction");
-
-                peer = new GrainFraction(name, lower, upper);
-                session.save(peer);
-            }
-            else {
-                peer = fractions.get(0);
-            }
-        }
-
-        return peer;
-    }
-}
-// vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 :
--- a/flys-backend/src/main/java/de/intevation/flys/importer/ImportHYK.java	Thu Apr 25 11:48:36 2013 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,80 +0,0 @@
-package de.intevation.flys.importer;
-
-import de.intevation.flys.model.HYK;
-import de.intevation.flys.model.River;
-
-import java.util.List;
-import java.util.ArrayList;
-
-import org.hibernate.Session;
-import org.hibernate.Query;
-
-import org.apache.log4j.Logger;
-
-public class ImportHYK
-{
-    private static Logger log = Logger.getLogger(ImportHYK.class);
-
-    protected ImportRiver river;
-    protected String      description;
-
-    protected List<ImportHYKEntry> entries;
-
-    protected HYK peer;
-
-    public ImportHYK() {
-        entries = new ArrayList<ImportHYKEntry>();
-    }
-
-    public ImportHYK(ImportRiver river, String description) {
-        this();
-        this.river       = river;
-        this.description = description;
-    }
-
-    public ImportRiver getRiver() {
-        return river;
-    }
-
-    public void setRiver(ImportRiver river) {
-        this.river = river;
-    }
-
-    public void addEntry(ImportHYKEntry entry) {
-        entries.add(entry);
-        entry.setHYK(this);
-    }
-
-    public void storeDependencies() {
-        log.info("store HYK '" + description + "'");
-        getPeer();
-        for (int i = 0, N = entries.size(); i < N; ++i) {
-            ImportHYKEntry entry = entries.get(i);
-            log.info("  store km " + entry.getKm() +
-                " (" + (i+1) + " of " + N + ")");
-            entry.storeDependencies();
-        }
-    }
-
-    public HYK getPeer() {
-        if (peer == null) {
-            River r = river.getPeer();
-            Session session = ImporterSession.getInstance()
-                .getDatabaseSession();
-            Query query = session.createQuery(
-                "from HYK where river=:river and description=:description");
-            query.setParameter("river", r);
-            query.setParameter("description", description);
-            List<HYK> hyks = query.list();
-            if (hyks.isEmpty()) {
-                peer = new HYK(r, description);
-                session.save(peer);
-            }
-            else {
-                peer = hyks.get(0);
-            }
-        }
-        return peer;
-    }
-}
-// vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 :
--- a/flys-backend/src/main/java/de/intevation/flys/importer/ImportHYKEntry.java	Thu Apr 25 11:48:36 2013 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,93 +0,0 @@
-package de.intevation.flys.importer;
-
-import de.intevation.flys.model.HYKEntry;
-import de.intevation.flys.model.HYK;
-
-import java.util.Date;
-import java.util.List;
-import java.util.ArrayList;
-
-import java.math.BigDecimal;
-
-import org.hibernate.Session;
-import org.hibernate.Query;
-
-public class ImportHYKEntry
-{
-    protected ImportHYK  hyk;
-    protected BigDecimal km;
-    protected Date       measure;
-
-    protected List<ImportHYKFormation> formations;
-
-    protected HYKEntry peer;
-
-    public ImportHYKEntry() {
-        formations = new ArrayList<ImportHYKFormation>();
-    }
-
-    public ImportHYKEntry(
-        ImportHYK  hyk,
-        BigDecimal km,
-        Date       measure
-    ) {
-        this();
-        this.hyk     = hyk;
-        this.km      = km;
-        this.measure = measure;
-    }
-
-    public ImportHYK getHYK() {
-        return hyk;
-    }
-
-    public void setHYK(ImportHYK hyk) {
-        this.hyk = hyk;
-    }
-
-    public BigDecimal getKm() {
-        return km;
-    }
-
-    public void setKm(BigDecimal km) {
-        this.km = km;
-    }
-
-    public void addFormation(ImportHYKFormation formation) {
-        int numFormation = formations.size();
-        formations.add(formation);
-        formation.setFormationNum(numFormation);
-        formation.setEntry(this);
-    }
-
-    public void storeDependencies() {
-        getPeer();
-        for (ImportHYKFormation formation: formations) {
-            formation.storeDependencies();
-        }
-    }
-
-    public HYKEntry getPeer() {
-        if (peer == null) {
-            HYK h = hyk.getPeer();
-            Session session = ImporterSession.getInstance()
-                .getDatabaseSession();
-            Query query = session.createQuery(
-                "from HYKEntry where HYK=:hyk " +
-                "and km=:km and measure=:measure");
-            query.setParameter("hyk", h);
-            query.setParameter("km", km);
-            query.setParameter("measure", measure);
-            List<HYKEntry> entries = query.list();
-            if (entries.isEmpty()) {
-                peer = new HYKEntry(h, km, measure);
-                session.save(peer);
-            }
-            else {
-                peer = entries.get(0);
-            }
-        }
-        return peer;
-    }
-}
-// vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 :
--- a/flys-backend/src/main/java/de/intevation/flys/importer/ImportHYKFlowZone.java	Thu Apr 25 11:48:36 2013 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,76 +0,0 @@
-package de.intevation.flys.importer;
-
-import de.intevation.flys.model.HYKFormation;
-import de.intevation.flys.model.HYKFlowZone;
-import de.intevation.flys.model.HYKFlowZoneType;
-
-import org.hibernate.Session;
-import org.hibernate.Query;
-
-import java.util.List;
-
-import java.math.BigDecimal;
-
-public class ImportHYKFlowZone
-{
-    protected ImportHYKFormation    formation;
-    protected ImportHYKFlowZoneType type;
-    protected BigDecimal            a;
-    protected BigDecimal            b;
-
-    protected HYKFlowZone peer;
-
-    public ImportHYKFlowZone() {
-    }
-
-    public ImportHYKFlowZone(
-        ImportHYKFormation    formation,
-        ImportHYKFlowZoneType type,
-        BigDecimal            a,
-        BigDecimal            b
-    ) {
-        this.formation = formation;
-        this.type      = type;
-        this.a         = a;
-        this.b         = b;
-    }
-
-    public ImportHYKFormation getFormation() {
-        return formation;
-    }
-
-    public void setFormation(ImportHYKFormation formation) {
-        this.formation = formation;
-    }
-
-    public void storeDependencies() {
-        getPeer();
-    }
-
-    public HYKFlowZone getPeer() {
-        if (peer == null) {
-            HYKFormation    f = formation.getPeer();
-            HYKFlowZoneType t = type.getPeer();
-            Session session = ImporterSession.getInstance()
-                .getDatabaseSession();
-            Query query = session.createQuery(
-                "from HYKFlowZone where formation=:formation " +
-                "and type=:type and a=:a and b=:b");
-            query.setParameter("formation", f);
-            query.setParameter("type", t);
-            query.setParameter("a", a);
-            query.setParameter("b", b);
-            List<HYKFlowZone> zones = query.list();
-            if (zones.isEmpty()) {
-                peer = new HYKFlowZone(f, t, a, b);
-                session.save(peer);
-            }
-            else {
-                peer = zones.get(0);
-            }
-
-        }
-        return peer;
-    }
-}
-// vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 :
--- a/flys-backend/src/main/java/de/intevation/flys/importer/ImportHYKFlowZoneType.java	Thu Apr 25 11:48:36 2013 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,41 +0,0 @@
-package de.intevation.flys.importer;
-
-import de.intevation.flys.model.HYKFlowZoneType;
-
-import org.hibernate.Session;
-import org.hibernate.Query;
-
-import java.util.List;
-
-public class ImportHYKFlowZoneType
-{
-    private String          name;
-    private HYKFlowZoneType peer;
-
-    public ImportHYKFlowZoneType() {
-    }
-
-    public ImportHYKFlowZoneType(String name) {
-        this.name = name;
-    }
-
-    public HYKFlowZoneType getPeer() {
-        if (peer == null) {
-            Session session = ImporterSession.getInstance()
-                .getDatabaseSession();
-            Query query = session.createQuery(
-                "from HYKFlowZoneType where name=:name");
-            query.setParameter("name", name);
-            List<HYKFlowZoneType> flowZoneTypes = query.list();
-            if (flowZoneTypes.isEmpty()) {
-                peer = new HYKFlowZoneType(name);
-                session.save(peer);
-            }
-            else {
-                peer = flowZoneTypes.get(0);
-            }
-        }
-        return peer;
-    }
-}
-// vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 :
--- a/flys-backend/src/main/java/de/intevation/flys/importer/ImportHYKFormation.java	Thu Apr 25 11:48:36 2013 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,150 +0,0 @@
-package de.intevation.flys.importer;
-
-import de.intevation.flys.model.HYKFormation;
-import de.intevation.flys.model.HYKEntry;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import org.hibernate.Session;
-import org.hibernate.Query;
-
-import java.math.BigDecimal;
-
-public class ImportHYKFormation
-{
-    protected int            formationNum;
-    protected ImportHYKEntry entry;
-    protected BigDecimal     top;
-    protected BigDecimal     bottom;
-    protected BigDecimal     distanceVL;
-    protected BigDecimal     distanceHF;
-    protected BigDecimal     distanceVR;
-
-    protected List<ImportHYKFlowZone> zones;
-
-    protected HYKFormation peer;
-
-    public ImportHYKFormation() {
-        zones = new ArrayList<ImportHYKFlowZone>();
-    }
-
-    public ImportHYKFormation(
-        int            formationNum,
-        ImportHYKEntry entry,
-        BigDecimal     top,
-        BigDecimal     bottom,
-        BigDecimal     distanceVL,
-        BigDecimal     distanceHF,
-        BigDecimal     distanceVR
-    ) {
-        this();
-        this.formationNum = formationNum;
-        this.entry        = entry;
-        this.top          = top;
-        this.bottom       = bottom;
-        this.distanceVL   = distanceVL;
-        this.distanceHF   = distanceHF;
-        this.distanceVR   = distanceVR;
-    }
-
-    public void addFlowZone(ImportHYKFlowZone zone) {
-        zones.add(zone);
-        zone.setFormation(this);
-    }
-
-    public int getFormationNum() {
-        return formationNum;
-    }
-
-    public void setFormationNum(int formationNum) {
-        this.formationNum = formationNum;
-    }
-
-    public ImportHYKEntry getEntry() {
-        return entry;
-    }
-
-    public void setEntry(ImportHYKEntry entry) {
-        this.entry = entry;
-    }
-
-    public BigDecimal getTop() {
-        return top;
-    }
-
-    public void setTop(BigDecimal top) {
-        this.top = top;
-    }
-
-    public BigDecimal getBottom() {
-        return bottom;
-    }
-
-    public void setBottom(BigDecimal bottom) {
-        this.bottom = bottom;
-    }
-
-    public BigDecimal getDistanceVL() {
-        return distanceVL;
-    }
-
-    public void setDistanceVL(BigDecimal distanceVL) {
-        this.distanceVL = distanceVL;
-    }
-
-    public BigDecimal getDistanceHF() {
-        return distanceHF;
-    }
-
-    public void setDistanceHF(BigDecimal distanceHF) {
-        this.distanceHF = distanceHF;
-    }
-
-    public BigDecimal getDistanceVR() {
-        return distanceVR;
-    }
-
-    public void setDistanceVR(BigDecimal distanceVR) {
-        this.distanceVR = distanceVR;
-    }
-
-    public void storeDependencies() {
-        getPeer();
-        for (ImportHYKFlowZone zone: zones) {
-            zone.storeDependencies();
-        }
-    }
-
-    public HYKFormation getPeer() {
-        if (peer == null) {
-            HYKEntry e = entry.getPeer();
-            Session session = ImporterSession.getInstance()
-                .getDatabaseSession();
-            Query query = session.createQuery(
-                "from HYKFormation where formationNum=:formationNum " +
-                "and entry=:entry and top=:top and bottom=:bottom " +
-                "and distanceVL=:distanceVL and distanceHF=:distanceHF " +
-                "and distanceVR=:distanceVR");
-            query.setParameter("formationNum", formationNum);
-            query.setParameter("entry", e);
-            query.setParameter("top", top);
-            query.setParameter("bottom", bottom);
-            query.setParameter("distanceVL", distanceVL);
-            query.setParameter("distanceHF", distanceHF);
-            query.setParameter("distanceVR", distanceVR);
-            List<HYKFormation> formations = query.list();
-            if (formations.isEmpty()) {
-                peer = new HYKFormation(
-                    formationNum, e, top, bottom,
-                    distanceVL, distanceHF, distanceVR);
-                session.save(peer);
-            }
-            else {
-                peer = formations.get(0);
-            }
-        }
-        return peer;
-    }
-}
-// vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 :
--- a/flys-backend/src/main/java/de/intevation/flys/importer/ImportLocationSystem.java	Thu Apr 25 11:48:36 2013 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,60 +0,0 @@
-package de.intevation.flys.importer;
-
-import java.util.List;
-
-import org.apache.log4j.Logger;
-
-import org.hibernate.Session;
-import org.hibernate.Query;
-
-import de.intevation.flys.model.LocationSystem;
-
-
-public class ImportLocationSystem {
-
-    private static final Logger log =
-        Logger.getLogger(ImportLocationSystem.class);
-
-
-    protected String name;
-    protected String description;
-
-    protected LocationSystem peer;
-
-
-    public ImportLocationSystem(String name, String description) {
-        this.name        = name;
-        this.description = description;
-    }
-
-    public void storeDependencies() {
-        log.info("store LocationSystem '" + name + "'");
-        LocationSystem ls = getPeer();
-
-        Session session = ImporterSession.getInstance().getDatabaseSession();
-        session.flush();
-    }
-
-    public LocationSystem getPeer() {
-        if (peer == null) {
-            Session session = ImporterSession.getInstance().getDatabaseSession();
-            Query query = session.createQuery(
-                "from LocationSystem where " +
-                "name=:name and description=:description");
-            query.setParameter("name", name);
-            query.setParameter("description", description);
-
-            List<LocationSystem> lss = query.list();
-            if (lss.isEmpty()) {
-                peer = new LocationSystem(name, description);
-                session.save(peer);
-            }
-            else {
-                peer = lss.get(0);
-            }
-        }
-
-        return peer;
-    }
-}
-// vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 :
--- a/flys-backend/src/main/java/de/intevation/flys/importer/ImportMainValue.java	Thu Apr 25 11:48:36 2013 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,92 +0,0 @@
-package de.intevation.flys.importer;
-
-import java.util.List;
-
-import java.math.BigDecimal;
-
-import de.intevation.flys.model.MainValue;
-import de.intevation.flys.model.Gauge;
-import de.intevation.flys.model.River;
-import de.intevation.flys.model.NamedMainValue;
-import de.intevation.flys.model.TimeInterval;
-
-import org.hibernate.Session;
-import org.hibernate.Query;
-
-public class ImportMainValue
-{
-    protected ImportGauge          gauge;
-    protected ImportNamedMainValue mainValue;
-    protected BigDecimal           value;
-    protected ImportTimeInterval   timeInterval;
-
-    protected MainValue peer;
-
-    public ImportMainValue() {
-    }
-
-    public ImportMainValue(
-        ImportGauge          gauge,
-        ImportNamedMainValue mainValue,
-        BigDecimal           value,
-        ImportTimeInterval   timeInterval
-    ) {
-        this.gauge        = gauge;
-        this.mainValue    = mainValue;
-        this.value        = value;
-        this.timeInterval = timeInterval;
-    }
-
-    public ImportGauge getGauge() {
-        return gauge;
-    }
-
-    public void setGauge(ImportGauge gauge) {
-        this.gauge = gauge;
-    }
-
-    public ImportNamedMainValue getMainValue() {
-        return mainValue;
-    }
-
-    public void setMainValue(ImportNamedMainValue mainValue) {
-        this.mainValue = mainValue;
-    }
-
-    public BigDecimal getValue() {
-        return value;
-    }
-
-    public void setValue(BigDecimal value) {
-        this.value = value;
-    }
-
-    public MainValue getPeer(River river) {
-        if (peer == null) {
-            Session session = ImporterSession.getInstance().getDatabaseSession();
-            Query query = session.createQuery("from MainValue where "
-                + "gauge.id=:gauge_id and mainValue.id=:name_id "
-                + "and timeInterval = :time "
-                + "and value=:value");
-            Gauge          g = gauge.getPeer(river);
-            NamedMainValue n = mainValue.getPeer();
-            TimeInterval   t = timeInterval != null
-                ? timeInterval.getPeer()
-                : null;
-            query.setParameter("gauge_id", g.getId());
-            query.setParameter("name_id",  n.getId());
-            query.setParameter("value",    value);
-            query.setParameter("time",     t);
-            List<MainValue> values = query.list();
-            if (values.isEmpty()) {
-                peer = new MainValue(g, n, value, null);
-                session.save(peer);
-            }
-            else {
-                peer = values.get(0);
-            }
-        }
-        return peer;
-    }
-}
-// vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 :
--- a/flys-backend/src/main/java/de/intevation/flys/importer/ImportMainValueType.java	Thu Apr 25 11:48:36 2013 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,65 +0,0 @@
-package de.intevation.flys.importer;
-
-import de.intevation.flys.model.MainValueType;
-
-import org.hibernate.Session;
-import org.hibernate.Query;
-
-import java.util.List;
-
-public class ImportMainValueType
-implements   Comparable<ImportMainValueType>
-{
-    protected String name;
-
-    protected MainValueType peer;
-
-    public ImportMainValueType() {
-    }
-
-    public ImportMainValueType(String name) {
-        this.name = name;
-    }
-
-    public String getName() {
-        return name;
-    }
-
-    public void setName(String name) {
-        this.name = name;
-    }
-
-    public int compareTo(ImportMainValueType other) {
-        return name.compareTo(other.name);
-    }
-
-    @Override
-    public boolean equals(Object other) {
-        if (other == this) return true;
-        if (!(other instanceof ImportMainValueType)) return false;
-        return name.equals(((ImportMainValueType)other).name);
-    }
-
-    @Override
-    public int hashCode() {
-        return name.hashCode();
-    }
-
-    public MainValueType getPeer() {
-        if (peer == null) {
-            Session session = ImporterSession.getInstance().getDatabaseSession();
-            Query query = session.createQuery("from MainValueType where name=:name");
-            query.setString("name", name);
-            List<MainValueType> values = query.list();
-            if (values.isEmpty()) {
-                peer = new MainValueType(name);
-                session.save(peer);
-            }
-            else {
-                peer = values.get(0);
-            }
-        }
-        return peer;
-    }
-}
-// vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 :
--- a/flys-backend/src/main/java/de/intevation/flys/importer/ImportMeasurementStation.java	Thu Apr 25 11:48:36 2013 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,113 +0,0 @@
-package de.intevation.flys.importer;
-
-import java.util.List;
-
-import org.apache.log4j.Logger;
-import org.hibernate.Session;
-
-import de.intevation.flys.model.Gauge;
-import de.intevation.flys.model.MeasurementStation;
-import de.intevation.flys.model.Range;
-import de.intevation.flys.model.River;
-import de.intevation.flys.model.TimeInterval;
-
-
-public class ImportMeasurementStation {
-
-    private static final Logger log = Logger
-        .getLogger(ImportMeasurementStation.class);
-
-    private MeasurementStation peer;
-
-    public String name;
-    public Double station;
-    public ImportRange range;
-    public String measurementType;
-    public String riverside;
-    public String gauge;
-    public ImportTimeInterval observationTimerange;
-    public String operator;
-    public String description;
-
-    public ImportMeasurementStation() {
-    }
-
-    private Gauge getGaugeFromDB() {
-        Session session = ImporterSession.getInstance().getDatabaseSession();
-
-        org.hibernate.Query query = session
-            .createQuery("FROM Gauge WHERE name=:name");
-
-        query.setParameter("name", gauge);
-        List<Gauge> gauges = query.list();
-
-        return gauges.isEmpty() ? null : gauges.get(0);
-    }
-
-    public boolean storeDependencies(River river) {
-        getPeer(river);
-
-        return peer != null;
-    }
-
-    public Object getPeer(River river) {
-        if (peer == null) {
-            Gauge gauge = null;
-            try {
-                gauge = getGaugeFromDB();
-                if (gauge == null) {
-                    log.warn("No gauge found for measurement station '" + name
-                        + "'");
-                }
-            }
-            catch (Exception e) {
-                log.error("Exception: " + e.getMessage());
-            }
-
-            Range range = null;
-
-            if (this.range != null) {
-                range = this.range.getPeer(river);
-            }
-
-            if (range == null) {
-                log.warn("No range found for measurement station '" + name + "'");
-            }
-
-            TimeInterval observationTimerange = this.observationTimerange
-                .getPeer();
-            if (observationTimerange == null) {
-                log.warn("No time range found for measurement station '"
-                    + name + "'");
-            }
-
-            Session session = ImporterSession.getInstance()
-                .getDatabaseSession();
-
-            org.hibernate.Query query = session
-                .createQuery(
-                    "FROM MeasurementStation " +
-                    "WHERE river=:river" +
-                    "   AND station=:station " +
-                    "   AND measurement_type=:measurement_type ");
-
-            query.setParameter("river", river);
-            query.setParameter("station", station);
-            query.setParameter("measurement_type", measurementType);
-
-            List<MeasurementStation> stations = query.list();
-
-            if (stations.isEmpty()) {
-                log.info("create new measurement station '" + name + "'");
-
-                peer = new MeasurementStation(river, name, measurementType,
-                    riverside, station, range, gauge, this.gauge,
-                    observationTimerange, operator, description);
-
-                session.save(peer);
-            }
-        }
-
-        return peer;
-    }
-}
--- a/flys-backend/src/main/java/de/intevation/flys/importer/ImportMorphWidth.java	Thu Apr 25 11:48:36 2013 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,81 +0,0 @@
-package de.intevation.flys.importer;
-
-import de.intevation.flys.model.MorphologicalWidth;
-import de.intevation.flys.model.River;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import org.apache.log4j.Logger;
-
-import org.hibernate.Query;
-import org.hibernate.Session;
-
-
-public class ImportMorphWidth {
-
-    private static Logger log = Logger.getLogger(ImportMorphWidth.class);
-
-    protected MorphologicalWidth peer;
-
-    protected ImportUnit unit;
-
-    protected List<ImportMorphWidthValue> values;
-
-    public ImportMorphWidth() {
-        this.values = new ArrayList<ImportMorphWidthValue>();
-    }
-
-    public void addValue(ImportMorphWidthValue value) {
-        this.values.add(value);
-    }
-
-    public void setUnit(ImportUnit unit) {
-        this.unit = unit;
-    }
-
-    public void storeDependencies(River river) {
-        log.info("store dependencies");
-
-        MorphologicalWidth peer = getPeer(river);
-
-        if (peer != null) {
-            log.info("store morphological width values");
-
-            for (ImportMorphWidthValue value : values) {
-                value.storeDependencies(peer);
-            }
-        }
-    }
-
-    public MorphologicalWidth getPeer(River river) {
-        log.info("get peer");
-
-        if (peer == null) {
-            Session session = ImporterSession.getInstance()
-                .getDatabaseSession();
-
-            Query query = session.createQuery("from MorphologicalWidth where "
-                + "   river=:river and " + "   unit=:unit");
-
-            query.setParameter("river", river);
-            query.setParameter("unit", unit.getPeer());
-
-            List<MorphologicalWidth> widths = query.list();
-
-            if (widths.isEmpty()) {
-                log.debug("Create new MorphologicalWidth DB instance.");
-
-                peer = new MorphologicalWidth(river, unit.getPeer());
-
-                session.save(peer);
-            }
-            else {
-                peer = widths.get(0);
-            }
-        }
-
-        return peer;
-    }
-}
-// vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 :
--- a/flys-backend/src/main/java/de/intevation/flys/importer/ImportMorphWidthValue.java	Thu Apr 25 11:48:36 2013 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,81 +0,0 @@
-package de.intevation.flys.importer;
-
-import java.math.BigDecimal;
-
-import java.util.List;
-
-import org.apache.log4j.Logger;
-
-import org.hibernate.Session;
-import org.hibernate.Query;
-
-import de.intevation.flys.model.MorphologicalWidth;
-import de.intevation.flys.model.MorphologicalWidthValue;
-
-
-public class ImportMorphWidthValue {
-
-    private static Logger log = Logger.getLogger(ImportMorphWidthValue.class);
-
-
-    protected MorphologicalWidthValue peer;
-
-    protected BigDecimal station;
-    protected BigDecimal width;
-
-    protected String description;
-
-
-    public ImportMorphWidthValue(
-        BigDecimal station,
-        BigDecimal width,
-        String     description
-    ) {
-        this.station     = station;
-        this.width       = width;
-        this.description = description;
-    }
-
-
-    public void storeDependencies(MorphologicalWidth parent) {
-        getPeer(parent);
-    }
-
-
-    public MorphologicalWidthValue getPeer(MorphologicalWidth parent) {
-        if (peer == null) {
-            Session session = ImporterSession.getInstance().getDatabaseSession();
-
-            Query query = session.createQuery(
-                "from MorphologicalWidthValue where " +
-                "   morphologicalWidth=:morphologicalWidth and " +
-                "   station=:station and " +
-                "   width=:width and " +
-                "   description=:description");
-
-            query.setParameter("morphologicalWidth", parent);
-            query.setParameter("station", station);
-            query.setParameter("width", width);
-            query.setParameter("description", description);
-
-            List<MorphologicalWidthValue> values = query.list();
-
-            if (values.isEmpty()) {
-                peer = new MorphologicalWidthValue(
-                    parent,
-                    station,
-                    width,
-                    description
-                );
-
-                session.save(peer);
-            }
-            else {
-                peer = values.get(0);
-            }
-        }
-
-        return peer;
-    }
-}
-// vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 :
--- a/flys-backend/src/main/java/de/intevation/flys/importer/ImportNamedMainValue.java	Thu Apr 25 11:48:36 2013 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,66 +0,0 @@
-package de.intevation.flys.importer;
-
-import java.util.List;
-
-import de.intevation.flys.model.NamedMainValue;
-import de.intevation.flys.model.MainValueType;
-
-import org.hibernate.Session;
-import org.hibernate.Query;
-
-public class ImportNamedMainValue
-{
-    protected ImportMainValueType mainValueType;
-    protected String              name;
-
-    protected NamedMainValue      peer;
-
-    public ImportNamedMainValue() {
-    }
-
-    public ImportNamedMainValue(
-        ImportMainValueType mainValueType,
-        String              name
-    ) {
-        this.mainValueType = mainValueType;
-        this.name          = name;
-    }
-
-    public ImportMainValueType getMainValueType() {
-        return mainValueType;
-    }
-
-    public void setMainValueType(ImportMainValueType mainValueType) {
-        this.mainValueType = mainValueType;
-    }
-
-    public String getName() {
-        return name;
-    }
-
-    public void setName(String name) {
-        this.name = name;
-    }
-
-    public NamedMainValue getPeer() {
-        if (peer == null) {
-            MainValueType type = mainValueType.getPeer();
-            Session session = ImporterSession.getInstance().getDatabaseSession();
-            Query query = session.createQuery(
-                "from NamedMainValue where " +
-                "name=:name and type.id=:id");
-            query.setString("name", name);
-            query.setParameter("id", type.getId());
-            List<NamedMainValue> named = query.list();
-            if (named.isEmpty()) {
-                peer = new NamedMainValue(name, type);
-                session.save(peer);
-            }
-            else {
-                peer = named.get(0);
-            }
-        }
-        return peer;
-    }
-}
-// vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 :
--- a/flys-backend/src/main/java/de/intevation/flys/importer/ImportPosition.java	Thu Apr 25 11:48:36 2013 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,54 +0,0 @@
-package de.intevation.flys.importer;
-
-import de.intevation.flys.model.Position;
-
-import org.hibernate.Session;
-import org.hibernate.Query;
-
-import java.util.List;
-
-public class ImportPosition
-implements   Comparable<ImportPosition>
-{
-    protected String value;
-
-    protected Position peer;
-
-    public ImportPosition() {
-    }
-
-    public ImportPosition(String value) {
-        this.value = value;
-    }
-
-    public int compareTo(ImportPosition other) {
-        return value.compareTo(other.value);
-    }
-
-    public String getValue() {
-        return value;
-    }
-
-    public void setValue(String value) {
-        this.value = value;
-    }
-
-    public Position getPeer() {
-        if (peer == null) {
-            Session session = ImporterSession.getInstance().getDatabaseSession();
-            Query query = session.createQuery("from Position where value=:value");
-            query.setString("value", value);
-            List<Position> positions = query.list();
-            if (positions.isEmpty()) {
-                peer = new Position(value);
-                session.save(peer);
-            }
-            else {
-                peer = positions.get(0);
-            }
-        }
-        return peer;
-    }
-}
-// vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 :
-
--- a/flys-backend/src/main/java/de/intevation/flys/importer/ImportRange.java	Thu Apr 25 11:48:36 2013 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,78 +0,0 @@
-package de.intevation.flys.importer;
-
-import de.intevation.flys.model.Range;
-import de.intevation.flys.model.River;
-
-import java.math.BigDecimal;
-
-import org.apache.log4j.Logger;
-
-/** A range that is about to be imported. */
-public class ImportRange
-implements   Comparable<ImportRange>
-{
-    /** Private logger. */
-    private static Logger log = Logger.getLogger(ImportRange.class);
-
-    protected BigDecimal a;
-    protected BigDecimal b;
-
-    protected Range peer;
-
-    public ImportRange() {
-    }
-
-    public ImportRange(BigDecimal a, BigDecimal b) {
-        this.a = a;
-        this.b = b;
-    }
-
-    private static final int compare(BigDecimal a, BigDecimal b) {
-        if (a == null && b == null) {
-            return 0;
-        }
-        if (a == null && b != null) {
-            return -1;
-        }
-        if (a != null && b == null) {
-            return +1;
-        }
-        return a.compareTo(b);
-    }
-
-    public void fixRangesOrder() {
-        if (compare(a, b) > 0) {
-            BigDecimal t = a; a = b; b = t;
-        }
-    }
-
-    public int compareTo(ImportRange other) {
-        int cmp = compare(a, other.a);
-        if (cmp != 0) return cmp;
-        return compare(b, other.b);
-    }
-
-    public BigDecimal getA() {
-        return a;
-    }
-
-    public void setA(BigDecimal a) {
-        this.a = a;
-    }
-
-    public BigDecimal getB() {
-        return b;
-    }
-
-    public void setB(BigDecimal b) {
-        this.b = b;
-    }
-
-    public Range getPeer(River river) {
-        if (peer == null) {
-            peer = ImporterSession.getInstance().getRange(river, a, b);
-        }
-        return peer;
-    }
-}
-// vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 :
--- a/flys-backend/src/main/java/de/intevation/flys/importer/ImportRiver.java	Thu Apr 25 11:48:36 2013 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,1464 +0,0 @@
-package de.intevation.flys.importer;
-
-import de.intevation.artifacts.common.utils.FileTools.HashedFile;
-
-import de.intevation.artifacts.common.utils.FileTools;
-
-import de.intevation.flys.importer.parsers.AnnotationClassifier;
-import de.intevation.flys.importer.parsers.AnnotationsParser;
-import de.intevation.flys.importer.parsers.BedHeightEpochParser;
-import de.intevation.flys.importer.parsers.BedHeightSingleParser;
-import de.intevation.flys.importer.parsers.CrossSectionParser;
-import de.intevation.flys.importer.parsers.DA50Parser;
-import de.intevation.flys.importer.parsers.DA66Parser;
-import de.intevation.flys.importer.parsers.FlowVelocityMeasurementParser;
-import de.intevation.flys.importer.parsers.FlowVelocityModelParser;
-import de.intevation.flys.importer.parsers.HYKParser;
-import de.intevation.flys.importer.parsers.MeasurementStationsParser;
-import de.intevation.flys.importer.parsers.MorphologicalWidthParser;
-import de.intevation.flys.importer.parsers.PRFParser;
-import de.intevation.flys.importer.parsers.PegelGltParser;
-import de.intevation.flys.importer.parsers.SQRelationParser;
-import de.intevation.flys.importer.parsers.SedimentDensityParser;
-import de.intevation.flys.importer.parsers.SedimentYieldParser;
-import de.intevation.flys.importer.parsers.W80Parser;
-import de.intevation.flys.importer.parsers.W80CSVParser;
-import de.intevation.flys.importer.parsers.WaterlevelDifferencesParser;
-import de.intevation.flys.importer.parsers.WaterlevelParser;
-import de.intevation.flys.importer.parsers.WstParser;
-
-import de.intevation.flys.model.River;
-import de.intevation.flys.model.Unit;
-
-import java.io.File;
-import java.io.IOException;
-
-import java.util.ArrayList;
-import java.util.Calendar;
-import java.util.Date;
-import java.util.HashSet;
-import java.util.List;
-import java.util.Map;
-import java.util.Set;
-
-import org.apache.log4j.Logger;
-
-import org.hibernate.Query;
-import org.hibernate.Session;
-
-
-/** Import all river-related data (files) that can be found. */
-public class ImportRiver
-{
-    /** Private logger. */
-    private static Logger log = Logger.getLogger(ImportRiver.class);
-
-    public static final String PEGEL_GLT = "PEGEL.GLT";
-
-    public static final String FIXATIONS = "Fixierungen";
-
-    public static final String EXTRA_LONGITUDINALS =
-        "Zus.L\u00e4ngsschnitte";
-
-    public static final String [] OFFICIAL_LINES_FOLDERS = {
-        "Basisdaten",
-        "Fixierungen" };
-
-    public static final String OFFICIAL_LINES =
-        "Amtl_Linien.wst";
-
-    public static final String FLOOD_WATER = "HW-Marken";
-
-    public static final String FLOOD_PROTECTION =
-        "HW-Schutzanlagen";
-
-    public static final String MINFO_DIR = "Morphologie";
-
-    public static final String BED_HEIGHT_DIR = "Sohlhoehen";
-
-    public static final String BED_HEIGHT_SINGLE_DIR = "Einzeljahre";
-
-    public static final String BED_HEIGHT_EPOCH_DIR = "Epochen";
-
-    public static final String SEDIMENT_DENSITY_DIR = "Sedimentdichte";
-
-    public static final String MORPHOLOGICAL_WIDTH_DIR = "morphologische_Breite";
-
-    public static final String FLOW_VELOCITY_DIR = "Geschwindigkeit_Schubspannung";
-
-    public static final String FLOW_VELOCITY_MODEL = "Modellrechnungen";
-
-    public static final String FLOW_VELOCITY_MEASUREMENTS = "v-Messungen";
-
-    public static final String SEDIMENT_YIELD_DIR = "Fracht";
-
-    public static final String SEDIMENT_YIELD_SINGLE_DIR = "Einzeljahre";
-
-    public static final String SEDIMENT_YIELD_EPOCH_DIR = "Epochen";
-
-    public static final String MINFO_FIXATIONS_DIR = "Fixierungsanalyse";
-
-    public static final String MINFO_WATERLEVELS_DIR = "Wasserspiegellagen";
-
-    public static final String MINFO_WATERLEVEL_DIFF_DIR = "Wasserspiegeldifferenzen";
-
-    public static final String MINFO_BASE_DIR = "Basisdaten";
-
-    public static final String MINFO_CORE_DATA_FILE = "Stammdaten_Messstellen.csv";
-
-    public static final String MINFO_SQ_DIR = "Feststofftransport-Abfluss-Beziehung";
-
-    protected String name;
-
-    protected Long officialNumber;
-
-    protected File wstFile;
-
-    protected File bbInfoFile;
-
-    protected List<ImportGauge> gauges;
-
-    protected List<ImportAnnotation> annotations;
-
-    protected List<ImportHYK> hyks;
-
-    protected List<ImportCrossSection> crossSections;
-
-    protected List<ImportWst> extraWsts;
-
-    protected List<ImportWst> fixations;
-
-    protected List<ImportWst> officialLines;
-
-    protected List<ImportWst> floodWater;
-
-    protected List<ImportWst> floodProtection;
-
-    /** Wst-structures from waterlevel-csv files. */
-    protected List<ImportWst> waterlevels;
-
-    /** Wst-structures from waterlevel-difference-csv files. */
-    protected List<ImportWst> waterlevelDifferences;
-
-    protected List<ImportBedHeight> bedHeightSingles;
-
-    protected List<ImportBedHeight> bedHeightEpochs;
-
-    protected List<ImportSedimentDensity> sedimentDensities;
-
-    protected List<ImportMorphWidth> morphologicalWidths;
-
-    protected List<ImportFlowVelocityModel> flowVelocityModels;
-
-    protected List<ImportFlowVelocityMeasurement> flowVelocityMeasurements;
-
-    protected List<ImportSedimentYield> sedimentYields;
-
-    protected List<ImportMeasurementStation> measurementStations;
-
-    protected List<ImportSQRelation> sqRelations;
-
-    protected ImportWst wst;
-
-    protected ImportUnit wstUnit;
-
-    protected AnnotationClassifier annotationClassifier;
-
-    /** Database-mapped River instance. */
-    protected River peer;
-
-
-    /** Callback-implementation for CrossSectionParsers:
-     * Accept files with different md5(?)sums than what has already been parsed,
-     * on successfull parse, add data. */
-    class ImportRiverCrossSectionParserCallback implements CrossSectionParser.Callback {
-        Set<HashedFile> files = new HashSet<HashedFile>();
-        String type;
-
-
-        /**
-         * Create new Callback, given type which is used for logging
-         * purposes only.
-         */
-        public ImportRiverCrossSectionParserCallback (String type) {
-            this.type = type;
-        }
-
-
-        /** Accept file if not duplicate. */
-        public boolean accept(File file) {
-            HashedFile hf = new HashedFile(file);
-            boolean success = files.add(hf);
-            if (!success) {
-                log.warn(type + " file '" + file + "' seems to be a duplicate.");
-            }
-            return success;
-        }
-
-
-        /** Add crosssection. */
-        public void parsed(CrossSectionParser parser) {
-           log.debug("callback from " + type + " parser");
-
-           addCrossSections(parser);
-        }
-    } // ImportRiverCrossSectionParserCallback
-
-
-    public ImportRiver() {
-        hyks                      = new ArrayList<ImportHYK>();
-        crossSections             = new ArrayList<ImportCrossSection>();
-        extraWsts                 = new ArrayList<ImportWst>();
-        fixations                 = new ArrayList<ImportWst>();
-        officialLines             = new ArrayList<ImportWst>();
-        floodWater                = new ArrayList<ImportWst>();
-        waterlevels               = new ArrayList<ImportWst>();
-        waterlevelDifferences     = new ArrayList<ImportWst>();
-        floodProtection           = new ArrayList<ImportWst>();
-        sedimentDensities         = new ArrayList<ImportSedimentDensity>();
-        morphologicalWidths       = new ArrayList<ImportMorphWidth>();
-        flowVelocityModels        = new ArrayList<ImportFlowVelocityModel>();
-        flowVelocityMeasurements  = new ArrayList<ImportFlowVelocityMeasurement>();
-        sedimentYields            = new ArrayList<ImportSedimentYield>();
-        measurementStations       = new ArrayList<ImportMeasurementStation>();
-        sqRelations               = new ArrayList<ImportSQRelation>();
-    }
-
-    public ImportRiver(
-        String               name,
-        File                 wstFile,
-        File                 bbInfoFile,
-        AnnotationClassifier annotationClassifier
-    ) {
-        this();
-        this.name                 = name;
-        this.wstFile              = wstFile;
-        this.bbInfoFile           = bbInfoFile;
-        this.annotationClassifier = annotationClassifier;
-    }
-
-    public String getName() {
-        return name;
-    }
-
-    public void setName(String name) {
-        this.name = name;
-    }
-
-    public Long getOfficialNumber() {
-        return this.officialNumber;
-    }
-
-    public void setOfficialNumber(Long officialNumber) {
-        this.officialNumber = officialNumber;
-    }
-
-    public File getWstFile() {
-        return wstFile;
-    }
-
-    public void setWstFile(File wstFile) {
-        this.wstFile = wstFile;
-    }
-
-    public File getBBInfo() {
-        return bbInfoFile;
-    }
-
-    public void setBBInfo(File bbInfoFile) {
-        this.bbInfoFile = bbInfoFile;
-    }
-
-    public ImportWst getWst() {
-        return wst;
-    }
-
-    public void setWst(ImportWst wst) {
-        this.wst = wst;
-    }
-
-    public File getMinfoDir() {
-        File riverDir  = wstFile.getParentFile().getParentFile().getParentFile();
-        return new File(riverDir, MINFO_DIR);
-    }
-
-    public void parseDependencies() throws IOException {
-        parseGauges();
-        parseAnnotations();
-        parsePRFs();
-        parseDA66s();
-        parseDA50s();
-        parseW80s();
-        parseW80CSVs();
-        parseHYKs();
-        parseWst();
-        parseExtraWsts();
-        parseFixations();
-        parseOfficialLines();
-        parseFloodWater();
-        parseFloodProtection();
-        parseBedHeight();
-        parseSedimentDensity();
-        parseMorphologicalWidth();
-        parseFlowVelocity();
-        parseSedimentYield();
-        parseWaterlevels();
-        parseWaterlevelDifferences();
-        parseMeasurementStations();
-        parseSQRelation();
-    }
-
-    public void parseFloodProtection() throws IOException {
-        if (Config.INSTANCE.skipFloodProtection()) {
-            log.info("skip parsing flood protection");
-            return;
-        }
-
-        log.info("Parse flood protection wst file");
-
-        File riverDir = wstFile.getParentFile().getParentFile();
-
-        File dir = FileTools.repair(new File(riverDir, FLOOD_PROTECTION));
-
-        if (!dir.isDirectory() || !dir.canRead()) {
-            log.info("no directory '" + dir + "' found");
-            return;
-        }
-
-        File [] files = dir.listFiles();
-
-        if (files == null) {
-            log.warn("cannot read '" + dir + "'");
-            return;
-        }
-
-        for (File file: files) {
-            if (!file.isFile() || !file.canRead()) {
-                continue;
-            }
-            String name = file.getName().toLowerCase();
-            if (!(name.endsWith(".zus") || name.endsWith(".wst"))) {
-                continue;
-            }
-            log.info("found file '" + file.getName() + "'");
-            WstParser wstParser = new WstParser();
-            wstParser.parse(file);
-            ImportWst iw = wstParser.getWst();
-            iw.setKind(5);
-            iw.setDescription(FLOOD_PROTECTION + "/" + iw.getDescription());
-            floodProtection.add(iw);
-        }
-    }
-
-    public void storeOfficialNumber() {
-        if (Config.INSTANCE.skipBWASTR()) {
-            log.info("skip storing official number.");
-            return;
-        }
-        getPeer().setOfficialNumber(officialNumber);
-    }
-
-    public void parseBedHeight() throws IOException {
-        File minfoDir     = getMinfoDir();
-        File bedHeightDir = new File(minfoDir, BED_HEIGHT_DIR);
-        File singlesDir   = new File(bedHeightDir, BED_HEIGHT_SINGLE_DIR);
-        File epochDir     = new File(bedHeightDir, BED_HEIGHT_EPOCH_DIR);
-
-        if (Config.INSTANCE.skipBedHeightSingle()) {
-            log.info("skip parsing bed height single.");
-        }
-        else {
-            log.info("Parse bed height single.");
-            parseBedHeightSingles(singlesDir);
-        }
-
-        if (Config.INSTANCE.skipBedHeightEpoch()) {
-            log.info("skip parsing bed height epochs.");
-        }
-        else {
-            log.info("Parse bed height epochs.");
-            parseBedHeightEpochs(epochDir);
-        }
-    }
-
-
-    protected void parseSedimentDensity() throws IOException {
-        if (Config.INSTANCE.skipSedimentDensity()) {
-            log.info("skip parsing sediment density.");
-            return;
-        }
-
-        log.debug("Parse sediment density");
-
-        File minfoDir = getMinfoDir();
-        File sediment = new File(minfoDir, SEDIMENT_DENSITY_DIR);
-
-        File[] files = sediment.listFiles();
-
-        if (files == null) {
-            log.warn("Cannot read directory '" + sediment + "'");
-            return;
-        }
-
-        SedimentDensityParser parser = new SedimentDensityParser();
-
-        for (File file: files) {
-            parser.parse(file);
-        }
-
-        sedimentDensities = parser.getSedimentDensities();
-
-        log.info("Parsed " + sedimentDensities.size() + " sediment densities.");
-    }
-
-
-    protected void parseMorphologicalWidth() throws IOException {
-        if (Config.INSTANCE.skipMorphologicalWidth()) {
-            log.info("skip parsing morphological width.");
-            return;
-        }
-
-        log.debug("Parse morphological width");
-
-        File minfoDir = getMinfoDir();
-        File morphDir = new File(minfoDir, MORPHOLOGICAL_WIDTH_DIR);
-
-        File[] files = morphDir.listFiles();
-
-        if (files == null) {
-            log.warn("Cannot read directory '" + morphDir + "'");
-            return;
-        }
-
-        MorphologicalWidthParser parser = new MorphologicalWidthParser();
-
-        for (File file: files) {
-            parser.parse(file);
-        }
-
-        morphologicalWidths = parser.getMorphologicalWidths();
-
-        log.info("Parsed " + morphologicalWidths.size() + " morph. widths files.");
-    }
-
-
-    protected void parseFlowVelocity() throws IOException {
-        if (Config.INSTANCE.skipFlowVelocity()) {
-            log.info("skip parsing flow velocity");
-            return;
-        }
-
-        log.debug("Parse flow velocity");
-
-        File minfoDir   = getMinfoDir();
-        File flowDir    = new File(minfoDir, FLOW_VELOCITY_DIR);
-        File modelDir   = new File(flowDir, FLOW_VELOCITY_MODEL);
-        File measureDir = new File(flowDir, FLOW_VELOCITY_MEASUREMENTS);
-
-        File[] modelFiles   = modelDir.listFiles();
-        File[] measureFiles = measureDir.listFiles();
-
-        if (modelFiles == null) {
-            log.warn("Cannot read directory '" + modelDir + "'");
-        }
-        else {
-            FlowVelocityModelParser parser = new FlowVelocityModelParser();
-
-            for (File model: modelFiles) {
-                log.debug("Parse file '" + model + "'");
-                parser.parse(model);
-            }
-
-            flowVelocityModels = parser.getModels();
-        }
-
-        if (measureFiles == null) {
-            log.warn("Cannot read directory '" + measureDir + "'");
-        }
-        else {
-            FlowVelocityMeasurementParser parser =
-                new FlowVelocityMeasurementParser();
-
-            for (File measurement: measureFiles) {
-                log.debug("Parse file '" + measurement + "'");
-                parser.parse(measurement);
-            }
-
-            flowVelocityMeasurements = parser.getMeasurements();
-        }
-    }
-
-
-    protected void parseSedimentYield() throws IOException {
-        if (Config.INSTANCE.skipSedimentYield()) {
-            log.info("skip parsing sediment yield data");
-            return;
-        }
-
-        log.debug("Parse sediment yield data");
-
-        File minfoDir         = getMinfoDir();
-        File sedimentYieldDir = new File(minfoDir, SEDIMENT_YIELD_DIR);
-
-        File singleDir = new File(sedimentYieldDir, SEDIMENT_YIELD_SINGLE_DIR);
-        File epochDir  = new File(sedimentYieldDir, SEDIMENT_YIELD_EPOCH_DIR);
-
-        File[] singles = singleDir.listFiles();
-        File[] epochs  = epochDir.listFiles();
-
-        SedimentYieldParser parser = new SedimentYieldParser();
-
-        if (singles == null || singles.length == 0) {
-            log.warn("Cannot read directory '" + singleDir + "'");
-        }
-        else {
-            for (File file: singles) {
-                if (file.isDirectory()) {
-                    for (File child: file.listFiles()) {
-                        parser.parse(child);
-                    }
-                }
-                else {
-                    parser.parse(file);
-                }
-            }
-        }
-
-        if (epochs == null || epochs.length == 0) {
-            log.warn("Cannot read directory '" + epochDir + "'");
-        }
-        else {
-            for (File file: epochs) {
-                if (file.isDirectory()) {
-                    for (File child: file.listFiles()) {
-                        parser.parse(child);
-                    }
-                }
-                else {
-                    parser.parse(file);
-                }
-            }
-        }
-
-        sedimentYields = parser.getSedimentYields();
-    }
-
-
-    protected void parseWaterlevels() throws IOException {
-        if (Config.INSTANCE.skipWaterlevels()) {
-            log.info("skip parsing waterlevels");
-            return;
-        }
-
-        log.info("Parse waterlevels");
-
-        File minfo  = getMinfoDir();
-        File fixDir = new File(minfo, MINFO_FIXATIONS_DIR);
-        File wspDir = new File(fixDir, MINFO_WATERLEVELS_DIR);
-
-        File[] files = wspDir.listFiles();
-
-        if (files == null) {
-            log.warn("Cannot read directory for wl '" + wspDir + "'");
-            return;
-        }
-
-        WaterlevelParser parser = new WaterlevelParser();
-
-        for (File file: files) {
-            parser.parse(file);
-        }
-
-        // The parsed ImportWaterlevels are converted to
-        // 'fixation'-wsts now.
-        for(ImportWst iw: parser.getWaterlevels()) {
-            iw.setDescription("CSV/" + iw.getDescription());
-            iw.setKind(6);
-            waterlevels.add(iw);
-        }
-    }
-
-    protected void parseMeasurementStations() throws IOException {
-        if (Config.INSTANCE.skipMeasurementStations()) {
-            log.info("skip parsing measurement stations");
-            return;
-        }
-
-        log.info("Parse measurement stations");
-
-        File minfo = getMinfoDir();
-        File minfoBaseDir = new File(minfo, MINFO_BASE_DIR);
-        File coredataFile = new File(minfoBaseDir, MINFO_CORE_DATA_FILE);
-
-        if (coredataFile == null || !coredataFile.exists()) {
-            log.warn("No core data file '" + coredataFile.getAbsolutePath() + "' found");
-            return;
-        }
-
-        MeasurementStationsParser parser = new MeasurementStationsParser();
-        try {
-            parser.parse(coredataFile);
-            measurementStations = parser.getMeasurementStations();
-
-            log.info("Successfully parsed " + measurementStations.size() + " measurement stations.");
-        }
-        catch (IOException ioe) {
-            log.error("unable to parse file '" + coredataFile.getName() +
-                ": " + ioe.getMessage());
-        }
-    }
-
-
-    protected void parseWaterlevelDifferences() throws IOException {
-        if (Config.INSTANCE.skipWaterlevelDifferences()) {
-            log.info("skip parsing waterlevel differences");
-            return;
-        }
-
-        log.info("Parse waterlevel differences");
-
-        File minfo  = getMinfoDir();
-        File fixDir = new File(minfo, MINFO_FIXATIONS_DIR);
-        File diffDir = new File(fixDir, MINFO_WATERLEVEL_DIFF_DIR);
-
-        File[] files = diffDir.listFiles();
-
-        if (files == null) {
-            log.warn("Cannot read directory '" + diffDir + "'");
-            return;
-        }
-
-        WaterlevelDifferencesParser parser = new WaterlevelDifferencesParser();
-
-        for (File file: files) {
-            parser.parse(file);
-        }
-
-        // WaterlevelDifferences become Wsts now.
-        for(ImportWst iw: parser.getDifferences()) {
-            iw.setDescription("CSV/" + iw.getDescription());
-            iw.setKind(7);
-            waterlevelDifferences.add(iw);
-        }
-    }
-
-
-    protected void parseSQRelation() throws IOException {
-        if (Config.INSTANCE.skipSQRelation()) {
-            log.info("skip parsing sq relation");
-            return;
-        }
-
-        log.info("Parse sq relations");
-
-        File minfo = getMinfoDir();
-        File sqDir = new File(minfo, MINFO_SQ_DIR);
-
-        File[] files = sqDir.listFiles();
-
-        if (files == null) {
-            log.warn("Cannot read directory '" + sqDir + "'");
-            return;
-        }
-
-        SQRelationParser parser = new SQRelationParser();
-
-        for (File file: files) {
-            parser.parse(file);
-        }
-
-        sqRelations = parser.getSQRelations();
-
-        log.debug("Parsed " + sqRelations.size() + " SQ relations.");
-    }
-
-
-    protected void parseBedHeightSingles(File dir) throws IOException {
-        log.debug("Parse bed height singles");
-
-        File[] files = dir.listFiles();
-
-        if (files == null) {
-            log.warn("Cannot read directory '" + dir + "'");
-            return;
-        }
-
-        BedHeightSingleParser parser = new BedHeightSingleParser();
-
-        for (File file: files) {
-            parser.parse(file);
-        }
-
-        bedHeightSingles = parser.getBedHeights();
-    }
-
-
-    protected void parseBedHeightEpochs(File dir) throws IOException {
-        log.debug("Parse bed height epochs");
-
-        File[] files = dir.listFiles();
-
-        if (files == null) {
-            log.warn("Cannot read directory '" + dir + "'");
-            return;
-        }
-
-        BedHeightEpochParser parser = new BedHeightEpochParser();
-
-        for (File file: files) {
-            parser.parse(file);
-        }
-
-        bedHeightEpochs = parser.getBedHeights();
-    }
-
-
-    public void parseFloodWater() throws IOException {
-        if (Config.INSTANCE.skipFloodWater()) {
-            log.info("skip parsing flod water");
-            return;
-        }
-
-        log.info("Parse flood water wst file");
-
-        File riverDir = wstFile.getParentFile().getParentFile();
-
-        File dir = FileTools.repair(new File(riverDir, FLOOD_WATER));
-
-        if (!dir.isDirectory() || !dir.canRead()) {
-            log.info("no directory '" + dir + "' found");
-            return;
-        }
-
-        File [] files = dir.listFiles();
-
-        if (files == null) {
-            log.warn("cannot read '" + dir + "'");
-            return;
-        }
-
-        for (File file: files) {
-            if (!file.isFile() || !file.canRead()) {
-                continue;
-            }
-            String name = file.getName().toLowerCase();
-            if (!(name.endsWith(".zus") || name.endsWith(".wst"))) {
-                continue;
-            }
-            log.info("found file '" + file.getName() + "'");
-            WstParser wstParser = new WstParser();
-            wstParser.parse(file);
-            ImportWst iw = wstParser.getWst();
-            iw.setKind(4);
-            iw.setDescription(FLOOD_WATER + "/" + iw.getDescription());
-            floodWater.add(iw);
-        }
-    }
-
-    public void parseOfficialLines() throws IOException {
-        if (Config.INSTANCE.skipOfficialLines()) {
-            log.info("skip parsing official lines");
-            return;
-        }
-
-        log.info("Parse official wst files");
-
-        File riverDir = wstFile.getParentFile().getParentFile();
-
-        for (String folder: OFFICIAL_LINES_FOLDERS) {
-            File dir = FileTools.repair(new File(riverDir, folder));
-
-            if (!dir.isDirectory() || !dir.canRead()) {
-                log.info("no directory '" + folder + "' found");
-                continue;
-            }
-
-            File file = FileTools.repair(new File(dir, OFFICIAL_LINES));
-            if (!file.isFile() || !file.canRead()) {
-                log.warn("no official lines wst file found");
-                continue;
-            }
-            log.debug("Found WST file: " + file);
-
-            WstParser wstParser = new WstParser();
-            wstParser.parse(file);
-            ImportWst iw = wstParser.getWst();
-            iw.setKind(3);
-            iw.setDescription(folder + "/" + iw.getDescription());
-            officialLines.add(iw);
-        } // for all folders
-
-    }
-
-    public void parseFixations() throws IOException {
-        if (Config.INSTANCE.skipFixations()) {
-            log.info("skip parsing fixations");
-            return;
-        }
-
-        log.info("Parse fixation wst files");
-
-        File riverDir = wstFile.getParentFile().getParentFile();
-
-        File fixDir = FileTools.repair(
-            new File(riverDir, FIXATIONS));
-
-        if (!fixDir.isDirectory() || !fixDir.canRead()) {
-            log.info("no fixation wst file directory found");
-            return;
-        }
-
-        File [] files = fixDir.listFiles();
-
-        if (files == null) {
-            log.warn("cannot read fixations wst file directory");
-            return;
-        }
-
-        for (File file: files) {
-            if (!file.isFile() || !file.canRead()) {
-                continue;
-            }
-            String name = file.getName().toLowerCase();
-            if (!name.endsWith(".wst")) {
-                continue;
-            }
-            log.debug("Found WST file: " + file);
-
-            WstParser wstParser = new WstParser();
-            wstParser.parse(file);
-            ImportWst iw = wstParser.getWst();
-            iw.setKind(2);
-            iw.setDescription(FIXATIONS+ "/" + iw.getDescription());
-            fixations.add(iw);
-        }
-    }
-
-    public void parseExtraWsts() throws IOException {
-        if (Config.INSTANCE.skipExtraWsts()) {
-            log.info("skip parsing extra WST files");
-            return;
-        }
-
-        log.info("Parse extra longitudinal wst files");
-
-        File riverDir = wstFile.getParentFile().getParentFile();
-
-        File extraDir = FileTools.repair(
-            new File(riverDir, EXTRA_LONGITUDINALS));
-
-        if (!extraDir.isDirectory() || !extraDir.canRead()) {
-            log.info("no extra longitudinal wst file directory found");
-            return;
-        }
-
-        File [] files = extraDir.listFiles();
-
-        if (files == null) {
-            log.warn("cannot read extra longitudinal wst file directory");
-            return;
-        }
-
-        for (File file: files) {
-            if (!file.isFile() || !file.canRead()) {
-                continue;
-            }
-            String name = file.getName().toLowerCase();
-            if (!(name.endsWith(".zus") || name.endsWith(".wst"))) {
-                continue;
-            }
-            log.debug("Found WST file: " + file);
-
-            WstParser wstParser = new WstParser();
-            wstParser.parse(file);
-            ImportWst iw = wstParser.getWst();
-            iw.setKind(1);
-            iw.setDescription(EXTRA_LONGITUDINALS + "/" + iw.getDescription());
-            extraWsts.add(iw);
-        }
-
-    }
-
-    public void parseWst() throws IOException {
-        if (Config.INSTANCE.skipWst()) {
-            log.info("skip parsing WST file");
-            return;
-        }
-
-        WstParser wstParser = new WstParser();
-        wstParser.parse(wstFile);
-        wst = wstParser.getWst();
-    }
-
-    public void parseGauges() throws IOException {
-        if (Config.INSTANCE.skipGauges()) {
-            log.info("skip parsing gauges");
-            return;
-        }
-
-        File gltFile = new File(wstFile.getParentFile(), PEGEL_GLT);
-        gltFile = FileTools.repair(gltFile);
-
-        if (!gltFile.isFile() || !gltFile.canRead()) {
-            log.warn("cannot read gauges from '" + gltFile + "'");
-            return;
-        }
-
-        PegelGltParser pgltp = new PegelGltParser();
-        pgltp.parse(gltFile);
-
-        gauges = pgltp.getGauges();
-
-        for (ImportGauge gauge: gauges) {
-            gauge.parseDependencies();
-        }
-    }
-
-    public void parseAnnotations() throws IOException {
-        if (Config.INSTANCE.skipAnnotations()) {
-            log.info("skip parsing annotations");
-            return;
-        }
-
-        File riverDir = wstFile.getParentFile().getParentFile();
-        AnnotationsParser aparser =
-            new AnnotationsParser(annotationClassifier);
-        aparser.parse(riverDir);
-
-        annotations = aparser.getAnnotations();
-    }
-
-    public void parseHYKs() {
-        if (Config.INSTANCE.skipHYKs()) {
-            log.info("skip parsing HYK files");
-            return;
-        }
-
-        log.info("looking for HYK files");
-        HYKParser parser = new HYKParser();
-        File riverDir = wstFile
-            .getParentFile()  // Basisdaten
-            .getParentFile()  // Hydrologie
-            .getParentFile(); // <river>
-
-        parser.parseHYKs(riverDir, new HYKParser.Callback() {
-
-            Set<HashedFile> hfs = new HashSet<HashedFile>();
-
-            @Override
-            public boolean hykAccept(File file) {
-                HashedFile hf = new HashedFile(file);
-                boolean success = hfs.add(hf);
-                if (!success) {
-                    log.warn("HYK file '" + file + "' seems to be a duplicate.");
-                }
-                return success;
-            }
-
-            @Override
-            public void hykParsed(HYKParser parser) {
-                log.debug("callback from HYK parser");
-                ImportHYK hyk = parser.getHYK();
-                hyk.setRiver(ImportRiver.this);
-                hyks.add(hyk);
-            }
-        });
-    }
-
-
-    /** Add cross sections with description, years and lines to
-     * store. */
-    private void addCrossSections(CrossSectionParser parser) {
-        String  description = parser.getDescription();
-        Integer year        = parser.getYear();
-        ImportTimeInterval ti = year != null
-            ? new ImportTimeInterval(yearToDate(year))
-            : null;
-
-        Map<Double, List<XY>> data = parser.getData();
-
-        List<ImportCrossSectionLine> lines =
-            new ArrayList<ImportCrossSectionLine>(data.size());
-
-        for (Map.Entry<Double, List<XY>> entry: data.entrySet()) {
-            Double   km     = entry.getKey();
-            List<XY> points = entry.getValue();
-            lines.add(new ImportCrossSectionLine(km, points));
-        }
-
-        crossSections.add(new ImportCrossSection(
-            ImportRiver.this, description, ti, lines));
-    }
-
-    /** Create a W80 Parser and parse w80 files found. */
-    public void parseW80s() {
-        if (Config.INSTANCE.skipW80s()) {
-            log.info("skip parsing W80s");
-            return;
-        }
-        W80Parser parser = new W80Parser();
-        File riverDir = wstFile
-            .getParentFile()  // Basisdaten
-            .getParentFile()  // Hydrologie
-            .getParentFile(); // <river>
-
-        ImportRiverCrossSectionParserCallback w80Callback =
-            new ImportRiverCrossSectionParserCallback("w80");
-        parser.parseW80s(riverDir, w80Callback);
-    }
-
-    /** Create a W80 Parser and parse w80 files found. */
-    public void parseW80CSVs() {
-        if (Config.INSTANCE.skipW80CSVs()) {
-            log.info("skip parsing W80 csvs");
-            return;
-        }
-        W80CSVParser parser = new W80CSVParser();
-        File riverDir = wstFile
-            .getParentFile()  // Basisdaten
-            .getParentFile()  // Hydrologie
-            .getParentFile(); // <river>
-
-        // Construct the Cross-Section-Data path.
-        File csDir = new File(riverDir.getPath()
-            + File.separator + "Geodaesie"
-            + File.separator + "Querprofile"
-            + File.separator + "QP-Daten");
-
-        ImportRiverCrossSectionParserCallback w80CSVCallback =
-            new ImportRiverCrossSectionParserCallback("w80-csv");
-        parser.parseW80CSVs(csDir, w80CSVCallback);
-    }
-
-
-    /**
-     * Create and use a DA50Parser, parse the files found, add the
-     * ross-sections found.
-     */
-    public void parseDA50s() {
-        if (Config.INSTANCE.skipDA50s()) {
-            log.info("skip parsing DA50s");
-            return;
-        }
-        DA50Parser parser = new DA50Parser();
-        File riverDir = wstFile
-            .getParentFile()  // Basisdaten
-            .getParentFile()  // Hydrologie
-            .getParentFile(); // <river>
-
-        ImportRiverCrossSectionParserCallback da50Callback =
-            new ImportRiverCrossSectionParserCallback("da50");
-        parser.parseDA50s(riverDir, da50Callback);
-    }
-
-
-    /** Create a DA66 Parser and parse the da66 files found. */
-    // TODO this is a copy of parsePRFs, extract interfaces (e.g. CrossSectionParser).
-    public void parseDA66s() {
-        if (Config.INSTANCE.skipDA66s()) {
-            log.info("skip parsing DA66s");
-            return;
-        }
-
-        log.info("looking for DA66 files");
-        DA66Parser parser = new DA66Parser();
-        File riverDir = wstFile
-            .getParentFile()  // Basisdaten
-            .getParentFile()  // Hydrologie
-            .getParentFile(); // <river>
-
-        ImportRiverCrossSectionParserCallback da66Callback =
-            new ImportRiverCrossSectionParserCallback("da66");
-        parser.parseDA66s(riverDir, da66Callback);
-    }
-
-    /** Create a PRFParser and let it parse the prf files found. */
-    public void parsePRFs() {
-        if (Config.INSTANCE.skipPRFs()) {
-            log.info("skip parsing PRFs");
-            return;
-        }
-
-        log.info("looking for PRF files");
-        PRFParser parser = new PRFParser();
-        File riverDir = wstFile
-            .getParentFile()  // Basisdaten
-            .getParentFile()  // Hydrologie
-            .getParentFile(); // <river>
-
-        ImportRiverCrossSectionParserCallback prfCallback =
-            new ImportRiverCrossSectionParserCallback("prf");
-        parser.parsePRFs(riverDir, prfCallback);
-    }
-
-    public static Date yearToDate(int year) {
-        Calendar cal = Calendar.getInstance();
-        cal.set(year, 5, 15, 12, 0, 0);
-        long ms = cal.getTimeInMillis();
-        cal.setTimeInMillis(ms - ms%1000);
-        return cal.getTime();
-    }
-
-    public void storeDependencies() {
-        storeWstUnit();
-        storeAnnotations();
-        storeHYKs();
-        storeCrossSections();
-        storeGauges();
-        storeWst();
-        storeExtraWsts();
-        storeFixations();
-        storeOfficialLines();
-        storeFloodWater();
-        storeFloodProtection();
-        storeBedHeight();
-        storeSedimentDensity();
-        storeMorphologicalWidth();
-        storeFlowVelocity();
-        storeSedimentYield();
-        storeWaterlevels();
-        storeWaterlevelDifferences();
-        storeMeasurementStations();
-        storeSQRelations();
-        storeOfficialNumber();
-    }
-
-    public void storeWstUnit() {
-        if (wst == null) {
-            wstUnit = new ImportUnit("NN + m");
-        }
-        else {
-            wstUnit = wst.getUnit();
-        }
-    }
-
-    public void storeHYKs() {
-        if (!Config.INSTANCE.skipHYKs()) {
-            log.info("store HYKs");
-            getPeer();
-            for (ImportHYK hyk: hyks) {
-                hyk.storeDependencies();
-            }
-        }
-    }
-
-    public void storeCrossSections() {
-        if (!Config.INSTANCE.skipPRFs()
-            || !Config.INSTANCE.skipDA66s()
-            || !Config.INSTANCE.skipDA50s()
-            || !Config.INSTANCE.skipW80s()
-            || !Config.INSTANCE.skipW80CSVs()) {
-            log.info("store cross sections");
-            getPeer();
-            for (ImportCrossSection crossSection: crossSections) {
-                crossSection.storeDependencies();
-            }
-        }
-    }
-
-    public void storeWst() {
-        if (!Config.INSTANCE.skipWst()) {
-            River river = getPeer();
-            wst.storeDependencies(river);
-        }
-    }
-
-    public void storeFixations() {
-        if (!Config.INSTANCE.skipFixations()) {
-            log.info("store fixation wsts");
-            River river = getPeer();
-            for (ImportWst fWst: fixations) {
-                log.debug("Fixation name: " + fWst.getDescription());
-                fWst.storeDependencies(river);
-            }
-        }
-    }
-
-
-    /** Store wsts from waterlevel-csv files. */
-    public void storeWaterlevels() {
-        if (!Config.INSTANCE.skipWaterlevels())
-
-        log.info("store waterlevel wsts from csv");
-        River river = getPeer();
-        for (ImportWst wWst: waterlevels) {
-            log.debug("Waterlevel name: " + wWst.getDescription());
-            wWst.storeDependencies(river);
-        }
-    }
-
-
-    /** Store wsts from waterleveldifference-csv files. */
-    public void storeWaterlevelDifferences() {
-        if (!Config.INSTANCE.skipWaterlevelDifferences())
-
-        log.info("store waterleveldifferences wsts from csv");
-        River river = getPeer();
-        for (ImportWst dWst: waterlevelDifferences) {
-            log.debug("water.diff.: name " + dWst.getDescription());
-            dWst.storeDependencies(river);
-        }
-    }
-
-
-    public void storeExtraWsts() {
-        if (!Config.INSTANCE.skipExtraWsts()) {
-            log.info("store extra wsts");
-            River river = getPeer();
-            for (ImportWst wst: extraWsts) {
-                log.debug("name: " + wst.getDescription());
-                wst.storeDependencies(river);
-            }
-        }
-    }
-
-    public void storeOfficialLines() {
-        if (!Config.INSTANCE.skipOfficialLines()) {
-            log.info("store official lines wsts");
-            River river = getPeer();
-            for (ImportWst wst: officialLines) {
-                log.debug("name: " + wst.getDescription());
-                wst.storeDependencies(river);
-            }
-        }
-    }
-
-    public void storeFloodWater() {
-        if (!Config.INSTANCE.skipFloodWater()) {
-            log.info("store flood water wsts");
-            River river = getPeer();
-            for (ImportWst wst: floodWater) {
-                log.debug("name: " + wst.getDescription());
-                wst.storeDependencies(river);
-            }
-        }
-    }
-
-
-    public void storeFloodProtection() {
-        if (!Config.INSTANCE.skipFloodProtection()) {
-            log.info("store flood protection wsts");
-            River river = getPeer();
-            for (ImportWst wst: floodProtection) {
-                log.debug("name: " + wst.getDescription());
-                wst.storeDependencies(river);
-            }
-        }
-    }
-
-
-    public void storeBedHeight() {
-        if (!Config.INSTANCE.skipBedHeightSingle()) {
-            log.info("store bed heights single");
-            storeBedHeightSingle();
-        }
-
-        if (!Config.INSTANCE.skipBedHeightEpoch()) {
-            log.info("store bed height epoch.");
-            storeBedHeightEpoch();
-        }
-    }
-
-
-    private void storeBedHeightSingle() {
-        River river = getPeer();
-
-        if (bedHeightSingles != null) {
-            for (ImportBedHeight tmp: bedHeightSingles) {
-                ImportBedHeightSingle single = (ImportBedHeightSingle) tmp;
-
-                String desc = single.getDescription();
-
-                log.debug("name: " + desc);
-
-		single.storeDependencies(river);
-
-            }
-        }
-        else {
-            log.info("No single bed heights to store.");
-        }
-    }
-
-
-    private void storeBedHeightEpoch() {
-        River river = getPeer();
-
-        if (bedHeightEpochs != null) {
-            for (ImportBedHeight tmp: bedHeightEpochs) {
-                ImportBedHeightEpoch epoch = (ImportBedHeightEpoch) tmp;
-
-                String desc = epoch.getDescription();
-
-                log.debug("name: " + desc);
-
-		epoch.storeDependencies(river);
-
-            }
-        }
-        else {
-            log.info("No epoch bed heights to store.");
-        }
-    }
-
-    public void storeSedimentDensity() {
-        if (!Config.INSTANCE.skipSedimentDensity()) {
-            log.info("store sediment density");
-
-            River river = getPeer();
-
-            for (ImportSedimentDensity density: sedimentDensities) {
-                String desc = density.getDescription();
-
-                log.debug("name: " + desc);
-
-		density.storeDependencies(river);
-
-            }
-        }
-    }
-
-    public void storeMorphologicalWidth() {
-        if (!Config.INSTANCE.skipMorphologicalWidth()) {
-            log.info("store morphological width");
-
-            River river = getPeer();
-
-            for (ImportMorphWidth width: morphologicalWidths) {
-
-		width.storeDependencies(river);
-
-            }
-        }
-    }
-
-    public void storeFlowVelocity() {
-        if (!Config.INSTANCE.skipFlowVelocity()) {
-            log.info("store flow velocity");
-
-            River river = getPeer();
-
-            for (ImportFlowVelocityModel flowVelocityModel: flowVelocityModels){
-
-		flowVelocityModel.storeDependencies(river);
-
-            }
-
-            for (ImportFlowVelocityMeasurement m: flowVelocityMeasurements) {
-
-		m.storeDependencies(river);
-
-            }
-        }
-    }
-
-
-    public void storeSedimentYield() {
-        if (!Config.INSTANCE.skipSedimentYield()) {
-            log.info("store sediment yield data");
-
-            River river = getPeer();
-
-            for (ImportSedimentYield sedimentYield: sedimentYields) {
-
-		sedimentYield.storeDependencies(river);
-
-            }
-        }
-    }
-
-
-    public void storeMeasurementStations() {
-        if (!Config.INSTANCE.skipMeasurementStations()) {
-            log.info("store measurement stations");
-
-            River river = getPeer();
-
-            int count = 0;
-
-            for (ImportMeasurementStation station: measurementStations) {
-
-		boolean success = station.storeDependencies(river);
-		if (success) {
-		    count++;
-		}
-
-            }
-
-            log.info("stored " + count + " measurement stations.");
-        }
-    }
-
-
-    public void storeSQRelations() {
-        if (!Config.INSTANCE.skipSQRelation()) {
-            log.info("store sq relations");
-
-            River river = getPeer();
-
-            int count = 0;
-
-            for (ImportSQRelation sqRelation: sqRelations) {
-
-		sqRelation.storeDependencies(river);
-		count++;
-
-            }
-
-            log.info("stored " + count + " sq relations.");
-        }
-    }
-
-
-    public void storeAnnotations() {
-        if (!Config.INSTANCE.skipAnnotations()) {
-            River river = getPeer();
-            for (ImportAnnotation annotation: annotations) {
-                annotation.getPeer(river);
-            }
-        }
-    }
-
-    public void storeGauges() {
-        if (!Config.INSTANCE.skipGauges()) {
-            log.info("store gauges:");
-            River river = getPeer();
-            Session session = ImporterSession.getInstance()
-                .getDatabaseSession();
-            for (ImportGauge gauge: gauges) {
-                log.info("\tgauge: " + gauge.getName());
-                gauge.storeDependencies(river);
-                ImporterSession.getInstance().getDatabaseSession();
-                session.flush();
-            }
-        }
-    }
-
-    public River getPeer() {
-        if (peer == null) {
-            Session session = ImporterSession.getInstance().getDatabaseSession();
-            Query query = session.createQuery("from River where name=:name");
-
-            Unit u = null;
-            if (wstUnit != null) {
-                u = wstUnit.getPeer();
-            }
-
-            query.setString("name", name);
-            List<River> rivers = query.list();
-            if (rivers.isEmpty()) {
-                log.info("Store new river '" + name + "'");
-                peer = new River(name, u);
-                if (!Config.INSTANCE.skipBWASTR()) {
-                    peer.setOfficialNumber(officialNumber);
-                }
-                session.save(peer);
-            }
-            else {
-                peer = rivers.get(0);
-            }
-        }
-        return peer;
-    }
-}
-// vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 :
--- a/flys-backend/src/main/java/de/intevation/flys/importer/ImportSQRelation.java	Thu Apr 25 11:48:36 2013 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,109 +0,0 @@
-package de.intevation.flys.importer;
-
-import java.sql.SQLException;
-import java.util.ArrayList;
-import java.util.List;
-
-import org.apache.log4j.Logger;
-
-import org.hibernate.Query;
-import org.hibernate.Session;
-import org.hibernate.exception.ConstraintViolationException;
-
-import de.intevation.flys.model.River;
-import de.intevation.flys.model.SQRelation;
-import de.intevation.flys.model.TimeInterval;
-
-
-public class ImportSQRelation {
-
-    private static Logger log = Logger.getLogger(ImportSQRelation.class);
-
-    private ImportTimeInterval timeInterval;
-
-    private String description;
-
-    private List<ImportSQRelationValue> values;
-
-    private SQRelation peer;
-
-    public ImportSQRelation() {
-        this.values = new ArrayList<ImportSQRelationValue>();
-    }
-
-    public void storeDependencies(River river) {
-        log.info("store dependencies");
-
-        SQRelation peer = getPeer(river);
-
-        if (peer != null) {
-            int count = 0;
-
-            for (ImportSQRelationValue value : values) {
-                try {
-                    value.storeDependencies(peer);
-                    count++;
-                }
-                catch (SQLException sqle) {
-                    log.warn("ISQ: Unable to store sq relation value.", sqle);
-                }
-                catch (ConstraintViolationException cve) {
-                    log.warn("ISQ: Unable to store sq relation value.", cve);
-                }
-            }
-
-            log.info("stored " + count + " sq relation values.");
-        }
-    }
-
-    public SQRelation getPeer(River river) {
-        log.debug("getPeer()");
-
-        if (peer == null) {
-            TimeInterval timeInter = timeInterval.getPeer();
-
-            if (timeInter == null) {
-                log.warn("ISQ: Cannot determine sq relation without time interval");
-                return null;
-            }
-
-            Session session = ImporterSession.getInstance()
-                .getDatabaseSession();
-
-            Query query = session
-                .createQuery("FROM SQRelation WHERE river=:river AND timeInterval=:timeInter");
-
-            query.setParameter("river", river);
-            query.setParameter("timeInter", timeInter);
-
-            List<SQRelation> sq = query.list();
-
-            if (sq.isEmpty()) {
-                log.info("create new SQ relation '" + description + "'");
-
-                peer = new SQRelation(river, timeInter, description);
-                session.save(peer);
-            }
-            else {
-                peer = sq.get(0);
-            }
-        }
-
-        return peer;
-    }
-
-    public void setDescription(String description) {
-        this.description = description;
-    }
-
-    public void setTimeInterval(ImportTimeInterval timeInterval) {
-        this.timeInterval = timeInterval;
-    }
-
-    public void addValue(ImportSQRelationValue value) {
-        if (value != null) {
-            this.values.add(value);
-        }
-    }
-}
-// vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 :
--- a/flys-backend/src/main/java/de/intevation/flys/importer/ImportSQRelationValue.java	Thu Apr 25 11:48:36 2013 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,140 +0,0 @@
-package de.intevation.flys.importer;
-
-import java.math.BigDecimal;
-import java.sql.SQLException;
-import java.util.List;
-
-import org.apache.log4j.Logger;
-
-import org.hibernate.Query;
-import org.hibernate.Session;
-import org.hibernate.exception.ConstraintViolationException;
-
-import de.intevation.flys.model.MeasurementStation;
-import de.intevation.flys.model.SQRelation;
-import de.intevation.flys.model.SQRelationValue;
-
-
-public class ImportSQRelationValue {
-
-    private static Logger log = Logger.getLogger(ImportSQRelationValue.class);
-
-
-    private SQRelationValue peer;
-
-    private String parameter;
-
-    private Double km;
-    private Double a;
-    private Double b;
-    private Double qMax;
-    private Double rSQ;
-    private Integer nTot;
-    private Integer nOutlier;
-    private Double cFerguson;
-    private Double cDuan;
-
-
-    public ImportSQRelationValue(
-        String parameter,
-        Double km,
-        Double a,
-        Double b,
-        Double qMax,
-        Double rSQ,
-        Integer nTot,
-        Integer nOutlier,
-        Double cFerguson,
-        Double cDuan
-    ) {
-        this.parameter = parameter;
-        this.km        = km;
-        this.a         = a;
-        this.b         = b;
-        this.qMax      = qMax;
-        this.rSQ       = rSQ;
-        this.nTot      = nTot;
-        this.nOutlier  = nOutlier;
-        this.cFerguson = cFerguson;
-        this.cDuan     = cDuan;
-    }
-
-
-    public void storeDependencies(SQRelation owner)
-    throws SQLException, ConstraintViolationException
-    {
-        getPeer(owner);
-    }
-
-
-    public SQRelationValue getPeer(SQRelation owner) {
-        if (peer == null) {
-            Session session = ImporterSession.getInstance().getDatabaseSession();
-
-            Query query = session.createQuery(
-                "from MeasurementStation " +
-                "   where station between :kml and :kmh");
-            query.setDouble("kml", km - 1e-4);
-            query.setDouble("kmh", km + 1e-4);
-
-            List<MeasurementStation> result = query.list();
-
-            if (result.isEmpty()) {
-                log.error("No measurement stations found at km " + km);
-                return null;
-            }
-
-            Query query2 = session.createQuery(
-                "from SQRelationValue " +
-                "   where sqRelation=:owner " +
-                "   and parameter=:parameter" +
-                "   and measurementStation=:measurementStation" +
-                "   and a=:a" +
-                "   and b=:b" +
-                "   and qMax=:qMax" +
-                "   and rSQ=:rSQ" +
-                "   and cFerguson=:cFerguson" +
-                "   and cDuan=:cDuan");
-
-            query2.setParameter("owner", owner);
-            query2.setString("parameter", parameter);
-            query2.setParameter("measurementStation", result.get(0));
-            query2.setBigDecimal("a", toBigDecimal(a));
-            query2.setBigDecimal("b", toBigDecimal(b));
-            query2.setBigDecimal("qMax", toBigDecimal(qMax));
-            query2.setBigDecimal("rSQ", toBigDecimal(rSQ));
-            query2.setBigDecimal("cFerguson", toBigDecimal(cFerguson));
-            query2.setBigDecimal("cDuan", toBigDecimal(cDuan));
-
-            List<SQRelationValue> values = query2.list();
-
-            if (values.isEmpty()) {
-                peer = new SQRelationValue(
-                    owner,
-                    parameter,
-                    result.get(0),
-                    a,
-                    b,
-                    qMax,
-                    rSQ,
-                    nTot,
-                    nOutlier,
-                    cFerguson,
-                    cDuan
-                );
-
-                session.save(peer);
-            }
-            else {
-                peer = values.get(0);
-            }
-        }
-        return peer;
-    }
-
-    private static final BigDecimal toBigDecimal(Double x) {
-        if (x == null) return null;
-        return new BigDecimal(x);
-    }
-}
-// vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 :
--- a/flys-backend/src/main/java/de/intevation/flys/importer/ImportSedimentDensity.java	Thu Apr 25 11:48:36 2013 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,97 +0,0 @@
-package de.intevation.flys.importer;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import org.apache.log4j.Logger;
-import org.hibernate.Query;
-import org.hibernate.Session;
-
-import de.intevation.flys.model.River;
-import de.intevation.flys.model.SedimentDensity;
-
-
-public class ImportSedimentDensity {
-
-    private static Logger log = Logger.getLogger(ImportSedimentDensity.class);
-
-    protected SedimentDensity peer;
-
-    protected ImportDepth depth;
-
-    protected String description;
-
-    protected List<ImportSedimentDensityValue> values;
-
-    public ImportSedimentDensity(String description) {
-        this.description = description;
-        this.values = new ArrayList<ImportSedimentDensityValue>();
-    }
-
-    public String getDescription() {
-        return description;
-    }
-
-    public void setDepth(ImportDepth depth) {
-        this.depth = depth;
-    }
-
-    public void addValue(ImportSedimentDensityValue value) {
-        values.add(value);
-    }
-
-    public void storeDependencies(River river) {
-        log.info("store dependencies");
-
-        if (depth != null) {
-            depth.storeDependencies();
-        }
-
-        SedimentDensity peer = getPeer(river);
-
-        if (peer != null) {
-            log.info("store sediment density values.");
-            for (ImportSedimentDensityValue value : values) {
-                value.storeDependencies(peer);
-            }
-        }
-    }
-
-    public SedimentDensity getPeer(River river) {
-        log.info("get peer");
-
-        if (depth == null) {
-            log.warn("cannot store sediment density '" + description
-                + "': no depth");
-            return null;
-        }
-
-        if (peer == null) {
-            Session session = ImporterSession.getInstance()
-                .getDatabaseSession();
-
-            Query query = session.createQuery("from SedimentDensity where "
-                + "   river=:river and " + "   depth=:depth");
-
-            query.setParameter("river", river);
-            query.setParameter("depth", depth.getPeer());
-
-            List<SedimentDensity> density = query.list();
-
-            if (density.isEmpty()) {
-                log.debug("Create new SedimentDensity DB instance.");
-
-                peer = new SedimentDensity(river, depth.getPeer(),
-                    description);
-
-                session.save(peer);
-            }
-            else {
-                peer = density.get(0);
-            }
-        }
-
-        return peer;
-    }
-}
-// vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 :
--- a/flys-backend/src/main/java/de/intevation/flys/importer/ImportSedimentDensityValue.java	Thu Apr 25 11:48:36 2013 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,101 +0,0 @@
-package de.intevation.flys.importer;
-
-import java.math.BigDecimal;
-
-import java.util.List;
-
-import org.apache.log4j.Logger;
-
-import org.hibernate.Session;
-import org.hibernate.Query;
-
-import de.intevation.flys.model.SedimentDensity;
-import de.intevation.flys.model.SedimentDensityValue;
-
-
-public class ImportSedimentDensityValue {
-
-    private static final Logger log =
-        Logger.getLogger(ImportSedimentDensityValue.class);
-
-
-    protected SedimentDensityValue peer;
-
-    protected BigDecimal station;
-
-    protected BigDecimal shoreOffset;
-
-    protected BigDecimal density;
-
-    private BigDecimal year;
-
-    protected String description;
-
-
-    public ImportSedimentDensityValue(
-        BigDecimal station,
-        BigDecimal shoreOffset,
-        BigDecimal density,
-        BigDecimal year,
-        String     description
-    ) {
-        this.station     = station;
-        this.shoreOffset = shoreOffset;
-        this.density     = density;
-        this.year        = year;
-        this.description = description;
-    }
-
-
-    public void storeDependencies(SedimentDensity sedimentDensity) {
-        log.info("store dependencies");
-
-        getPeer(sedimentDensity);
-    }
-
-
-    public SedimentDensityValue getPeer(SedimentDensity sedimentDensity) {
-        log.info("get peer");
-
-        if (peer == null) {
-            Session session = ImporterSession.getInstance().getDatabaseSession();
-
-            Query query = session.createQuery(
-                "from SedimentDensityValue where " +
-                "   sedimentDensity=:sedimentDensity and " +
-                "   station=:station and " +
-                "   shoreOffset=:shoreOffset and " +
-                "   density=:density and " +
-                "   year=:year and " +
-                "   description=:description");
-
-            query.setParameter("sedimentDensity", sedimentDensity);
-            query.setParameter("station", station);
-            query.setParameter("shoreOffset", shoreOffset);
-            query.setParameter("density", density);
-            query.setParameter("year", year);
-            query.setParameter("description", description);
-
-            List<SedimentDensityValue> values = query.list();
-            if (values.isEmpty()) {
-                log.debug("Create new SedimentDensityValue DB instance.");
-
-                peer = new SedimentDensityValue(
-                    sedimentDensity,
-                    station,
-                    shoreOffset,
-                    density,
-                    year,
-                    description);
-
-                session.save(peer);
-            }
-            else {
-                peer = values.get(0);
-            }
-        }
-
-        return peer;
-    }
-}
-// vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 :
--- a/flys-backend/src/main/java/de/intevation/flys/importer/ImportSedimentYield.java	Thu Apr 25 11:48:36 2013 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,121 +0,0 @@
-package de.intevation.flys.importer;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import org.apache.log4j.Logger;
-
-import org.hibernate.Session;
-import org.hibernate.Query;
-
-import de.intevation.flys.model.GrainFraction;
-import de.intevation.flys.model.River;
-import de.intevation.flys.model.SedimentYield;
-import de.intevation.flys.model.TimeInterval;
-import de.intevation.flys.model.Unit;
-
-
-public class ImportSedimentYield {
-
-    private static Logger log = Logger.getLogger(ImportSedimentYield.class);
-
-    private ImportGrainFraction grainFraction;
-
-    private ImportUnit unit;
-
-    private ImportTimeInterval timeInterval;
-
-    private String description;
-
-    private List<ImportSedimentYieldValue> values;
-
-    private SedimentYield peer;
-
-    public ImportSedimentYield(String description) {
-        this.values = new ArrayList<ImportSedimentYieldValue>();
-        this.description = description;
-    }
-
-    public void setTimeInterval(ImportTimeInterval timeInterval) {
-        this.timeInterval = timeInterval;
-    }
-
-    public void setUnit(ImportUnit unit) {
-        this.unit = unit;
-    }
-
-    public void setGrainFraction(ImportGrainFraction grainFraction) {
-        this.grainFraction = grainFraction;
-    }
-
-    public void addValue(ImportSedimentYieldValue value) {
-        this.values.add(value);
-    }
-
-    public void storeDependencies(River river) {
-        log.debug("store dependencies");
-
-        if (grainFraction != null) {
-            grainFraction.storeDependencies();
-        }
-
-        SedimentYield peer = getPeer(river);
-
-        if (peer != null) {
-            int i = 0;
-
-            for (ImportSedimentYieldValue value : values) {
-                value.storeDependencies(peer);
-                i++;
-            }
-
-            log.info("stored " + i + " sediment yield values.");
-        }
-    }
-
-    public SedimentYield getPeer(River river) {
-        log.debug("get peer");
-
-        GrainFraction gf = grainFraction != null ? grainFraction.getPeer()
-            : null;
-
-        Unit u = unit != null ? unit.getPeer() : null;
-
-        TimeInterval ti = timeInterval != null ? timeInterval.getPeer() : null;
-
-        if (ti == null || u == null) {
-            log.warn("Skip invalid SedimentYield: time interval or unit null!");
-            return null;
-        }
-
-        if (peer == null) {
-            Session session = ImporterSession.getInstance()
-                .getDatabaseSession();
-            Query query = session.createQuery("from SedimentYield where "
-                + "   river=:river and "
-                + "   grainFraction=:grainFraction and " + "   unit=:unit and "
-                + "   timeInterval=:timeInterval and "
-                + "   description=:description");
-
-            query.setParameter("river", river);
-            query.setParameter("grainFraction", gf);
-            query.setParameter("unit", u);
-            query.setParameter("timeInterval", ti);
-            query.setParameter("description", description);
-
-            List<SedimentYield> yields = query.list();
-            if (yields.isEmpty()) {
-                log.debug("create new SedimentYield");
-
-                peer = new SedimentYield(river, u, ti, gf, description);
-                session.save(peer);
-            }
-            else {
-                peer = yields.get(0);
-            }
-        }
-
-        return peer;
-    }
-}
-// vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 :
--- a/flys-backend/src/main/java/de/intevation/flys/importer/ImportSedimentYieldValue.java	Thu Apr 25 11:48:36 2013 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,58 +0,0 @@
-package de.intevation.flys.importer;
-
-import java.util.List;
-
-import org.hibernate.Session;
-import org.hibernate.Query;
-
-import de.intevation.flys.model.SedimentYield;
-import de.intevation.flys.model.SedimentYieldValue;
-
-
-public class ImportSedimentYieldValue {
-
-    private Double station;
-    private Double value;
-
-    private SedimentYieldValue peer;
-
-
-    public ImportSedimentYieldValue(Double station, Double value) {
-        this.station = station;
-        this.value   = value;
-    }
-
-
-    public void storeDependencies(SedimentYield sedimentYield) {
-        getPeer(sedimentYield);
-    }
-
-
-    public SedimentYieldValue getPeer(SedimentYield sedimentYield) {
-        if (peer == null) {
-            Session session = ImporterSession.getInstance().getDatabaseSession();
-            Query query = session.createQuery(
-                "from SedimentYieldValue where " +
-                "   sedimentYield=:sedimentYield and " +
-                "   station=:station and " +
-                "   value=:value"
-            );
-
-            query.setParameter("sedimentYield", sedimentYield);
-            query.setParameter("station", station);
-            query.setParameter("value", value);
-
-            List<SedimentYieldValue> values = query.list();
-            if (values.isEmpty()) {
-                peer = new SedimentYieldValue(sedimentYield, station, value);
-                session.save(peer);
-            }
-            else {
-                peer = values.get(0);
-            }
-        }
-
-        return peer;
-    }
-}
-// vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 :
--- a/flys-backend/src/main/java/de/intevation/flys/importer/ImportTimeInterval.java	Thu Apr 25 11:48:36 2013 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,98 +0,0 @@
-package de.intevation.flys.importer;
-
-import de.intevation.flys.model.TimeInterval;
-
-import org.hibernate.Session;
-import org.hibernate.Query;
-
-import java.util.List;
-import java.util.Date;
-
-import org.apache.log4j.Logger;
-
-public class ImportTimeInterval
-{
-    private static Logger log = Logger.getLogger(ImportTimeInterval.class);
-
-    protected Date startTime;
-    protected Date stopTime;
-
-    protected TimeInterval peer;
-
-    public ImportTimeInterval() {
-    }
-
-    public ImportTimeInterval(Date startTime) {
-        this.startTime = startTime;
-        this.stopTime = null;
-    }
-
-    public ImportTimeInterval(Date startTime, Date stopTime) {
-	Date start;
-	Date stop;
-	if (startTime == null) {
-	    start = stopTime;
-	    stop = null;
-	}
-	else {
-	    start = startTime;
-	    stop = stopTime;
-	}
-
-        if (stop != null && start.after(stop)) {
-            this.stopTime = start;
-            this.startTime = stop;
-        }
-        else {
-            this.startTime = start;
-            this.stopTime  = stop;
-        }
-    }
-
-    public Date getStartTime() {
-        return startTime;
-    }
-
-    public void setStartTime(Date startTime) {
-        this.startTime = startTime;
-    }
-
-    public Date getStopTime() {
-        return stopTime;
-    }
-
-    public void setStopTime(Date stopTime) {
-        this.stopTime = stopTime;
-    }
-
-    public TimeInterval getPeer() {
-        if (peer == null) {
-            Session session = ImporterSession.getInstance().getDatabaseSession();
-            if (startTime == null) {
-                log.error("Null Start time will be ignored.");
-            }
-            Query query;
-            if (stopTime == null) {
-                query = session.createQuery(
-                    "from TimeInterval where startTime=:a and stopTime is null");
-            }
-            else {
-                query = session.createQuery(
-                    "from TimeInterval where startTime=:a and stopTime=:b");
-                query.setParameter("b", stopTime);
-            }
-            query.setParameter("a", startTime);
-
-            List<TimeInterval> intervals = query.list();
-            if (intervals.isEmpty()) {
-                peer = new TimeInterval(startTime, stopTime);
-                session.save(peer);
-            }
-            else {
-                peer = intervals.get(0);
-            }
-        }
-        return peer;
-    }
-}
-// vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 :
--- a/flys-backend/src/main/java/de/intevation/flys/importer/ImportUnit.java	Thu Apr 25 11:48:36 2013 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,52 +0,0 @@
-package de.intevation.flys.importer;
-
-import java.util.List;
-
-import org.apache.log4j.Logger;
-
-import org.hibernate.Session;
-import org.hibernate.Query;
-
-import de.intevation.flys.model.Unit;
-
-
-public class ImportUnit
-{
-    private static final Logger log = Logger.getLogger(ImportUnit.class);
-
-    protected String name;
-
-    protected Unit peer;
-
-
-    public ImportUnit(String name) {
-        this.name = name;
-    }
-
-
-    public String getName() {
-        return name;
-    }
-
-
-    public Unit getPeer() {
-        if (peer == null) {
-            Session session = ImporterSession.getInstance().getDatabaseSession();
-            Query query = session.createQuery("from Unit where name=:name");
-            query.setParameter("name", name);
-
-            List<Unit> units = query.list();
-            if (units.isEmpty()) {
-                log.info("Store new unit '" + name + "'");
-
-                peer = new Unit(name);
-                session.save(peer);
-            }
-            else {
-                peer = units.get(0);
-            }
-        }
-        return peer;
-    }
-}
-// vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 :
--- a/flys-backend/src/main/java/de/intevation/flys/importer/ImportWst.java	Thu Apr 25 11:48:36 2013 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,130 +0,0 @@
-package de.intevation.flys.importer;
-
-import de.intevation.flys.model.Wst;
-import de.intevation.flys.model.River;
-
-import org.apache.log4j.Logger;
-
-import org.hibernate.Session;
-import org.hibernate.Query;
-
-import java.util.ArrayList;
-import java.util.List;
-
-public class ImportWst
-{
-    private static Logger log = Logger.getLogger(ImportWst.class);
-
-    protected String description;
-
-    protected Integer kind;
-
-    protected List<ImportWstColumn> columns;
-
-    protected ImportUnit unit;
-
-    /** Wst as in db. */
-    protected Wst peer;
-
-    public ImportWst() {
-        kind = 0;
-        columns = new ArrayList<ImportWstColumn>();
-    }
-
-    public ImportWst(String description) {
-        this();
-        this.description = description;
-    }
-
-    public String getDescription() {
-        return description;
-    }
-
-    public Integer getKind() {
-        return kind;
-    }
-
-    public void setKind(Integer kind) {
-        this.kind = kind;
-    }
-
-
-    public void setDescription(String description) {
-        this.description = description;
-    }
-
-    /** Create columns that can be accessed with getColumn. */
-    public void setNumberColumns(int numColumns) {
-        for (int i = 0; i < numColumns; ++i) {
-            columns.add(new ImportWstColumn(this, null, null, i));
-        }
-    }
-
-    public int getNumberColumns() {
-        return columns.size();
-    }
-
-    public ImportWstColumn getColumn(int index) {
-        return columns.get(index);
-    }
-
-    public List<ImportWstColumn> getColumns() {
-        return columns;
-    }
-
-    /** Adds a column. Assumes that columns wst is this instance. */
-    public void addColumn(ImportWstColumn column) {
-        columns.add(column);
-    }
-
-    public ImportUnit getUnit() {
-        return unit;
-    }
-
-    public void setUnit(ImportUnit unit) {
-        this.unit = unit;
-    }
-
-    public void storeDependencies(River river) {
-
-        log.info("store '" + description + "'");
-        Wst wst = getPeer(river);
-
-        for (ImportWstColumn column: columns) {
-            column.storeDependencies(river);
-        }
-
-        Session session = ImporterSession.getInstance().getDatabaseSession();
-        session.flush();
-    }
-
-    public void fixRangesOrder() {
-        for (ImportWstColumn column: columns) {
-            column.fixRangesOrder();
-        }
-    }
-
-    /** Get corresponding mapped wst (from database). */
-    public Wst getPeer(River river) {
-        if (peer == null) {
-            Session session = ImporterSession.getInstance().getDatabaseSession();
-            Query query = session.createQuery(
-                "from Wst where " +
-                "river=:river and description=:description and kind=:kind");
-            query.setParameter("river",       river);
-            query.setParameter("description", description);
-            query.setParameter("kind",        kind);
-            List<Wst> wsts = query.list();
-            if (wsts.isEmpty()) {
-                peer = new Wst(river, description, kind);
-                session.save(peer);
-            }
-            else {
-                peer = wsts.get(0);
-            }
-
-        }
-        return peer;
-    }
-}
-// vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 :
--- a/flys-backend/src/main/java/de/intevation/flys/importer/ImportWstColumn.java	Thu Apr 25 11:48:36 2013 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,160 +0,0 @@
-package de.intevation.flys.importer;
-
-import de.intevation.flys.model.Wst;
-import de.intevation.flys.model.WstColumn;
-import de.intevation.flys.model.River;
-import de.intevation.flys.model.TimeInterval;
-
-import org.hibernate.Session;
-import org.hibernate.Query;
-
-import java.util.List;
-import java.util.ArrayList;
-
-import java.math.BigDecimal;
-
-import org.apache.log4j.Logger;
-
-
-/** Unmapped column of a WST. */
-public class ImportWstColumn
-{
-    private static Logger log = Logger.getLogger(ImportWstColumn.class);
-
-    protected ImportWst wst;
-    protected String    name;
-    protected String    description;
-    protected Integer   position;
-
-    protected ImportTimeInterval timeInterval;
-
-    protected List<ImportWstColumnQRange> columnQRanges;
-    protected List<ImportWstColumnValue>  columnValues;
-
-    protected WstColumn peer;
-
-    public ImportWstColumn() {
-        columnQRanges = new ArrayList<ImportWstColumnQRange>();
-        columnValues  = new ArrayList<ImportWstColumnValue>();
-    }
-
-    public ImportWstColumn(
-        ImportWst wst,
-        String    name,
-        String    description,
-        Integer   position
-    ) {
-        this();
-        this.wst         = wst;
-        this.name        = name;
-        this.description = description;
-        this.position    = position;
-    }
-
-    public ImportWst getWst() {
-        return wst;
-    }
-
-    public void setWst(ImportWst wst) {
-        this.wst = wst;
-    }
-
-    public String getName() {
-        return name;
-    }
-
-    public void setName(String name) {
-        this.name = name;
-    }
-
-    public String getDescription() {
-        return description;
-    }
-
-    public void setDescription(String description) {
-        this.description = description;
-    }
-
-    public Integer getPosition() {
-        return position;
-    }
-
-    public void setPosition(Integer position) {
-        this.position = position;
-    }
-
-    public void addColumnValue(BigDecimal position, BigDecimal w) {
-        columnValues.add(
-            new ImportWstColumnValue(this, position, w));
-    }
-
-    public void addColumnQRange(ImportWstQRange columnQRange) {
-        columnQRanges.add(
-            new ImportWstColumnQRange(this, columnQRange));
-    }
-
-
-    /** Get the Column Values stored in this column. */
-    public List<ImportWstColumnValue> getColumnValues() {
-        return columnValues;
-    }
-
-
-    public void storeDependencies(River river) {
-        log.info("store column '" + name + "'");
-        WstColumn column = getPeer(river);
-
-        for (ImportWstColumnQRange columnQRange: columnQRanges) {
-            columnQRange.getPeer(river);
-        }
-
-        for (ImportWstColumnValue columnValue: columnValues) {
-            columnValue.getPeer(river);
-        }
-    }
-
-    public ImportTimeInterval getTimeInterval() {
-        return timeInterval;
-    }
-
-    public void setTimeInterval(ImportTimeInterval timeInterval) {
-        this.timeInterval = timeInterval;
-    }
-
-    /** Get corresponding mapped wst-column (from database). */
-    public WstColumn getPeer(River river) {
-        if (peer == null) {
-            Wst w = wst.getPeer(river);
-            Session session = ImporterSession.getInstance().getDatabaseSession();
-            Query query = session.createQuery(
-                "from WstColumn where " +
-                "wst=:wst and name=:name and description=:description" +
-                " and position=:position");
-            query.setParameter("wst",         w);
-            query.setParameter("name",        name);
-            query.setParameter("description", description);
-            query.setParameter("position",    position);
-
-            TimeInterval ti = timeInterval != null
-                ? timeInterval.getPeer()
-                : null;
-
-            List<WstColumn> columns = query.list();
-            if (columns.isEmpty()) {
-                peer = new WstColumn(w, name, description, position, ti);
-                session.save(peer);
-            }
-            else {
-                peer = columns.get(0);
-            }
-        }
-        return peer;
-    }
-
-    public void fixRangesOrder() {
-        for (ImportWstColumnQRange wcqr: columnQRanges) {
-            wcqr.fixRangesOrder();
-        }
-    }
-}
-// vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 :
--- a/flys-backend/src/main/java/de/intevation/flys/importer/ImportWstColumnQRange.java	Thu Apr 25 11:48:36 2013 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,73 +0,0 @@
-package de.intevation.flys.importer;
-
-import de.intevation.flys.model.WstColumnQRange;
-import de.intevation.flys.model.WstQRange;
-import de.intevation.flys.model.WstColumn;
-import de.intevation.flys.model.River;
-
-import org.hibernate.Session;
-import org.hibernate.Query;
-
-import java.util.List;
-
-public class ImportWstColumnQRange
-{
-    protected ImportWstColumn wstColumn;
-    protected ImportWstQRange qRange;
-
-    protected WstColumnQRange peer;
-
-    public ImportWstColumnQRange() {
-    }
-
-    public ImportWstColumnQRange(
-        ImportWstColumn wstColumn,
-        ImportWstQRange qRange
-    ) {
-        this.wstColumn = wstColumn;
-        this.qRange    = qRange;
-    }
-
-    public ImportWstColumn getWstColumn() {
-        return wstColumn;
-    }
-
-    public void setWstColumn(ImportWstColumn wstColumn) {
-        this.wstColumn = wstColumn;
-    }
-
-    public ImportWstQRange getQRange() {
-        return qRange;
-    }
-
-    public void setQRange(ImportWstQRange qRange) {
-        this.qRange = qRange;
-    }
-
-    public void fixRangesOrder() {
-        qRange.fixRangesOrder();
-    }
-
-    public WstColumnQRange getPeer(River river) {
-        if (peer == null) {
-            WstColumn c = wstColumn.getPeer(river);
-            WstQRange q = qRange.getPeer(river);
-            Session session = ImporterSession.getInstance().getDatabaseSession();
-            Query query = session.createQuery(
-                "from WstColumnQRange where " +
-                "wstColumn=:c and wstQRange=:q");
-            query.setParameter("c", c);
-            query.setParameter("q", q);
-            List<WstColumnQRange> cols = query.list();
-            if (cols.isEmpty()) {
-                peer = new WstColumnQRange(c, q);
-                session.save(peer);
-            }
-            else {
-                peer = cols.get(0);
-            }
-        }
-        return peer;
-    }
-}
-// vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 :
--- a/flys-backend/src/main/java/de/intevation/flys/importer/ImportWstColumnValue.java	Thu Apr 25 11:48:36 2013 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,68 +0,0 @@
-package de.intevation.flys.importer;
-
-import de.intevation.flys.model.WstColumnValue;
-import de.intevation.flys.model.WstColumn;
-import de.intevation.flys.model.River;
-
-import java.math.BigDecimal;
-
-import org.apache.log4j.Logger;
-
-public class ImportWstColumnValue
-{
-    protected Logger logger = Logger.getLogger(ImportWstColumnValue.class);
-
-    protected BigDecimal      position;
-    protected BigDecimal      w;
-    protected ImportWstColumn wstColumn;
-
-    protected WstColumnValue  peer;
-
-    public ImportWstColumnValue() {
-    }
-
-    public ImportWstColumnValue(
-        ImportWstColumn wstColumn,
-        BigDecimal      position,
-        BigDecimal      w
-    ) {
-        this.wstColumn = wstColumn;
-        this.position  = position;
-        this.w         = w;
-    }
-
-    public BigDecimal getPosition() {
-        return position;
-    }
-
-    public void setPosition(BigDecimal position) {
-        this.position = position;
-    }
-
-    public BigDecimal getW() {
-        return w;
-    }
-
-    public void setW(BigDecimal w) {
-        this.w = w;
-    }
-
-    public ImportWstColumn getWstColumn() {
-        return wstColumn;
-    }
-
-    public void setWstColumn(ImportWstColumn wstColumn) {
-        this.wstColumn = wstColumn;
-    }
-
-    public WstColumnValue getPeer(River river) {
-        if (peer == null) {
-            WstColumn c = wstColumn.getPeer(river);
-            peer = ImporterSession.getInstance().getWstColumnValue(
-                c, position, w);
-        }
-
-        return peer;
-    }
-}
-// vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 :
--- a/flys-backend/src/main/java/de/intevation/flys/importer/ImportWstQRange.java	Thu Apr 25 11:48:36 2013 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,73 +0,0 @@
-package de.intevation.flys.importer;
-
-import java.math.BigDecimal;
-
-import de.intevation.flys.model.WstQRange;
-import de.intevation.flys.model.River;
-import de.intevation.flys.model.Range;
-
-import org.hibernate.Session;
-import org.hibernate.Query;
-
-import java.util.List;
-
-public class ImportWstQRange
-{
-    protected ImportRange range;
-    protected BigDecimal  q;
-
-    protected WstQRange peer;
-
-    public ImportWstQRange() {
-    }
-
-    public ImportWstQRange(
-        ImportRange range,
-        BigDecimal  q
-    ) {
-        this.range = range;
-        this.q     = q;
-    }
-
-    public ImportRange getRange() {
-        return range;
-    }
-
-    public void setRange(ImportRange range) {
-        this.range = range;
-    }
-
-    public BigDecimal getQ() {
-        return q;
-    }
-
-    public void setQ(BigDecimal q) {
-        this.q = q;
-    }
-
-    public void fixRangesOrder() {
-        range.fixRangesOrder();
-    }
-
-    public WstQRange getPeer(River river) {
-        if (peer == null) {
-            Range r = range.getPeer(river);
-            Session session = ImporterSession.getInstance().getDatabaseSession();
-            Query query = session.createQuery(
-                "from WstQRange where " +
-                "range=:range and q=:q");
-            query.setParameter("range", r);
-            query.setParameter("q",     q);
-            List<WstQRange> wstQRanges = query.list();
-            if (wstQRanges.isEmpty()) {
-                peer = new WstQRange(r, q);
-                session.save(peer);
-            }
-            else {
-                peer = wstQRanges.get(0);
-            }
-        }
-        return peer;
-    }
-}
-// vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 :
--- a/flys-backend/src/main/java/de/intevation/flys/importer/Importer.java	Thu Apr 25 11:48:36 2013 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,200 +0,0 @@
-package de.intevation.flys.importer;
-
-import de.intevation.artifacts.common.utils.XMLUtils;
-
-import de.intevation.flys.importer.parsers.AnnotationClassifier;
-import de.intevation.flys.importer.parsers.BundesWasserStrassenParser;
-import de.intevation.flys.importer.parsers.InfoGewParser;
-
-import java.io.File;
-import java.io.IOException;
-
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-
-import java.sql.SQLException;
-
-import org.apache.log4j.Logger;
-
-import org.hibernate.Transaction;
-import org.hibernate.HibernateException;
-
-import org.w3c.dom.Document;
-
-import de.intevation.flys.utils.StringUtil;
-
-/** Data Importer. Further processing happens per-river. */
-public class Importer
-{
-    /** Private logger. */
-    private static Logger log = Logger.getLogger(Importer.class);
-
-    private static String BWASTR_ID_CSV_FILE = "BWASTR_ID.csv";
-
-    protected List<ImportRiver> rivers;
-
-    public Importer() {
-    }
-
-    public Importer(List<ImportRiver> rivers) {
-        this.rivers = rivers;
-    }
-
-    public List<ImportRiver> getRivers() {
-        return rivers;
-    }
-
-    public void setRivers(List<ImportRiver> rivers) {
-        this.rivers = rivers;
-    }
-
-    /** Write rivers and their dependencies/dependants to db. */
-    public void writeRivers() {
-        log.debug("write rivers started");
-
-        for (ImportRiver river: rivers) {
-            log.debug("writing river '" + river.getName() + "'");
-            river.storeDependencies();
-            ImporterSession.getInstance().getDatabaseSession().flush();
-        }
-
-        log.debug("write rivers finished");
-    }
-
-    public void writeToDatabase() {
-
-        Transaction tx = null;
-
-        try {
-            tx = ImporterSession.getInstance()
-                .getDatabaseSession().beginTransaction();
-
-            try {
-                writeRivers();
-            }
-            catch (HibernateException he) {
-                Throwable t = he.getCause();
-                while (t instanceof SQLException) {
-                    SQLException sqle = (SQLException) t;
-                    log.error("SQL exeception chain:", sqle);
-                    t = sqle.getNextException();
-                }
-                throw he;
-            }
-
-            tx.commit();
-        }
-        catch (RuntimeException re) {
-            if (tx != null) {
-                tx.rollback();
-            }
-            throw re;
-        }
-    }
-
-    public static AnnotationClassifier getAnnotationClassifier() {
-        String annotationTypes = Config.INSTANCE.getAnnotationTypes();
-
-        if (annotationTypes == null) {
-            log.info("no annotation types file configured.");
-            return null;
-        }
-
-        File file = new File(annotationTypes);
-
-        log.info("use annotation types file '" + file + "'");
-
-        if (!(file.isFile() && file.canRead())) {
-            log.warn("annotation type file '" + file + "' is not readable.");
-            return null;
-        }
-
-        Document rules = XMLUtils.parseDocument(file);
-
-        if (rules == null) {
-            log.warn("cannot parse annotation types file.");
-            return null;
-        }
-
-        return new AnnotationClassifier(rules);
-    }
-
-
-    /** Starting point for importing river data. */
-    public static void main(String [] args) {
-
-        InfoGewParser infoGewParser = new InfoGewParser(
-            getAnnotationClassifier());
-
-        log.info("Start parsing rivers...");
-
-        File bwastrFile = null;
-
-        for (String gew: args) {
-            log.info("parsing info gew file: " + gew);
-            File gewFile = new File(gew);
-            if (bwastrFile == null) {
-                bwastrFile = new File(gewFile.getParentFile(), BWASTR_ID_CSV_FILE);
-            }
-            try {
-                infoGewParser.parse(gewFile);
-            }
-            catch (IOException ioe) {
-                log.error("error while parsing gew: " + gew, ioe);
-                System.exit(1);
-            }
-        }
-
-        String gew = Config.INSTANCE.getInfoGewFile();
-        if (gew != null && gew.length() > 0) {
-            log.info("parsing info gew file: " + gew);
-            File gewFile = new File(gew);
-            if (bwastrFile == null) {
-                bwastrFile = new File(gewFile.getParentFile(), BWASTR_ID_CSV_FILE);
-            }
-            try {
-                infoGewParser.parse(gewFile);
-            }
-            catch (IOException ioe) {
-                log.error("error while parsing gew: " + gew, ioe);
-                System.exit(1);
-            }
-        }
-
-        // Look for official numbers.
-        BundesWasserStrassenParser bwastrIdParser =
-            new BundesWasserStrassenParser();
-
-        // Read bwastFile (river-dir + BWASTR_ID_CSV_FILE).
-        if (!Config.INSTANCE.skipBWASTR()) {
-            try{
-                bwastrIdParser.parse(bwastrFile);
-                HashMap<String,Long> map = bwastrIdParser.getMap();
-
-                // Now link rivers with official numbers.
-                for(ImportRiver river: infoGewParser.getRivers()) {
-                    for(Map.Entry<String, Long> entry: map.entrySet()) {
-                        if (StringUtil.containsIgnoreCase(entry.getKey(), river.getName())) {
-                            river.setOfficialNumber(entry.getValue());
-                            log.debug(river.getName() + " is mapped to bwastr " + entry.getValue());
-                        }
-                    }
-                }
-            } catch (IOException ioe) {
-                log.warn("BWASTR-file could not be loaded.");
-            }
-        }
-        else {
-            log.debug("skip reading BWASTR_ID.csv");
-        }
-
-        if (!Config.INSTANCE.dryRun()) {
-            new Importer(infoGewParser.getRivers()).writeToDatabase();
-        }
-        else {
-            log.info("Dry run, not writing to database.");
-        }
-    }
-}
-// vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 :
--- a/flys-backend/src/main/java/de/intevation/flys/importer/ImporterSession.java	Thu Apr 25 11:48:36 2013 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,187 +0,0 @@
-package de.intevation.flys.importer;
-
-import java.util.Iterator;
-import java.util.Map;
-import java.util.TreeMap;
-
-import java.math.BigDecimal;
-
-import org.hibernate.SessionFactory;
-import org.hibernate.Session;
-import org.hibernate.Query;
-import org.hibernate.FlushMode;
-
-import de.intevation.flys.backend.SessionFactoryProvider;
-
-import de.intevation.flys.model.WstColumnValue;
-import de.intevation.flys.model.WstColumn;
-import de.intevation.flys.model.DischargeTableValue;
-import de.intevation.flys.model.DischargeTable;
-import de.intevation.flys.model.Range;
-import de.intevation.flys.model.River;
-
-import org.apache.log4j.Logger;
-
-import de.intevation.artifacts.common.utils.LRUCache;
-
-public class ImporterSession
-{
-    private static Logger log = Logger.getLogger(ImporterSession.class);
-
-    private static final ThreadLocal<ImporterSession> SESSION =
-        new ThreadLocal<ImporterSession>() {
-            @Override
-            protected ImporterSession initialValue() {
-                return new ImporterSession();
-            }
-        };
-
-    protected Session databaseSession;
-
-    protected LRUCache<Integer, Map<ValueKey, WstColumnValue>>
-        wstColumnValues;
-
-    protected LRUCache<Integer, Map<ValueKey, DischargeTableValue>>
-        dischargeTableValues;
-
-    protected LRUCache<Integer, Map<ValueKey, Range>>
-        ranges;
-
-    public static ImporterSession getInstance() {
-        return SESSION.get();
-    }
-
-    public ImporterSession() {
-        SessionFactory sessionFactory =
-            SessionFactoryProvider.createSessionFactory();
-        databaseSession = sessionFactory.openSession();
-        //databaseSession.setFlushMode(FlushMode.MANUAL);
-
-        wstColumnValues =
-            new LRUCache<Integer, Map<ValueKey, WstColumnValue>>();
-
-        dischargeTableValues =
-            new LRUCache<Integer, Map<ValueKey, DischargeTableValue>>();
-
-        ranges = new LRUCache<Integer, Map<ValueKey, Range>>();
-    }
-
-    public Session getDatabaseSession() {
-        return databaseSession;
-    }
-
-    public WstColumnValue getWstColumnValue(
-        WstColumn  column,
-        BigDecimal position,
-        BigDecimal w
-    ) {
-        Integer c = column.getId();
-
-        Map<ValueKey, WstColumnValue> map = wstColumnValues.get(c);
-
-        if (map == null) {
-            map = new TreeMap<ValueKey, WstColumnValue>(
-                ValueKey.EPSILON_COMPARATOR);
-            wstColumnValues.put(c, map);
-            Query query = databaseSession.createQuery(
-                "from WstColumnValue where wstColumn.id=:cid");
-            query.setParameter("cid", c);
-            for (Iterator iter = query.iterate(); iter.hasNext();) {
-                WstColumnValue wcv = (WstColumnValue)iter.next();
-                map.put(new ValueKey(wcv.getPosition(), wcv.getW()), wcv);
-            }
-        }
-
-        ValueKey key = new ValueKey(position, w);
-
-        WstColumnValue wcv = map.get(key);
-
-        if (wcv != null) {
-            return wcv;
-        }
-
-        wcv = new WstColumnValue(column, position, w);
-
-        databaseSession.save(wcv);
-
-        map.put(key, wcv);
-
-        return wcv;
-    }
-
-    public DischargeTableValue getDischargeTableValue(
-        DischargeTable table,
-        BigDecimal     q,
-        BigDecimal     w
-    ) {
-        Integer t = table.getId();
-
-        Map<ValueKey, DischargeTableValue> map =
-            dischargeTableValues.get(t);
-
-        if (map == null) {
-            map = new TreeMap<ValueKey, DischargeTableValue>(
-                ValueKey.EPSILON_COMPARATOR);
-            dischargeTableValues.put(t, map);
-            Query query = databaseSession.createQuery(
-                "from DischargeTableValue where dischargeTable.id=:tid");
-            query.setParameter("tid", t);
-            for (Iterator iter = query.iterate(); iter.hasNext();) {
-                DischargeTableValue dctv = (DischargeTableValue)iter.next();
-                map.put(new ValueKey(dctv.getQ(), dctv.getW()), dctv);
-            }
-        }
-
-        ValueKey key = new ValueKey(q, w);
-
-        DischargeTableValue dctv = map.get(key);
-
-        if (dctv != null) {
-            return dctv;
-        }
-
-        dctv = new DischargeTableValue(table, q, w);
-
-        databaseSession.save(dctv);
-
-        map.put(key, dctv);
-
-        return dctv;
-    }
-
-    public Range getRange(River river, BigDecimal a, BigDecimal b) {
-        Integer r = river.getId();
-
-        Map<ValueKey, Range> map = ranges.get(r);
-
-        if (map == null) {
-            map = new TreeMap<ValueKey, Range>(
-                ValueKey.EPSILON_COMPARATOR);
-            ranges.put(r, map);
-            Query query = databaseSession.createQuery(
-                "from Range where river.id=:rid");
-            query.setParameter("rid", r);
-            for (Iterator iter = query.iterate(); iter.hasNext();) {
-                Range range = (Range)iter.next();
-                map.put(new ValueKey(range.getA(), range.getB()), range);
-            }
-        }
-
-        ValueKey key = new ValueKey(a, b);
-
-        Range range = map.get(key);
-
-        if (range != null) {
-            return range;
-        }
-
-        range = new Range(a, b, river);
-
-        databaseSession.save(range);
-
-        map.put(key, range);
-
-        return range;
-    }
-}
-// vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 :
--- a/flys-backend/src/main/java/de/intevation/flys/importer/ValueKey.java	Thu Apr 25 11:48:36 2013 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,63 +0,0 @@
-package de.intevation.flys.importer;
-
-import java.math.BigDecimal;
-
-import java.util.Comparator;
-
-public class ValueKey
-{
-    public static final double EPSILON = 1e-6;
-
-    public static final Comparator<ValueKey> EPSILON_COMPARATOR =
-        new Comparator<ValueKey>()
-    {
-        public int compare(ValueKey x, ValueKey y) {
-            int cmp = ValueKey.compare(x.a, y.a);
-            if (cmp != 0) return cmp;
-            return ValueKey.compare(x.b, y.b);
-        }
-    };
-
-    public static int compare(BigDecimal a, BigDecimal b) {
-        if (a == null && b == null) return  0;
-        if (a != null && b == null) return +1;
-        if (a == null && b != null) return -1;
-
-        double diff = a.doubleValue() - b.doubleValue();
-        if (diff < -EPSILON) return -1;
-        return diff > EPSILON ? +1 : 0;
-    }
-
-    protected BigDecimal a;
-    protected BigDecimal b;
-
-    public ValueKey() {
-    }
-
-    public ValueKey(BigDecimal a, BigDecimal b) {
-        this.a = a;
-        this.b = b;
-    }
-
-    @Override
-    public int hashCode() {
-        return ((a != null ? a.hashCode() : 0) << 16)
-              | (b != null ? b.hashCode() : 0);
-    }
-
-    @Override
-    public boolean equals(Object other) {
-        if (!(other instanceof ValueKey)) {
-            return false;
-        }
-        ValueKey o = (ValueKey)other;
-        return !(
-               (a == null && o.a != null)
-            || (a != null && o.a == null)
-            || (a != null && !a.equals(o.a))
-            || (b == null && o.b != null)
-            || (b != null && o.b == null)
-            || (b != null && !b.equals(o.b)));
-    }
-}
-// vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 :
--- a/flys-backend/src/main/java/de/intevation/flys/importer/XY.java	Thu Apr 25 11:48:36 2013 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,56 +0,0 @@
-package de.intevation.flys.importer;
-
-
-/** Two doubles and an int index. */
-public class XY
-implements   Comparable<XY>
-{
-    public static final double X_EPSILON = 1e-4;
-
-    protected double x;
-    protected double y;
-    protected int    index;
-
-    public XY() {
-    }
-
-    public XY(double x, double y, int index) {
-        this.x     = x;
-        this.y     = y;
-        this.index = index;
-    }
-
-    @Override
-    public int compareTo(XY other) {
-        if (x + X_EPSILON < other.x) return -1;
-        if (x > other.x + X_EPSILON) return +1;
-        if (index < other.index)     return -1;
-        if (index > other.index)     return +1;
-        return 0;
-    }
-
-    public double getX() {
-        return x;
-    }
-
-    public void setX(double x) {
-        this.x = x;
-    }
-
-    public double getY() {
-        return y;
-    }
-
-    public void setY(double y) {
-        this.y = y;
-    }
-
-    public int getIndex() {
-        return index;
-    }
-
-    public void setIndex(int index) {
-        this.index = index;
-    }
-}
-// vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 :
--- a/flys-backend/src/main/java/de/intevation/flys/importer/parsers/AnnotationClassifier.java	Thu Apr 25 11:48:36 2013 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,232 +0,0 @@
-package de.intevation.flys.importer.parsers;
-
-import org.w3c.dom.Document;
-import org.w3c.dom.NodeList;
-import org.w3c.dom.Element;
-
-import javax.xml.xpath.XPathConstants;
-
-import java.util.Map;
-import java.util.HashMap;
-import java.util.List;
-import java.util.ArrayList;
-
-import java.util.regex.Pattern;
-import java.util.regex.Matcher;
-
-import org.apache.log4j.Logger;
-
-import de.intevation.artifacts.common.utils.XMLUtils;
-
-import de.intevation.flys.importer.ImportAnnotationType;
-import de.intevation.flys.importer.Importer;
-
-public class AnnotationClassifier
-{
-    private static Logger log = Logger.getLogger(Importer.class);
-
-    public static final String TYPES_XPATH =
-        "/annotation/types/type";
-
-    public static final String FILE_PATTERNS_XPATH =
-        "/annotation/patterns/file";
-
-    public static final String DESCRIPTION_PATTERNS_XPATH =
-        "/annotation/patterns/line";
-
-
-    public static class Pair {
-
-        protected Pattern              pattern;
-        protected ImportAnnotationType annType;
-
-        public Pair(Pattern pattern, ImportAnnotationType annType) {
-            this.pattern  = pattern;
-            this.annType = annType;
-        }
-
-        public ImportAnnotationType match(String s) {
-            Matcher m = pattern.matcher(s);
-            return m.matches() ? annType : null;
-        }
-    } // class Pair
-
-
-    protected Map<String, ImportAnnotationType> types;
-    protected List<Pair>                        filePatterns;
-    protected List<Pair>                        descPatterns;
-
-    protected ImportAnnotationType defaultType;
-
-    public AnnotationClassifier() {
-    }
-
-    public AnnotationClassifier(Document rules) {
-        types        = new HashMap<String, ImportAnnotationType>();
-        filePatterns = new ArrayList<Pair>();
-        descPatterns = new ArrayList<Pair>();
-
-        buildRules(rules);
-    }
-
-    protected void buildRules(Document rules) {
-        buildTypes(rules);
-        buildFilePatterns(rules);
-        buildDescriptionPatterns(rules);
-    }
-
-    protected void buildTypes(Document rules) {
-
-        NodeList typeList = (NodeList)XMLUtils.xpath(
-            rules,
-            TYPES_XPATH,
-            XPathConstants.NODESET,
-            null);
-
-        if (typeList == null) {
-            log.info("no rules found.");
-            return;
-        }
-
-        for (int i = 0, N = typeList.getLength(); i < N; ++i) {
-            Element typeElement = (Element)typeList.item(i);
-            String name = typeElement.getAttribute("name");
-            if (name.length() == 0) {
-                log.warn("ANNCLASS: rule has no name");
-                continue;
-            }
-
-            ImportAnnotationType aic = new ImportAnnotationType(name);
-
-            types.put(name, aic);
-
-            if (typeElement.getAttribute("default").equals("true")) {
-                defaultType = aic;
-            }
-        }
-    }
-
-    protected void buildFilePatterns(Document rules) {
-
-        NodeList patternList = (NodeList)XMLUtils.xpath(
-            rules,
-            FILE_PATTERNS_XPATH,
-            XPathConstants.NODESET,
-            null);
-
-        if (patternList == null) {
-            log.info("no file patterns found.");
-            return;
-        }
-
-        for (int i = 0, N = patternList.getLength(); i < N; ++i) {
-            Element element = (Element)patternList.item(i);
-            Pair pair = buildPair(element);
-            if (pair != null) {
-                filePatterns.add(pair);
-            }
-        }
-    }
-
-    protected void buildDescriptionPatterns(Document rules) {
-
-        NodeList patternList = (NodeList)XMLUtils.xpath(
-            rules,
-            DESCRIPTION_PATTERNS_XPATH,
-            XPathConstants.NODESET,
-            null);
-
-        if (patternList == null) {
-            log.info("no line patterns found.");
-            return;
-        }
-
-        for (int i = 0, N = patternList.getLength(); i < N; ++i) {
-            Element element = (Element)patternList.item(i);
-            Pair pair = buildPair(element);
-            if (pair != null) {
-                descPatterns.add(pair);
-            }
-        }
-    }
-
-    protected Pair buildPair(Element element) {
-        String pattern = element.getAttribute("pattern");
-        String type    = element.getAttribute("type");
-
-        if (pattern.length() == 0) {
-            log.warn("ANNCLASS: pattern has no 'pattern' attribute.");
-            return null;
-        }
-
-        if (type.length() == 0) {
-            log.warn("ANNCLASS: pattern has no 'type' attribute.");
-            return null;
-        }
-
-        ImportAnnotationType annType = types.get(type);
-
-        if (annType == null) {
-            log.warn("ANNCLASS: pattern has unknown type '" + type + "'");
-            return null;
-        }
-
-        Pattern p;
-
-        try {
-            p = Pattern.compile(pattern,
-                    Pattern.CASE_INSENSITIVE|Pattern.UNICODE_CASE);
-        }
-        catch (IllegalArgumentException iae) {
-            log.warn("ANNCLASS: pattern '" + pattern + "' is invalid.", iae);
-            return null;
-        }
-
-        return new Pair(p, annType);
-    }
-
-    public ImportAnnotationType getDefaultType() {
-        return defaultType;
-    }
-
-    public ImportAnnotationType classifyFile(String filename) {
-        return classifyFile(filename, null);
-    }
-
-    public ImportAnnotationType classifyFile(
-        String                filename,
-        ImportAnnotationType def
-    ) {
-        if (filename.toLowerCase().endsWith(".km")) {
-            filename = filename.substring(0, filename.length()-3);
-        }
-
-        for (Pair pair: filePatterns) {
-            ImportAnnotationType annType = pair.match(filename);
-            if (annType != null) {
-                return annType;
-            }
-        }
-
-        return def;
-    }
-
-    public ImportAnnotationType classifyDescription(String description) {
-        return classifyDescription(description, null);
-    }
-
-    public ImportAnnotationType classifyDescription(
-        String                description,
-        ImportAnnotationType def
-    ) {
-        for (Pair pair: descPatterns) {
-            ImportAnnotationType annType = pair.match(description);
-            if (annType != null) {
-                return annType;
-            }
-        }
-
-        return def;
-    }
-}
-// vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 :
--- a/flys-backend/src/main/java/de/intevation/flys/importer/parsers/AnnotationsParser.java	Thu Apr 25 11:48:36 2013 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,198 +0,0 @@
-package de.intevation.flys.importer.parsers;
-
-import java.util.HashMap;
-import java.util.TreeSet;
-import java.util.List;
-import java.util.ArrayList;
-
-import java.io.IOException;
-import java.io.File;
-import java.io.LineNumberReader;
-import java.io.InputStreamReader;
-import java.io.FileInputStream;
-
-import java.math.BigDecimal;
-
-import org.apache.log4j.Logger;
-
-import de.intevation.artifacts.common.utils.FileTools;
-
-import de.intevation.flys.importer.ImportAnnotation;
-import de.intevation.flys.importer.ImportRange;
-import de.intevation.flys.importer.ImportEdge;
-import de.intevation.flys.importer.ImportAnnotationType;
-import de.intevation.flys.importer.ImportAttribute;
-import de.intevation.flys.importer.ImportPosition;
-
-public class AnnotationsParser
-{
-    private static Logger log = Logger.getLogger(AnnotationsParser.class);
-
-    public static final String ENCODING = "ISO-8859-1";
-
-    public static final String [] TO_SCAN = {
-        "Basisdaten",
-        "Streckendaten",
-        ".." + File.separator +
-            "Morphologie" + File.separator + "Streckendaten"
-    };
-
-    protected HashMap<String, ImportAttribute> attributes;
-    protected HashMap<String, ImportPosition>  positions;
-    protected TreeSet<ImportAnnotation>        annotations;
-    protected AnnotationClassifier             classifier;
-
-    public AnnotationsParser() {
-        this(null);
-    }
-
-    public AnnotationsParser(AnnotationClassifier classifier) {
-        attributes  = new HashMap<String, ImportAttribute>();
-        positions   = new HashMap<String, ImportPosition>();
-        annotations = new TreeSet<ImportAnnotation>();
-        this.classifier = classifier;
-    }
-
-    public void parseFile(File file) throws IOException {
-        log.info("parsing km file: '" + file + "'");
-
-        ImportAnnotationType defaultIAT = null;
-
-        if (classifier != null) {
-            defaultIAT = classifier.classifyFile(
-                file.getName(),
-                classifier.getDefaultType());
-        }
-
-        LineNumberReader in = null;
-        try {
-            in =
-                new LineNumberReader(
-                new InputStreamReader(
-                new FileInputStream(file), ENCODING));
-
-            String line = null;
-            while ((line = in.readLine()) != null) {
-                if ((line = line.trim()).length() == 0
-                || line.startsWith("*")) {
-                    continue;
-                }
-
-                String [] parts = line.split("\\s*;\\s*");
-
-                if (parts.length < 3) {
-                    log.warn("ANN: not enough columns in line "
-                        + in.getLineNumber());
-                    continue;
-                }
-
-                ImportPosition position = positions.get(parts[0]);
-                if (position == null) {
-                    position = new ImportPosition(parts[0]);
-                    positions.put(parts[0], position);
-                }
-
-                ImportAttribute attribute = attributes.get(parts[1]);
-                if (attribute == null) {
-                    attribute = new ImportAttribute(parts[1]);
-                    attributes.put(parts[1], attribute);
-                }
-
-                String [] r = parts[2].replace(",", ".").split("\\s*#\\s*");
-
-                BigDecimal from, to;
-
-                try {
-                    from = new BigDecimal(r[0]);
-                    to   = r.length < 2 ? null : new BigDecimal(r[1]);
-                    if (to != null && from.compareTo(to) > 0) {
-                        BigDecimal t = from; from = to; to = t;
-                    }
-                }
-                catch (NumberFormatException nfe) {
-                    log.warn("ANN: invalid number in line " + in.getLineNumber());
-                    continue;
-                }
-
-                ImportEdge edge = null;
-
-                if (parts.length == 4) { // Only 'Unterkante'
-                    try {
-                        edge = new ImportEdge(
-                            null,
-                            new BigDecimal(parts[3].trim().replace(',', '.')));
-                    }
-                    catch (NumberFormatException nfe) {
-                        log.warn("ANN: cannot parse 'Unterkante' in line " +
-                            in.getLineNumber());
-                    }
-                }
-                else if (parts.length > 4) { // 'Unterkante' and 'Oberkante'
-                    String bottom = parts[3].trim().replace(',', '.');
-                    String top    = parts[4].trim().replace(',', '.');
-                    try {
-                        BigDecimal b = bottom.length() == 0
-                            ? null
-                            : new BigDecimal(bottom);
-                        BigDecimal t = top.length() == 0
-                            ? null
-                            : new BigDecimal(top);
-                        edge = new ImportEdge(t, b);
-                    }
-                    catch (NumberFormatException nfe) {
-                        log.warn(
-                            "ANN: cannot parse 'Unterkante' or 'Oberkante' in line "
-                            + in.getLineNumber());
-                    }
-                }
-
-                ImportRange range = new ImportRange(from, to);
-
-                ImportAnnotationType type = classifier != null
-                    ? classifier.classifyDescription(line, defaultIAT)
-                    : null;
-
-                ImportAnnotation annotation = new ImportAnnotation(
-                    attribute, position, range, edge, type);
-
-                if (!annotations.add(annotation)) {
-                    log.info("ANN: duplicated annotation '" + parts[0] +
-                        "' in line " + in.getLineNumber());
-                }
-            }
-        }
-        finally {
-            if (in != null) {
-                in.close();
-            }
-        }
-    }
-
-    public void parse(File root) throws IOException {
-
-        for (String toScan: TO_SCAN) {
-            File directory = FileTools.repair(new File(root, toScan));
-            if (!directory.isDirectory()) {
-                log.warn("ANN: '" + directory + "' is not a directory.");
-                continue;
-            }
-            File [] files = directory.listFiles();
-            if (files == null) {
-                log.warn("ANN: cannot list directory '" + directory + "'");
-                continue;
-            }
-
-            for (File file: files) {
-                if (file.isFile() && file.canRead()
-                && file.getName().toLowerCase().endsWith(".km")) {
-                    parseFile(file);
-                }
-            }
-        } // for all directories to scan
-    }
-
-    public List<ImportAnnotation> getAnnotations() {
-        return new ArrayList<ImportAnnotation>(annotations);
-    }
-}
-// vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 :
--- a/flys-backend/src/main/java/de/intevation/flys/importer/parsers/AtFileParser.java	Thu Apr 25 11:48:36 2013 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,222 +0,0 @@
-package de.intevation.flys.importer.parsers;
-
-import java.io.BufferedReader;
-import java.io.File;
-import java.io.FileInputStream;
-import java.io.InputStreamReader;
-import java.io.IOException;
-import java.math.BigDecimal;
-
-import org.apache.log4j.Logger;
-
-import de.intevation.flys.importer.ImportDischargeTable;
-import de.intevation.flys.importer.ImportDischargeTableValue;
-
-import java.util.regex.Pattern;
-import java.util.regex.Matcher;
-
-import java.util.Date;
-import java.util.Calendar;
-
-import de.intevation.flys.importer.ImportTimeInterval;
-
-/** Parse *.at (Abflusstafeln?) files. */
-public class AtFileParser {
-
-    public static final String ENCODING = "ISO-8859-1";
-
-    private static Logger logger = Logger.getLogger(AtFileParser.class);
-
-    // regular expression from hell to find out time range
-    public static final Pattern DATE_LINE = Pattern.compile(
-        "^\\*\\s*Abflu[^t]+tafel?\\s*([^\\d]+)"  +
-        "(\\d{1,2})?\\.?(\\d{1,2})?\\.?(\\d{2,4})\\s*(?:(?:bis)|-)?\\s*" +
-        "(?:(\\d{1,2})?\\.?(\\d{1,2})?\\.?(\\d{2,4}))?\\s*.*$");
-
-    public AtFileParser() {
-    }
-
-
-    public ImportDischargeTable parse(File file) throws IOException {
-        return parse(file, "", 0);
-    }
-
-    public ImportDischargeTable parse(
-        File   file,
-        String prefix,
-        int    kind
-    )
-    throws IOException {
-
-        logger.info("parsing AT file: " + file);
-
-        BufferedReader br = null;
-
-        String line       = null;
-
-        boolean beginning = true;
-
-        ImportDischargeTable dischargeTable =
-            new ImportDischargeTable(kind, prefix + file.getName());
-
-        Date from = null;
-        Date to   = null;
-
-        try {
-            br = new BufferedReader(
-                 new InputStreamReader(
-                 new FileInputStream(file), ENCODING));
-
-            while ((line = br.readLine()) != null) {
-
-                String tmp = line.trim();
-
-                if (tmp.length() == 0) {
-                    continue;
-                }
-
-                Matcher m = DATE_LINE.matcher(tmp);
-                if (m.matches()) {
-                    from = guessDate(m.group(2), m.group(3), m.group(4));
-                    to   = guessDate(m.group(5), m.group(6), m.group(7));
-                    if (from == null) {
-                        Date t = from; from = to; to = t;
-                    }
-                    continue;
-                }
-
-                if (tmp.startsWith("#! name=")) {
-                    // XXX Skip the name,  because we don't know where to save
-                    // it at the moment
-
-                    //String name = tmp.substring(8);
-                    continue;
-                }
-
-                if (tmp.startsWith("#") || tmp.startsWith("*")) {
-                    continue;
-                }
-
-                String[] splits = tmp.replace(',', '.').split("\\s+");
-
-                if ((splits.length < 2) || (splits.length > 11)) {
-                    logger.warn("Found an invalid row in the AT file.");
-                    continue;
-                }
-
-                String strW = splits[0].trim();
-                double W    = Double.parseDouble(strW);
-
-                /* shift is used to differenciate between lines with
-                 * exactly 10 Qs and lines with less than 10 Qs. The shift
-                 * is only modified when it is the first line.
-                 */
-                int shift = -1;
-
-                if (splits.length != 11 && beginning) {
-                    shift = 10 - splits.length;
-                }
-
-
-                for (int i = 1; i < splits.length; i++) {
-                    double iW = W + shift + i;
-                    double iQ = Double.parseDouble(splits[i].trim());
-
-                    dischargeTable.addDischargeTableValue(
-                        new ImportDischargeTableValue(
-                            new BigDecimal(iQ/100.0),
-                            new BigDecimal(iW/100.0)));
-                }
-
-                beginning = false;
-            }
-        }
-        catch (NumberFormatException pe) {
-            logger.warn("AT: invalid number " + pe.getMessage());
-        }
-        finally {
-            if (br != null) {
-                br.close();
-            }
-        }
-
-        if (from != null) {
-            if (to != null && from.compareTo(to) > 0) {
-                Date t = from; from = to; to = t;
-            }
-            logger.info("from: " + from + " to: " + to);
-            ImportTimeInterval interval = new ImportTimeInterval(from, to);
-            dischargeTable.setTimeInterval(interval);
-        }
-
-        logger.info("Finished parsing AT file: " + file);
-
-        return dischargeTable;
-    }
-
-    public static Date guessDate(String day, String month, String year) {
-        // TODO evaluate whether DateGuesser class can do that.
-        if (day == null && month == null && year == null) {
-            return null;
-        }
-
-        logger.debug("day: " + day + " month: " + month + " year: " + year);
-
-        int dayI = 15;
-        if (day != null) {
-            try {
-                dayI = Integer.parseInt(day.trim());
-            }
-            catch (NumberFormatException nfe) {
-            }
-        }
-
-        int monthI = 6;
-        if (month != null) {
-            try {
-                monthI = Integer.parseInt(month.trim());
-            }
-            catch (NumberFormatException nfe) {
-            }
-        }
-
-        int yearI = 1900;
-        if (year != null) {
-            try {
-                yearI = Integer.parseInt(year.trim());
-                if (yearI < 100) {
-                    if (yearI < 20) {
-                        yearI += 2000;
-                    }
-                    else {
-                        yearI += 1900;
-                    }
-                }
-            }
-            catch (NumberFormatException nfe) {
-            }
-        }
-
-        Calendar cal = Calendar.getInstance();
-        cal.set(yearI, monthI-1, dayI, 12, 0, 0);
-        long ms = cal.getTimeInMillis();
-        cal.setTimeInMillis(ms - ms%1000);
-        return cal.getTime();
-    }
-
-<