Mercurial > dive4elements > river
comparison backend/src/main/java/org/dive4elements/river/model/sinfo/Infrastructure.java @ 8971:50416a0df385
Importer for the Schifffahrt (S-INFO) and Oekologie (U-INFO) files
author | mschaefer |
---|---|
date | Tue, 03 Apr 2018 10:18:30 +0200 |
parents | |
children | 4c5eeaff554c |
comparison
equal
deleted
inserted
replaced
8970:da5dc7446652 | 8971:50416a0df385 |
---|---|
1 /* Copyright (C) 2017 by Bundesanstalt für Gewässerkunde | |
2 * Software engineering by | |
3 * Björnsen Beratende Ingenieure GmbH | |
4 * Dr. Schumacher Ingenieurbüro für Wasser und Umwelt | |
5 * | |
6 * This file is Free Software under the GNU AGPL (>=v3) | |
7 * and comes with ABSOLUTELY NO WARRANTY! Check out the | |
8 * documentation coming with Dive4Elements River for details. | |
9 */ | |
10 | |
11 package org.dive4elements.river.model.sinfo; | |
12 | |
13 import java.io.Serializable; | |
14 import java.util.ArrayList; | |
15 import java.util.List; | |
16 | |
17 import javax.persistence.Column; | |
18 import javax.persistence.Entity; | |
19 import javax.persistence.GeneratedValue; | |
20 import javax.persistence.GenerationType; | |
21 import javax.persistence.Id; | |
22 import javax.persistence.JoinColumn; | |
23 import javax.persistence.OneToMany; | |
24 import javax.persistence.OneToOne; | |
25 import javax.persistence.SequenceGenerator; | |
26 import javax.persistence.Table; | |
27 | |
28 import org.dive4elements.river.model.AnnotationType; | |
29 import org.dive4elements.river.model.River; | |
30 | |
31 /** | |
32 * Hibernate binding for the DB table infrastructure | |
33 * | |
34 * @author Matthias Schäfer | |
35 * | |
36 */ | |
37 | |
38 @Entity | |
39 @Table(name = "infrastructure") | |
40 public class Infrastructure implements Serializable { | |
41 | |
42 /***** FIELDS *****/ | |
43 | |
44 private static final long serialVersionUID = -5505080011501611034L; | |
45 | |
46 private Integer id; | |
47 | |
48 private River river; | |
49 | |
50 private String filename; | |
51 | |
52 private String kmrange_info; | |
53 | |
54 private String comment; | |
55 | |
56 private AnnotationType type; | |
57 | |
58 private Integer year; | |
59 | |
60 private String dataprovider; | |
61 | |
62 private String evaluation_by; | |
63 | |
64 private List<InfrastructureValue> values; | |
65 | |
66 | |
67 /***** CONSTRUCTORS *****/ | |
68 | |
69 public Infrastructure() { | |
70 } | |
71 | |
72 | |
73 public Infrastructure(final River river, final String filename, final String kmrange_info, final String comment, final AnnotationType type, final Integer year, | |
74 final String dataprovider, final String evaluation_by) { | |
75 this.river = river; | |
76 this.filename = filename; | |
77 this.kmrange_info = kmrange_info; | |
78 this.comment = comment; | |
79 this.type = type; | |
80 this.year = year; | |
81 this.dataprovider = dataprovider; | |
82 this.evaluation_by = evaluation_by; | |
83 this.values = new ArrayList<>(); | |
84 } | |
85 | |
86 /***** METHODS *****/ | |
87 | |
88 @Id | |
89 @SequenceGenerator(name = "SEQUENCE_INFRASTRUCTURE_ID_SEQ", sequenceName = "INFRASTRUCTURE_ID_SEQ", allocationSize = 1) | |
90 @GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "SEQUENCE_INFRASTRUCTURE_ID_SEQ") | |
91 @Column(name = "id") | |
92 public Integer getId() { | |
93 return this.id; | |
94 } | |
95 | |
96 public void setId(final Integer id) { | |
97 this.id = id; | |
98 } | |
99 | |
100 @OneToOne | |
101 @JoinColumn(name = "river_id") | |
102 public River getRiver() { | |
103 return this.river; | |
104 } | |
105 | |
106 public void setRiver(final River river) { | |
107 this.river = river; | |
108 } | |
109 | |
110 @Column(name = "filename") | |
111 public String getFilename() { | |
112 return this.filename; | |
113 } | |
114 | |
115 public void setFilename(final String filename) { | |
116 this.filename = filename; | |
117 } | |
118 | |
119 @Column(name = "kmrange_info") | |
120 public String getKmrange_info() { | |
121 return this.kmrange_info; | |
122 } | |
123 | |
124 public void setKmrange_info(final String kmrange_info) { | |
125 this.kmrange_info = kmrange_info; | |
126 } | |
127 | |
128 @Column(name = "comment") | |
129 public String getComment() { | |
130 return this.comment; | |
131 } | |
132 | |
133 public void setComment(final String comment) { | |
134 this.comment = comment; | |
135 } | |
136 | |
137 @OneToOne | |
138 @JoinColumn(name = "annotation_type_id") | |
139 public AnnotationType getType() { | |
140 return this.type; | |
141 } | |
142 | |
143 public void setType(final AnnotationType type) { | |
144 this.type = type; | |
145 } | |
146 | |
147 @Column(name = "year") | |
148 public Integer getYear() { | |
149 return this.year; | |
150 } | |
151 | |
152 public void setYear(final Integer year) { | |
153 this.year = year; | |
154 } | |
155 | |
156 @Column(name = "dataprovider") | |
157 public String getDataprovider() { | |
158 return this.dataprovider; | |
159 } | |
160 | |
161 public void setDataprovider(final String dataprovider) { | |
162 this.dataprovider = dataprovider; | |
163 } | |
164 | |
165 @Column(name = "evaluation_by") | |
166 public String getEvaluation_by() { | |
167 return this.evaluation_by; | |
168 } | |
169 | |
170 public void setEvaluation_by(final String evaluation_by) { | |
171 this.evaluation_by = evaluation_by; | |
172 } | |
173 | |
174 @OneToMany | |
175 @JoinColumn(name = "infrastructure_id") | |
176 public List<InfrastructureValue> getValues() { | |
177 return this.values; | |
178 } | |
179 | |
180 public void setValues(final List<InfrastructureValue> values) { | |
181 this.values = values; | |
182 } | |
183 | |
184 public void addValue(final InfrastructureValue value) { | |
185 this.values.add(value); | |
186 } | |
187 } |