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