diff 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
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/main/java/de/intevation/model/LKommentarPPK.java	Fri Apr 26 19:52:21 2013 +0200
@@ -0,0 +1,57 @@
+package de.intevation.model;
+
+import java.io.Serializable;
+import javax.persistence.*;
+
+/**
+ * The primary key class for the l_kommentar_p database table.
+ * 
+ */
+@Embeddable
+public class LKommentarPPK implements Serializable {
+	//default serial version id, required for serializable classes.
+	private static final long serialVersionUID = 1L;
+	private String probeId;
+	private Integer kId;
+
+	public LKommentarPPK() {
+	}
+
+	@Column(name="probe_id")
+	public String getProbeId() {
+		return this.probeId;
+	}
+	public void setProbeId(String probeId) {
+		this.probeId = probeId;
+	}
+
+	@Column(name="k_id")
+	public Integer getKId() {
+		return this.kId;
+	}
+	public void setKId(Integer kId) {
+		this.kId = kId;
+	}
+
+	public boolean equals(Object other) {
+		if (this == other) {
+			return true;
+		}
+		if (!(other instanceof LKommentarPPK)) {
+			return false;
+		}
+		LKommentarPPK castOther = (LKommentarPPK)other;
+		return 
+			this.probeId.equals(castOther.probeId)
+			&& this.kId.equals(castOther.kId);
+	}
+
+	public int hashCode() {
+		final int prime = 31;
+		int hash = 17;
+		hash = hash * prime + this.probeId.hashCode();
+		hash = hash * prime + this.kId.hashCode();
+		
+		return hash;
+	}
+}
\ No newline at end of file
This site is hosted by Intevation GmbH (Datenschutzerklärung und Impressum | Privacy Policy and Imprint)