Mercurial > lada > lada-server
annotate src/main/java/de/intevation/model/LKommentarPPK.java @ 27:3fced8e2a030
Removed relations
author | Torsten Irländer <torsten.irlaender@intevation.de> |
---|---|
date | Wed, 08 May 2013 13:46:48 +0200 |
parents | 34d7ecfba8d1 |
children |
rev | line source |
---|---|
25
34d7ecfba8d1
Added Relation to Kommentare by using the atomatic generation from database
Torsten Irländer <torsten.irlaender@intevation.de>
parents:
diff
changeset
|
1 package de.intevation.model; |
34d7ecfba8d1
Added Relation to Kommentare by using the atomatic generation from database
Torsten Irländer <torsten.irlaender@intevation.de>
parents:
diff
changeset
|
2 |
34d7ecfba8d1
Added Relation to Kommentare by using the atomatic generation from database
Torsten Irländer <torsten.irlaender@intevation.de>
parents:
diff
changeset
|
3 import java.io.Serializable; |
34d7ecfba8d1
Added Relation to Kommentare by using the atomatic generation from database
Torsten Irländer <torsten.irlaender@intevation.de>
parents:
diff
changeset
|
4 import javax.persistence.*; |
34d7ecfba8d1
Added Relation to Kommentare by using the atomatic generation from database
Torsten Irländer <torsten.irlaender@intevation.de>
parents:
diff
changeset
|
5 |
34d7ecfba8d1
Added Relation to Kommentare by using the atomatic generation from database
Torsten Irländer <torsten.irlaender@intevation.de>
parents:
diff
changeset
|
6 /** |
34d7ecfba8d1
Added Relation to Kommentare by using the atomatic generation from database
Torsten Irländer <torsten.irlaender@intevation.de>
parents:
diff
changeset
|
7 * The primary key class for the l_kommentar_p database table. |
34d7ecfba8d1
Added Relation to Kommentare by using the atomatic generation from database
Torsten Irländer <torsten.irlaender@intevation.de>
parents:
diff
changeset
|
8 * |
34d7ecfba8d1
Added Relation to Kommentare by using the atomatic generation from database
Torsten Irländer <torsten.irlaender@intevation.de>
parents:
diff
changeset
|
9 */ |
34d7ecfba8d1
Added Relation to Kommentare by using the atomatic generation from database
Torsten Irländer <torsten.irlaender@intevation.de>
parents:
diff
changeset
|
10 @Embeddable |
34d7ecfba8d1
Added Relation to Kommentare by using the atomatic generation from database
Torsten Irländer <torsten.irlaender@intevation.de>
parents:
diff
changeset
|
11 public class LKommentarPPK implements Serializable { |
34d7ecfba8d1
Added Relation to Kommentare by using the atomatic generation from database
Torsten Irländer <torsten.irlaender@intevation.de>
parents:
diff
changeset
|
12 //default serial version id, required for serializable classes. |
34d7ecfba8d1
Added Relation to Kommentare by using the atomatic generation from database
Torsten Irländer <torsten.irlaender@intevation.de>
parents:
diff
changeset
|
13 private static final long serialVersionUID = 1L; |
34d7ecfba8d1
Added Relation to Kommentare by using the atomatic generation from database
Torsten Irländer <torsten.irlaender@intevation.de>
parents:
diff
changeset
|
14 private String probeId; |
34d7ecfba8d1
Added Relation to Kommentare by using the atomatic generation from database
Torsten Irländer <torsten.irlaender@intevation.de>
parents:
diff
changeset
|
15 private Integer kId; |
34d7ecfba8d1
Added Relation to Kommentare by using the atomatic generation from database
Torsten Irländer <torsten.irlaender@intevation.de>
parents:
diff
changeset
|
16 |
34d7ecfba8d1
Added Relation to Kommentare by using the atomatic generation from database
Torsten Irländer <torsten.irlaender@intevation.de>
parents:
diff
changeset
|
17 public LKommentarPPK() { |
34d7ecfba8d1
Added Relation to Kommentare by using the atomatic generation from database
Torsten Irländer <torsten.irlaender@intevation.de>
parents:
diff
changeset
|
18 } |
34d7ecfba8d1
Added Relation to Kommentare by using the atomatic generation from database
Torsten Irländer <torsten.irlaender@intevation.de>
parents:
diff
changeset
|
19 |
34d7ecfba8d1
Added Relation to Kommentare by using the atomatic generation from database
Torsten Irländer <torsten.irlaender@intevation.de>
parents:
diff
changeset
|
20 @Column(name="probe_id") |
34d7ecfba8d1
Added Relation to Kommentare by using the atomatic generation from database
Torsten Irländer <torsten.irlaender@intevation.de>
parents:
diff
changeset
|
21 public String getProbeId() { |
34d7ecfba8d1
Added Relation to Kommentare by using the atomatic generation from database
Torsten Irländer <torsten.irlaender@intevation.de>
parents:
diff
changeset
|
22 return this.probeId; |
34d7ecfba8d1
Added Relation to Kommentare by using the atomatic generation from database
Torsten Irländer <torsten.irlaender@intevation.de>
parents:
diff
changeset
|
23 } |
34d7ecfba8d1
Added Relation to Kommentare by using the atomatic generation from database
Torsten Irländer <torsten.irlaender@intevation.de>
parents:
diff
changeset
|
24 public void setProbeId(String probeId) { |
34d7ecfba8d1
Added Relation to Kommentare by using the atomatic generation from database
Torsten Irländer <torsten.irlaender@intevation.de>
parents:
diff
changeset
|
25 this.probeId = probeId; |
34d7ecfba8d1
Added Relation to Kommentare by using the atomatic generation from database
Torsten Irländer <torsten.irlaender@intevation.de>
parents:
diff
changeset
|
26 } |
34d7ecfba8d1
Added Relation to Kommentare by using the atomatic generation from database
Torsten Irländer <torsten.irlaender@intevation.de>
parents:
diff
changeset
|
27 |
34d7ecfba8d1
Added Relation to Kommentare by using the atomatic generation from database
Torsten Irländer <torsten.irlaender@intevation.de>
parents:
diff
changeset
|
28 @Column(name="k_id") |
34d7ecfba8d1
Added Relation to Kommentare by using the atomatic generation from database
Torsten Irländer <torsten.irlaender@intevation.de>
parents:
diff
changeset
|
29 public Integer getKId() { |
34d7ecfba8d1
Added Relation to Kommentare by using the atomatic generation from database
Torsten Irländer <torsten.irlaender@intevation.de>
parents:
diff
changeset
|
30 return this.kId; |
34d7ecfba8d1
Added Relation to Kommentare by using the atomatic generation from database
Torsten Irländer <torsten.irlaender@intevation.de>
parents:
diff
changeset
|
31 } |
34d7ecfba8d1
Added Relation to Kommentare by using the atomatic generation from database
Torsten Irländer <torsten.irlaender@intevation.de>
parents:
diff
changeset
|
32 public void setKId(Integer kId) { |
34d7ecfba8d1
Added Relation to Kommentare by using the atomatic generation from database
Torsten Irländer <torsten.irlaender@intevation.de>
parents:
diff
changeset
|
33 this.kId = kId; |
34d7ecfba8d1
Added Relation to Kommentare by using the atomatic generation from database
Torsten Irländer <torsten.irlaender@intevation.de>
parents:
diff
changeset
|
34 } |
34d7ecfba8d1
Added Relation to Kommentare by using the atomatic generation from database
Torsten Irländer <torsten.irlaender@intevation.de>
parents:
diff
changeset
|
35 |
34d7ecfba8d1
Added Relation to Kommentare by using the atomatic generation from database
Torsten Irländer <torsten.irlaender@intevation.de>
parents:
diff
changeset
|
36 public boolean equals(Object other) { |
34d7ecfba8d1
Added Relation to Kommentare by using the atomatic generation from database
Torsten Irländer <torsten.irlaender@intevation.de>
parents:
diff
changeset
|
37 if (this == other) { |
34d7ecfba8d1
Added Relation to Kommentare by using the atomatic generation from database
Torsten Irländer <torsten.irlaender@intevation.de>
parents:
diff
changeset
|
38 return true; |
34d7ecfba8d1
Added Relation to Kommentare by using the atomatic generation from database
Torsten Irländer <torsten.irlaender@intevation.de>
parents:
diff
changeset
|
39 } |
34d7ecfba8d1
Added Relation to Kommentare by using the atomatic generation from database
Torsten Irländer <torsten.irlaender@intevation.de>
parents:
diff
changeset
|
40 if (!(other instanceof LKommentarPPK)) { |
34d7ecfba8d1
Added Relation to Kommentare by using the atomatic generation from database
Torsten Irländer <torsten.irlaender@intevation.de>
parents:
diff
changeset
|
41 return false; |
34d7ecfba8d1
Added Relation to Kommentare by using the atomatic generation from database
Torsten Irländer <torsten.irlaender@intevation.de>
parents:
diff
changeset
|
42 } |
34d7ecfba8d1
Added Relation to Kommentare by using the atomatic generation from database
Torsten Irländer <torsten.irlaender@intevation.de>
parents:
diff
changeset
|
43 LKommentarPPK castOther = (LKommentarPPK)other; |
34d7ecfba8d1
Added Relation to Kommentare by using the atomatic generation from database
Torsten Irländer <torsten.irlaender@intevation.de>
parents:
diff
changeset
|
44 return |
34d7ecfba8d1
Added Relation to Kommentare by using the atomatic generation from database
Torsten Irländer <torsten.irlaender@intevation.de>
parents:
diff
changeset
|
45 this.probeId.equals(castOther.probeId) |
34d7ecfba8d1
Added Relation to Kommentare by using the atomatic generation from database
Torsten Irländer <torsten.irlaender@intevation.de>
parents:
diff
changeset
|
46 && this.kId.equals(castOther.kId); |
34d7ecfba8d1
Added Relation to Kommentare by using the atomatic generation from database
Torsten Irländer <torsten.irlaender@intevation.de>
parents:
diff
changeset
|
47 } |
34d7ecfba8d1
Added Relation to Kommentare by using the atomatic generation from database
Torsten Irländer <torsten.irlaender@intevation.de>
parents:
diff
changeset
|
48 |
34d7ecfba8d1
Added Relation to Kommentare by using the atomatic generation from database
Torsten Irländer <torsten.irlaender@intevation.de>
parents:
diff
changeset
|
49 public int hashCode() { |
34d7ecfba8d1
Added Relation to Kommentare by using the atomatic generation from database
Torsten Irländer <torsten.irlaender@intevation.de>
parents:
diff
changeset
|
50 final int prime = 31; |
34d7ecfba8d1
Added Relation to Kommentare by using the atomatic generation from database
Torsten Irländer <torsten.irlaender@intevation.de>
parents:
diff
changeset
|
51 int hash = 17; |
34d7ecfba8d1
Added Relation to Kommentare by using the atomatic generation from database
Torsten Irländer <torsten.irlaender@intevation.de>
parents:
diff
changeset
|
52 hash = hash * prime + this.probeId.hashCode(); |
34d7ecfba8d1
Added Relation to Kommentare by using the atomatic generation from database
Torsten Irländer <torsten.irlaender@intevation.de>
parents:
diff
changeset
|
53 hash = hash * prime + this.kId.hashCode(); |
34d7ecfba8d1
Added Relation to Kommentare by using the atomatic generation from database
Torsten Irländer <torsten.irlaender@intevation.de>
parents:
diff
changeset
|
54 |
34d7ecfba8d1
Added Relation to Kommentare by using the atomatic generation from database
Torsten Irländer <torsten.irlaender@intevation.de>
parents:
diff
changeset
|
55 return hash; |
34d7ecfba8d1
Added Relation to Kommentare by using the atomatic generation from database
Torsten Irländer <torsten.irlaender@intevation.de>
parents:
diff
changeset
|
56 } |
34d7ecfba8d1
Added Relation to Kommentare by using the atomatic generation from database
Torsten Irländer <torsten.irlaender@intevation.de>
parents:
diff
changeset
|
57 } |