Mercurial > dive4elements > river
comparison flys-backend/src/main/java/de/intevation/flys/importer/ImportSedimentDensityValue.java @ 5507:db6c7268b08e
Schema change: add shore offset to sediment density values and be more rigid with input files in parser
author | Tom Gottfried <tom.gottfried@intevation.de> |
---|---|
date | Thu, 28 Mar 2013 16:41:30 +0100 |
parents | be9e28cff0c4 |
children |
comparison
equal
deleted
inserted
replaced
5506:57f802db5c5a | 5507:db6c7268b08e |
---|---|
21 | 21 |
22 protected SedimentDensityValue peer; | 22 protected SedimentDensityValue peer; |
23 | 23 |
24 protected BigDecimal station; | 24 protected BigDecimal station; |
25 | 25 |
26 protected BigDecimal shoreOffset; | |
27 | |
26 protected BigDecimal density; | 28 protected BigDecimal density; |
27 | 29 |
28 private BigDecimal year; | 30 private BigDecimal year; |
29 | 31 |
30 protected String description; | 32 protected String description; |
31 | 33 |
32 | 34 |
33 public ImportSedimentDensityValue( | 35 public ImportSedimentDensityValue( |
34 BigDecimal station, | 36 BigDecimal station, |
37 BigDecimal shoreOffset, | |
35 BigDecimal density, | 38 BigDecimal density, |
36 BigDecimal year, | 39 BigDecimal year, |
37 String description | 40 String description |
38 ) { | 41 ) { |
39 this.station = station; | 42 this.station = station; |
43 this.shoreOffset = shoreOffset; | |
40 this.density = density; | 44 this.density = density; |
41 this.year = year; | 45 this.year = year; |
42 this.description = description; | 46 this.description = description; |
43 } | 47 } |
44 | 48 |
58 | 62 |
59 Query query = session.createQuery( | 63 Query query = session.createQuery( |
60 "from SedimentDensityValue where " + | 64 "from SedimentDensityValue where " + |
61 " sedimentDensity=:sedimentDensity and " + | 65 " sedimentDensity=:sedimentDensity and " + |
62 " station=:station and " + | 66 " station=:station and " + |
67 " shoreOffset=:shoreOffset and " + | |
63 " density=:density and " + | 68 " density=:density and " + |
64 " year=:year and " + | 69 " year=:year and " + |
65 " description=:description"); | 70 " description=:description"); |
66 | 71 |
67 query.setParameter("sedimentDensity", sedimentDensity); | 72 query.setParameter("sedimentDensity", sedimentDensity); |
68 query.setParameter("station", station); | 73 query.setParameter("station", station); |
74 query.setParameter("shoreOffset", shoreOffset); | |
69 query.setParameter("density", density); | 75 query.setParameter("density", density); |
70 query.setParameter("year", year); | 76 query.setParameter("year", year); |
71 query.setParameter("description", description); | 77 query.setParameter("description", description); |
72 | 78 |
73 List<SedimentDensityValue> values = query.list(); | 79 List<SedimentDensityValue> values = query.list(); |
75 log.debug("Create new SedimentDensityValue DB instance."); | 81 log.debug("Create new SedimentDensityValue DB instance."); |
76 | 82 |
77 peer = new SedimentDensityValue( | 83 peer = new SedimentDensityValue( |
78 sedimentDensity, | 84 sedimentDensity, |
79 station, | 85 station, |
86 shoreOffset, | |
80 density, | 87 density, |
81 year, | 88 year, |
82 description); | 89 description); |
83 | 90 |
84 session.save(peer); | 91 session.save(peer); |