comparison flys-backend/src/main/java/de/intevation/flys/model/Gauge.java @ 2385:83abe19d4f40

Added a method Gauge.fetchMasterDischargeTable() to retrieve the discharge table with kind = 0. flys-backend/trunk@3994 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author Ingo Weinzierl <ingo.weinzierl@intevation.de>
date Thu, 09 Feb 2012 11:30:26 +0000
parents aa777d1aba38
children 8df746f374cc
comparison
equal deleted inserted replaced
2384:385170ff7b34 2385:83abe19d4f40
27 @Table(name = "gauges") 27 @Table(name = "gauges")
28 public class Gauge 28 public class Gauge
29 implements Serializable 29 implements Serializable
30 { 30 {
31 public static final int DEFAULT_SCALE = 100; 31 public static final int DEFAULT_SCALE = 100;
32
33 public static final int MASTER_DISCHARGE_TABLE = 0;
34
32 35
33 private Integer id; 36 private Integer id;
34 private String name; 37 private String name;
35 private River river; 38 private River river;
36 private BigDecimal station; 39 private BigDecimal station;
226 229
227 List<Gauge> results = query.list(); 230 List<Gauge> results = query.list();
228 231
229 return results.isEmpty() ? null : results.get(0); 232 return results.isEmpty() ? null : results.get(0);
230 } 233 }
234
235
236 public DischargeTable fetchMasterDischargeTable() {
237 for (DischargeTable dt: dischargeTables) {
238 if (dt.getKind() == MASTER_DISCHARGE_TABLE) {
239 return dt;
240 }
241 }
242
243 return null;
244 }
231 } 245 }
232 // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 : 246 // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 :

http://dive4elements.wald.intevation.org