changeset 137:06720583ead7

Added embeddable id class for LProbeInfo.
author Raimund Renkert <rrenkert@intevation.de>
date Thu, 13 Jun 2013 18:26:36 +0200
parents 168db8339867
children b1846985da6c
files src/main/java/de/intevation/lada/model/LProbeInfoId.java
diffstat 1 files changed, 66 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/main/java/de/intevation/lada/model/LProbeInfoId.java	Thu Jun 13 18:26:36 2013 +0200
@@ -0,0 +1,66 @@
+package de.intevation.lada.model;
+import java.io.Serializable;
+
+import javax.persistence.Column;
+import javax.persistence.Embeddable;
+
+
+@Embeddable
+public class LProbeInfoId
+implements Serializable
+{
+    @Column(name = "probe_id", nullable = false)
+    private String probeId;
+    @Column(name = "nebenproben_nr", nullable = false)
+    private String nebenprobenNr;
+
+    public LProbeInfoId() {
+    }
+
+    public LProbeInfoId(String probeId, String nebenprobenNr) {
+        this.probeId = probeId;
+        this.nebenprobenNr = nebenprobenNr;
+    }
+
+    public String getProbeId() {
+        return this.probeId;
+    }
+
+    public void setProbeId(String probeId) {
+        this.probeId = probeId;
+    }
+
+    public String getNebenprobenNr() {
+        return this.nebenprobenNr;
+    }
+
+    public void setNebenprobenNr(String nebenprobenNr) {
+        this.nebenprobenNr = nebenprobenNr;
+    }
+
+    @Override
+    public boolean equals(Object other) {
+        if ((this == other))
+            return true;
+        if ((other == null))
+            return false;
+        if (!(other instanceof LProbeInfoId))
+            return false;
+        LProbeInfoId castOther = (LProbeInfoId) other;
+
+        return ((this.getProbeId() == castOther.getProbeId()) || (this
+                .getProbeId() != null && castOther.getProbeId() != null && this
+                .getProbeId().equals(castOther.getProbeId())))
+                && (this.getNebenprobenNr() == castOther.getNebenprobenNr());
+    }
+
+    @Override
+    public int hashCode() {
+        int result = 17;
+
+        result = 37 * result
+            + (getProbeId() == null ? 0 : this.getProbeId().hashCode());
+        result = 37 * result + this.getNebenprobenNr().hashCode();
+        return result;
+    }
+}
This site is hosted by Intevation GmbH (Datenschutzerklärung und Impressum | Privacy Policy and Imprint)