annotate artifacts/src/main/java/org/dive4elements/river/artifacts/model/sq/StaticSQCacheKey.java @ 7698:7efeaa2058e1

SQ Relation: Added CSV dumping to raw SedDB query results. If system property 'minfo.dump.sq.seddb.prefix' is set files are generate from this to contain the results of the raw SQL queries.
author Sascha L. Teichmann <teichmann@intevation.de>
date Mon, 16 Dec 2013 16:39:12 +0100
parents af13ceeba52a
children
rev   line source
5863
4897a58c8746 River artifacts: Added new copyright headers.
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5838
diff changeset
1 /* Copyright (C) 2011, 2012, 2013 by Bundesanstalt für Gewässerkunde
4897a58c8746 River artifacts: Added new copyright headers.
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5838
diff changeset
2 * Software engineering by Intevation GmbH
4897a58c8746 River artifacts: Added new copyright headers.
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5838
diff changeset
3 *
5994
af13ceeba52a Removed trailing whitespace.
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5863
diff changeset
4 * This file is Free Software under the GNU AGPL (>=v3)
5863
4897a58c8746 River artifacts: Added new copyright headers.
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5838
diff changeset
5 * and comes with ABSOLUTELY NO WARRANTY! Check out the
5994
af13ceeba52a Removed trailing whitespace.
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5863
diff changeset
6 * documentation coming with Dive4Elements River for details.
5863
4897a58c8746 River artifacts: Added new copyright headers.
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5838
diff changeset
7 */
4897a58c8746 River artifacts: Added new copyright headers.
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5838
diff changeset
8
5831
bd047b71ab37 Repaired internal references
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5500
diff changeset
9 package org.dive4elements.river.artifacts.model.sq;
5500
700ac898ab0b Added Factory and model for static sq relations.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
10
700ac898ab0b Added Factory and model for static sq relations.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
11 import java.io.Serializable;
700ac898ab0b Added Factory and model for static sq relations.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
12
700ac898ab0b Added Factory and model for static sq relations.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
13
700ac898ab0b Added Factory and model for static sq relations.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
14 public class StaticSQCacheKey
700ac898ab0b Added Factory and model for static sq relations.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
15 implements Serializable
700ac898ab0b Added Factory and model for static sq relations.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
16 {
700ac898ab0b Added Factory and model for static sq relations.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
17 public static final String CACHE_NAME = "static-sq-relation";
700ac898ab0b Added Factory and model for static sq relations.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
18
700ac898ab0b Added Factory and model for static sq relations.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
19 private String river;
700ac898ab0b Added Factory and model for static sq relations.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
20 private int measurementId;
700ac898ab0b Added Factory and model for static sq relations.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
21
700ac898ab0b Added Factory and model for static sq relations.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
22 public StaticSQCacheKey(String river, int measurementId) {
700ac898ab0b Added Factory and model for static sq relations.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
23 this.river = river;
700ac898ab0b Added Factory and model for static sq relations.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
24 this.measurementId = measurementId;
700ac898ab0b Added Factory and model for static sq relations.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
25 }
700ac898ab0b Added Factory and model for static sq relations.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
26
700ac898ab0b Added Factory and model for static sq relations.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
27 public int hashCode() {
700ac898ab0b Added Factory and model for static sq relations.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
28 return this.river.hashCode() | measurementId;
700ac898ab0b Added Factory and model for static sq relations.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
29 }
700ac898ab0b Added Factory and model for static sq relations.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
30
700ac898ab0b Added Factory and model for static sq relations.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
31 public boolean equals(Object other) {
700ac898ab0b Added Factory and model for static sq relations.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
32 if (!(other instanceof StaticSQCacheKey)) {
700ac898ab0b Added Factory and model for static sq relations.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
33 return false;
700ac898ab0b Added Factory and model for static sq relations.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
34 }
700ac898ab0b Added Factory and model for static sq relations.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
35 StaticSQCacheKey o = (StaticSQCacheKey) other;
700ac898ab0b Added Factory and model for static sq relations.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
36 return this.river == o.river && this.measurementId == o.measurementId;
700ac898ab0b Added Factory and model for static sq relations.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
37 }
700ac898ab0b Added Factory and model for static sq relations.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
38 }

http://dive4elements.wald.intevation.org