Mercurial > dive4elements > river
comparison flys-backend/src/main/java/de/intevation/flys/importer/ImportFlowVelocityMeasurement.java @ 2832:ac5bd90697c1
Added new parser for flow velocity measurements and fixed some smaller bugs while importing flow velocity data.
flys-backend/trunk@4250 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author | Ingo Weinzierl <ingo.weinzierl@intevation.de> |
---|---|
date | Tue, 17 Apr 2012 13:00:04 +0000 |
parents | 8fe9c6584b93 |
children | a5b003595d6c |
comparison
equal
deleted
inserted
replaced
2831:8fe9c6584b93 | 2832:ac5bd90697c1 |
---|---|
1 package de.intevation.flys.importer; | 1 package de.intevation.flys.importer; |
2 | 2 |
3 import java.sql.SQLException; | 3 import java.sql.SQLException; |
4 import java.util.ArrayList; | |
4 import java.util.List; | 5 import java.util.List; |
5 | 6 |
6 import org.apache.log4j.Logger; | 7 import org.apache.log4j.Logger; |
7 | 8 |
8 import org.hibernate.Session; | 9 import org.hibernate.Session; |
31 } | 32 } |
32 | 33 |
33 | 34 |
34 public ImportFlowVelocityMeasurement(String description) { | 35 public ImportFlowVelocityMeasurement(String description) { |
35 this.description = description; | 36 this.description = description; |
37 this.values = new ArrayList<ImportFlowVelocityMeasurementValue>(); | |
38 } | |
39 | |
40 | |
41 public void setDescription(String description) { | |
42 this.description = description; | |
43 } | |
44 | |
45 | |
46 public void addValue(ImportFlowVelocityMeasurementValue value) { | |
47 this.values.add(value); | |
36 } | 48 } |
37 | 49 |
38 | 50 |
39 public void storeDependencies(River river) | 51 public void storeDependencies(River river) |
40 throws SQLException, ConstraintViolationException | 52 throws SQLException, ConstraintViolationException |
53 if (peer == null) { | 65 if (peer == null) { |
54 Session session = ImporterSession.getInstance().getDatabaseSession(); | 66 Session session = ImporterSession.getInstance().getDatabaseSession(); |
55 | 67 |
56 Query query = session.createQuery( | 68 Query query = session.createQuery( |
57 "from FlowVelocityMeasurement where " + | 69 "from FlowVelocityMeasurement where " + |
58 " river:=river and " + | 70 " river=:river and " + |
59 " description:=description" | 71 " description=:description" |
60 ); | 72 ); |
61 | 73 |
62 query.setParameter("river", river); | 74 query.setParameter("river", river); |
63 query.setParameter("description", description); | 75 query.setParameter("description", description); |
64 | 76 |