Mercurial > dive4elements > river
comparison flys-artifacts/src/main/java/de/intevation/flys/artifacts/model/StaticSedimentLoadCacheKey.java @ 4370:6a65e7ef43c0
Updated data object and factory for sediment load.
* Added new data fields to object and cache key.
* Fixed SQL statement in factory and fill load objects correctly.
*
author | Raimund Renkert <rrenkert@intevation.de> |
---|---|
date | Fri, 02 Nov 2012 14:48:16 +0100 |
parents | 3051bc28ac43 |
children | 3937c6a85db4 |
comparison
equal
deleted
inserted
replaced
4369:8ddab49ff297 | 4370:6a65e7ef43c0 |
---|---|
10 public static final String CACHE_NAME = "sedimentload-value-table-static"; | 10 public static final String CACHE_NAME = "sedimentload-value-table-static"; |
11 | 11 |
12 private String river; | 12 private String river; |
13 private double startKm; | 13 private double startKm; |
14 private double endKm; | 14 private double endKm; |
15 private Date date; | 15 private int sYear; |
16 private int eYear; | |
16 | 17 |
17 public StaticSedimentLoadCacheKey( | 18 public StaticSedimentLoadCacheKey( |
18 String river, | 19 String river, |
19 double startKm, | 20 double startKm, |
20 double endKm, | 21 double endKm, |
21 Date date | 22 int sYear, |
23 int eYear | |
22 ) { | 24 ) { |
23 this.river = river; | 25 this.river = river; |
24 this.startKm = startKm; | 26 this.startKm = startKm; |
25 this.endKm = endKm; | 27 this.endKm = endKm; |
26 this.date = date; | 28 this.sYear = sYear; |
29 this.eYear = eYear; | |
27 } | 30 } |
28 | 31 |
29 public int hashCode() { | 32 public int hashCode() { |
30 HashCodeBuilder builder = new HashCodeBuilder(); | 33 HashCodeBuilder builder = new HashCodeBuilder(); |
31 builder.append(river); | 34 builder.append(river); |
32 builder.append(startKm); | 35 builder.append(startKm); |
33 builder.append(endKm); | 36 builder.append(endKm); |
34 builder.append(date); | 37 builder.append(sYear); |
38 builder.append(eYear); | |
35 return builder.toHashCode(); | 39 return builder.toHashCode(); |
36 } | 40 } |
37 | 41 |
38 public boolean equals(Object other) { | 42 public boolean equals(Object other) { |
39 if (!(other instanceof StaticBedHeightCacheKey)) { | 43 if (!(other instanceof StaticBedHeightCacheKey)) { |
41 } | 45 } |
42 StaticSedimentLoadCacheKey o = (StaticSedimentLoadCacheKey) other; | 46 StaticSedimentLoadCacheKey o = (StaticSedimentLoadCacheKey) other; |
43 return this.river == o.river && | 47 return this.river == o.river && |
44 this.startKm == o.startKm && | 48 this.startKm == o.startKm && |
45 this.endKm == o.endKm && | 49 this.endKm == o.endKm && |
46 this.date == o.date; | 50 this.sYear == o.sYear && |
51 this.eYear == o.eYear; | |
47 } | 52 } |
48 } | 53 } |