# HG changeset patch # User Torsten Irländer # Date 1372259639 -7200 # Node ID 2550ddb3b910abecbfb2209f84e3ff6c13051297 # Parent a427f8025051733112db73e474222f264a2553bc Removed id element and add kId field. Formatting. diff -r a427f8025051 -r 2550ddb3b910 src/main/java/de/intevation/lada/model/LKommentarP.java --- a/src/main/java/de/intevation/lada/model/LKommentarP.java Wed Jun 26 17:11:43 2013 +0200 +++ b/src/main/java/de/intevation/lada/model/LKommentarP.java Wed Jun 26 17:13:59 2013 +0200 @@ -9,6 +9,9 @@ import javax.persistence.EmbeddedId; import javax.persistence.Entity; import javax.persistence.FetchType; +import javax.persistence.GeneratedValue; +import javax.persistence.GenerationType; +import javax.persistence.Id; import javax.persistence.JoinColumn; import javax.persistence.ManyToOne; import javax.persistence.SequenceGenerator; @@ -23,43 +26,42 @@ @Table(name = "l_kommentar_p", schema = "public") public class LKommentarP implements java.io.Serializable { - private LKommentarPId id; private String probeId; private String erzeuger; private Date KDatum; private String KText; + private Integer kId; - public LKommentarP() { - } + public LKommentarP() { + } - public LKommentarP(LKommentarPId id, String probeId, String erzeuger, - Date KDatum) { - this.id = id; this.probeId = probeId; this.erzeuger = erzeuger; this.KDatum = KDatum; } + public LKommentarP(Integer kId, String probeId, String erzeuger, + Date KDatum) { + this.kId = kId; - public LKommentarP(LKommentarPId id, String probeId, String erzeuger, - Date KDatum, String KText) { - this.id = id; this.probeId = probeId; this.erzeuger = erzeuger; this.KDatum = KDatum; this.KText = KText; } + public LKommentarP(Integer kId, String probeId, String erzeuger, + Date KDatum, String KText) { + this.kId = kId; - @EmbeddedId - @AttributeOverrides({ - @AttributeOverride(name = "probeId", column = @Column(name = "probe_id", nullable = false, length = 20)), - @AttributeOverride(name = "KId", column = @Column(name = "k_id", nullable = false)) }) - public LKommentarPId getId() { - return this.id; - } + @Id + @Column(name = "k_id", nullable = false, insertable = false, updatable = false) + @GeneratedValue(strategy=GenerationType.IDENTITY) + public Integer getkId() { + return this.kId; + } - public void setId(LKommentarPId id) { - this.id = id; - } + public void setkId(Integer kId) { + this.kId = kId; + } @Column(name = "probe_id", nullable = false, insertable = false, updatable = false) public String getProbeId() {