Mercurial > dive4elements > river
annotate flys-backend/src/main/java/de/intevation/flys/importer/ImportWst.java @ 5708:e8469247dc6b
Backend: Reset km index after parsing a file.
author | Sascha L. Teichmann <teichmann@intevation.de> |
---|---|
date | Mon, 15 Apr 2013 15:48:58 +0200 |
parents | f3b270e5462e |
children |
rev | line source |
---|---|
196
a33c065b95eb
Added importer helper model stubs for WST imports.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
1 package de.intevation.flys.importer; |
a33c065b95eb
Added importer helper model stubs for WST imports.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
2 |
a33c065b95eb
Added importer helper model stubs for WST imports.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
3 import de.intevation.flys.model.Wst; |
201
3169b559ca3c
Build models for wsts, wst columns and q ranges and store them in the backend.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
196
diff
changeset
|
4 import de.intevation.flys.model.River; |
3169b559ca3c
Build models for wsts, wst columns and q ranges and store them in the backend.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
196
diff
changeset
|
5 |
478
db430bd9e0e0
Implemented a WstColumnValue cache to speed up inserting WST files into database.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
474
diff
changeset
|
6 import org.apache.log4j.Logger; |
db430bd9e0e0
Implemented a WstColumnValue cache to speed up inserting WST files into database.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
474
diff
changeset
|
7 |
201
3169b559ca3c
Build models for wsts, wst columns and q ranges and store them in the backend.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
196
diff
changeset
|
8 import org.hibernate.Session; |
3169b559ca3c
Build models for wsts, wst columns and q ranges and store them in the backend.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
196
diff
changeset
|
9 import org.hibernate.Query; |
3169b559ca3c
Build models for wsts, wst columns and q ranges and store them in the backend.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
196
diff
changeset
|
10 |
478
db430bd9e0e0
Implemented a WstColumnValue cache to speed up inserting WST files into database.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
474
diff
changeset
|
11 import java.util.ArrayList; |
201
3169b559ca3c
Build models for wsts, wst columns and q ranges and store them in the backend.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
196
diff
changeset
|
12 import java.util.List; |
196
a33c065b95eb
Added importer helper model stubs for WST imports.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
13 |
a33c065b95eb
Added importer helper model stubs for WST imports.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
14 public class ImportWst |
a33c065b95eb
Added importer helper model stubs for WST imports.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
15 { |
499
cce054f27dac
Importer: Only accept main value types 'Q', 'W', 'D' and 'T' by default.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
497
diff
changeset
|
16 private static Logger log = Logger.getLogger(ImportWst.class); |
478
db430bd9e0e0
Implemented a WstColumnValue cache to speed up inserting WST files into database.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
474
diff
changeset
|
17 |
201
3169b559ca3c
Build models for wsts, wst columns and q ranges and store them in the backend.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
196
diff
changeset
|
18 protected String description; |
3169b559ca3c
Build models for wsts, wst columns and q ranges and store them in the backend.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
196
diff
changeset
|
19 |
467
c8c09e31cdb8
Added new column 'kind' in discharge tables and wst to distinguish between different types.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
201
diff
changeset
|
20 protected Integer kind; |
c8c09e31cdb8
Added new column 'kind' in discharge tables and wst to distinguish between different types.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
201
diff
changeset
|
21 |
474
5d920695a7f0
Import of q ranges of wst files was totally broken.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
471
diff
changeset
|
22 protected List<ImportWstColumn> columns; |
201
3169b559ca3c
Build models for wsts, wst columns and q ranges and store them in the backend.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
196
diff
changeset
|
23 |
2346
f834b411ca57
Added db table, model class and importer stuff for units.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
503
diff
changeset
|
24 protected ImportUnit unit; |
f834b411ca57
Added db table, model class and importer stuff for units.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
503
diff
changeset
|
25 |
5000 | 26 /** Wst as in db. */ |
196
a33c065b95eb
Added importer helper model stubs for WST imports.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
27 protected Wst peer; |
a33c065b95eb
Added importer helper model stubs for WST imports.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
28 |
a33c065b95eb
Added importer helper model stubs for WST imports.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
29 public ImportWst() { |
467
c8c09e31cdb8
Added new column 'kind' in discharge tables and wst to distinguish between different types.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
201
diff
changeset
|
30 kind = 0; |
474
5d920695a7f0
Import of q ranges of wst files was totally broken.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
471
diff
changeset
|
31 columns = new ArrayList<ImportWstColumn>(); |
196
a33c065b95eb
Added importer helper model stubs for WST imports.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
32 } |
a33c065b95eb
Added importer helper model stubs for WST imports.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
33 |
201
3169b559ca3c
Build models for wsts, wst columns and q ranges and store them in the backend.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
196
diff
changeset
|
34 public ImportWst(String description) { |
3169b559ca3c
Build models for wsts, wst columns and q ranges and store them in the backend.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
196
diff
changeset
|
35 this(); |
3169b559ca3c
Build models for wsts, wst columns and q ranges and store them in the backend.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
196
diff
changeset
|
36 this.description = description; |
3169b559ca3c
Build models for wsts, wst columns and q ranges and store them in the backend.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
196
diff
changeset
|
37 } |
3169b559ca3c
Build models for wsts, wst columns and q ranges and store them in the backend.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
196
diff
changeset
|
38 |
3169b559ca3c
Build models for wsts, wst columns and q ranges and store them in the backend.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
196
diff
changeset
|
39 public String getDescription() { |
3169b559ca3c
Build models for wsts, wst columns and q ranges and store them in the backend.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
196
diff
changeset
|
40 return description; |
3169b559ca3c
Build models for wsts, wst columns and q ranges and store them in the backend.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
196
diff
changeset
|
41 } |
3169b559ca3c
Build models for wsts, wst columns and q ranges and store them in the backend.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
196
diff
changeset
|
42 |
482
3a99d0295006
Importer: Support parsing "zusaetzliche Laengsschnitte".
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
478
diff
changeset
|
43 public Integer getKind() { |
3a99d0295006
Importer: Support parsing "zusaetzliche Laengsschnitte".
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
478
diff
changeset
|
44 return kind; |
3a99d0295006
Importer: Support parsing "zusaetzliche Laengsschnitte".
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
478
diff
changeset
|
45 } |
3a99d0295006
Importer: Support parsing "zusaetzliche Laengsschnitte".
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
478
diff
changeset
|
46 |
3a99d0295006
Importer: Support parsing "zusaetzliche Laengsschnitte".
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
478
diff
changeset
|
47 public void setKind(Integer kind) { |
3a99d0295006
Importer: Support parsing "zusaetzliche Laengsschnitte".
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
478
diff
changeset
|
48 this.kind = kind; |
3a99d0295006
Importer: Support parsing "zusaetzliche Laengsschnitte".
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
478
diff
changeset
|
49 } |
3a99d0295006
Importer: Support parsing "zusaetzliche Laengsschnitte".
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
478
diff
changeset
|
50 |
3a99d0295006
Importer: Support parsing "zusaetzliche Laengsschnitte".
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
478
diff
changeset
|
51 |
201
3169b559ca3c
Build models for wsts, wst columns and q ranges and store them in the backend.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
196
diff
changeset
|
52 public void setDescription(String description) { |
3169b559ca3c
Build models for wsts, wst columns and q ranges and store them in the backend.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
196
diff
changeset
|
53 this.description = description; |
3169b559ca3c
Build models for wsts, wst columns and q ranges and store them in the backend.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
196
diff
changeset
|
54 } |
3169b559ca3c
Build models for wsts, wst columns and q ranges and store them in the backend.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
196
diff
changeset
|
55 |
5263
db341e37d194
ImportWst: Doc and getters.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
5000
diff
changeset
|
56 /** Create columns that can be accessed with getColumn. */ |
474
5d920695a7f0
Import of q ranges of wst files was totally broken.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
471
diff
changeset
|
57 public void setNumberColumns(int numColumns) { |
5d920695a7f0
Import of q ranges of wst files was totally broken.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
471
diff
changeset
|
58 for (int i = 0; i < numColumns; ++i) { |
497
67fd63e4ef66
Importer: centralized caching
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
482
diff
changeset
|
59 columns.add(new ImportWstColumn(this, null, null, i)); |
201
3169b559ca3c
Build models for wsts, wst columns and q ranges and store them in the backend.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
196
diff
changeset
|
60 } |
474
5d920695a7f0
Import of q ranges of wst files was totally broken.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
471
diff
changeset
|
61 } |
5d920695a7f0
Import of q ranges of wst files was totally broken.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
471
diff
changeset
|
62 |
5d920695a7f0
Import of q ranges of wst files was totally broken.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
471
diff
changeset
|
63 public int getNumberColumns() { |
5d920695a7f0
Import of q ranges of wst files was totally broken.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
471
diff
changeset
|
64 return columns.size(); |
5d920695a7f0
Import of q ranges of wst files was totally broken.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
471
diff
changeset
|
65 } |
5d920695a7f0
Import of q ranges of wst files was totally broken.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
471
diff
changeset
|
66 |
5d920695a7f0
Import of q ranges of wst files was totally broken.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
471
diff
changeset
|
67 public ImportWstColumn getColumn(int index) { |
5d920695a7f0
Import of q ranges of wst files was totally broken.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
471
diff
changeset
|
68 return columns.get(index); |
201
3169b559ca3c
Build models for wsts, wst columns and q ranges and store them in the backend.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
196
diff
changeset
|
69 } |
3169b559ca3c
Build models for wsts, wst columns and q ranges and store them in the backend.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
196
diff
changeset
|
70 |
5263
db341e37d194
ImportWst: Doc and getters.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
5000
diff
changeset
|
71 public List<ImportWstColumn> getColumns() { |
db341e37d194
ImportWst: Doc and getters.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
5000
diff
changeset
|
72 return columns; |
db341e37d194
ImportWst: Doc and getters.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
5000
diff
changeset
|
73 } |
db341e37d194
ImportWst: Doc and getters.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
5000
diff
changeset
|
74 |
db341e37d194
ImportWst: Doc and getters.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
5000
diff
changeset
|
75 /** Adds a column. Assumes that columns wst is this instance. */ |
db341e37d194
ImportWst: Doc and getters.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
5000
diff
changeset
|
76 public void addColumn(ImportWstColumn column) { |
db341e37d194
ImportWst: Doc and getters.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
5000
diff
changeset
|
77 columns.add(column); |
db341e37d194
ImportWst: Doc and getters.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
5000
diff
changeset
|
78 } |
db341e37d194
ImportWst: Doc and getters.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
5000
diff
changeset
|
79 |
2347
0acf28a3d28a
Removed the Unit from Wsts - added a WstUnit column to rivers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2346
diff
changeset
|
80 public ImportUnit getUnit() { |
0acf28a3d28a
Removed the Unit from Wsts - added a WstUnit column to rivers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2346
diff
changeset
|
81 return unit; |
0acf28a3d28a
Removed the Unit from Wsts - added a WstUnit column to rivers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2346
diff
changeset
|
82 } |
0acf28a3d28a
Removed the Unit from Wsts - added a WstUnit column to rivers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2346
diff
changeset
|
83 |
2346
f834b411ca57
Added db table, model class and importer stuff for units.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
503
diff
changeset
|
84 public void setUnit(ImportUnit unit) { |
f834b411ca57
Added db table, model class and importer stuff for units.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
503
diff
changeset
|
85 this.unit = unit; |
f834b411ca57
Added db table, model class and importer stuff for units.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
503
diff
changeset
|
86 } |
f834b411ca57
Added db table, model class and importer stuff for units.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
503
diff
changeset
|
87 |
201
3169b559ca3c
Build models for wsts, wst columns and q ranges and store them in the backend.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
196
diff
changeset
|
88 public void storeDependencies(River river) { |
499
cce054f27dac
Importer: Only accept main value types 'Q', 'W', 'D' and 'T' by default.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
497
diff
changeset
|
89 |
cce054f27dac
Importer: Only accept main value types 'Q', 'W', 'D' and 'T' by default.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
497
diff
changeset
|
90 log.info("store '" + description + "'"); |
201
3169b559ca3c
Build models for wsts, wst columns and q ranges and store them in the backend.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
196
diff
changeset
|
91 Wst wst = getPeer(river); |
3169b559ca3c
Build models for wsts, wst columns and q ranges and store them in the backend.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
196
diff
changeset
|
92 |
474
5d920695a7f0
Import of q ranges of wst files was totally broken.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
471
diff
changeset
|
93 for (ImportWstColumn column: columns) { |
201
3169b559ca3c
Build models for wsts, wst columns and q ranges and store them in the backend.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
196
diff
changeset
|
94 column.storeDependencies(river); |
3169b559ca3c
Build models for wsts, wst columns and q ranges and store them in the backend.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
196
diff
changeset
|
95 } |
2346
f834b411ca57
Added db table, model class and importer stuff for units.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
503
diff
changeset
|
96 |
503
bcc18293a547
Importer: Added unsharp lookup to avoid numerical problems.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
499
diff
changeset
|
97 Session session = ImporterSession.getInstance().getDatabaseSession(); |
bcc18293a547
Importer: Added unsharp lookup to avoid numerical problems.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
499
diff
changeset
|
98 session.flush(); |
201
3169b559ca3c
Build models for wsts, wst columns and q ranges and store them in the backend.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
196
diff
changeset
|
99 } |
3169b559ca3c
Build models for wsts, wst columns and q ranges and store them in the backend.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
196
diff
changeset
|
100 |
5542
f3b270e5462e
Wst Parser: Another attempt to fix the order of the Q ranges.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
5263
diff
changeset
|
101 public void fixRangesOrder() { |
f3b270e5462e
Wst Parser: Another attempt to fix the order of the Q ranges.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
5263
diff
changeset
|
102 for (ImportWstColumn column: columns) { |
f3b270e5462e
Wst Parser: Another attempt to fix the order of the Q ranges.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
5263
diff
changeset
|
103 column.fixRangesOrder(); |
f3b270e5462e
Wst Parser: Another attempt to fix the order of the Q ranges.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
5263
diff
changeset
|
104 } |
f3b270e5462e
Wst Parser: Another attempt to fix the order of the Q ranges.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
5263
diff
changeset
|
105 } |
f3b270e5462e
Wst Parser: Another attempt to fix the order of the Q ranges.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
5263
diff
changeset
|
106 |
5000 | 107 /** Get corresponding mapped wst (from database). */ |
201
3169b559ca3c
Build models for wsts, wst columns and q ranges and store them in the backend.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
196
diff
changeset
|
108 public Wst getPeer(River river) { |
196
a33c065b95eb
Added importer helper model stubs for WST imports.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
109 if (peer == null) { |
497
67fd63e4ef66
Importer: centralized caching
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
482
diff
changeset
|
110 Session session = ImporterSession.getInstance().getDatabaseSession(); |
201
3169b559ca3c
Build models for wsts, wst columns and q ranges and store them in the backend.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
196
diff
changeset
|
111 Query query = session.createQuery( |
3169b559ca3c
Build models for wsts, wst columns and q ranges and store them in the backend.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
196
diff
changeset
|
112 "from Wst where " + |
467
c8c09e31cdb8
Added new column 'kind' in discharge tables and wst to distinguish between different types.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
201
diff
changeset
|
113 "river=:river and description=:description and kind=:kind"); |
201
3169b559ca3c
Build models for wsts, wst columns and q ranges and store them in the backend.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
196
diff
changeset
|
114 query.setParameter("river", river); |
3169b559ca3c
Build models for wsts, wst columns and q ranges and store them in the backend.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
196
diff
changeset
|
115 query.setParameter("description", description); |
467
c8c09e31cdb8
Added new column 'kind' in discharge tables and wst to distinguish between different types.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
201
diff
changeset
|
116 query.setParameter("kind", kind); |
201
3169b559ca3c
Build models for wsts, wst columns and q ranges and store them in the backend.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
196
diff
changeset
|
117 List<Wst> wsts = query.list(); |
3169b559ca3c
Build models for wsts, wst columns and q ranges and store them in the backend.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
196
diff
changeset
|
118 if (wsts.isEmpty()) { |
2347
0acf28a3d28a
Removed the Unit from Wsts - added a WstUnit column to rivers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2346
diff
changeset
|
119 peer = new Wst(river, description, kind); |
201
3169b559ca3c
Build models for wsts, wst columns and q ranges and store them in the backend.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
196
diff
changeset
|
120 session.save(peer); |
3169b559ca3c
Build models for wsts, wst columns and q ranges and store them in the backend.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
196
diff
changeset
|
121 } |
3169b559ca3c
Build models for wsts, wst columns and q ranges and store them in the backend.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
196
diff
changeset
|
122 else { |
3169b559ca3c
Build models for wsts, wst columns and q ranges and store them in the backend.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
196
diff
changeset
|
123 peer = wsts.get(0); |
3169b559ca3c
Build models for wsts, wst columns and q ranges and store them in the backend.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
196
diff
changeset
|
124 } |
3169b559ca3c
Build models for wsts, wst columns and q ranges and store them in the backend.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
196
diff
changeset
|
125 |
196
a33c065b95eb
Added importer helper model stubs for WST imports.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
126 } |
a33c065b95eb
Added importer helper model stubs for WST imports.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
127 return peer; |
a33c065b95eb
Added importer helper model stubs for WST imports.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
128 } |
a33c065b95eb
Added importer helper model stubs for WST imports.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
129 } |
a33c065b95eb
Added importer helper model stubs for WST imports.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
130 // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 : |