[Lada-commits] [PATCH 3 of 8] Use the new usertype in messprogramm_messmethode
Wald Commits
scm-commit at wald.intevation.org
Tue May 12 15:20:05 CEST 2015
# HG changeset patch
# User Raimund Renkert <raimund.renkert at intevation.de>
# Date 1431436600 -7200
# Node ID 309870b4142c11db66d76fe746ab91458daa566a
# Parent 54992c5f9898e18249df6ac6728391cde182952c
Use the new usertype in messprogramm_messmethode.
diff -r 54992c5f9898 -r 309870b4142c src/main/java/de/intevation/lada/model/land/MessprogrammMmt.java
--- a/src/main/java/de/intevation/lada/model/land/MessprogrammMmt.java Tue May 12 15:16:05 2015 +0200
+++ b/src/main/java/de/intevation/lada/model/land/MessprogrammMmt.java Tue May 12 15:16:40 2015 +0200
@@ -5,10 +5,16 @@
import javax.persistence.Column;
import javax.persistence.Entity;
+import javax.persistence.GeneratedValue;
+import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.Table;
-import org.hibernate.mapping.Array;
+import org.hibernate.annotations.Type;
+import org.hibernate.annotations.TypeDef;
+import org.hibernate.annotations.TypeDefs;
+
+import de.intevation.lada.util.data.IntegerArrayType;
/**
@@ -16,16 +22,20 @@
*/
@Entity
@Table(name="messprogramm_mmt")
+ at TypeDefs({@TypeDef(name="IntegerArray", typeClass=IntegerArrayType.class)})
public class MessprogrammMmt implements Serializable {
private static final long serialVersionUID = 1L;
@Id
+ @GeneratedValue(strategy=GenerationType.IDENTITY)
+ @Column(name="id", unique=true, nullable=false)
private Integer id;
@Column(name="letzte_aenderung")
private Timestamp letzteAenderung;
- private Array messgroessen;
+ @Type(type="IntegerArray")
+ private Integer[] messgroessen;
@Column(name="mmt_id")
private String mmtId;
@@ -52,11 +62,11 @@
this.letzteAenderung = letzteAenderung;
}
- public Array getMessgroessen() {
+ public Integer[] getMessgroessen() {
return this.messgroessen;
}
- public void setMessgroessen(Array messgroessen) {
+ public void setMessgroessen(Integer[] messgroessen) {
this.messgroessen = messgroessen;
}
More information about the Lada-commits
mailing list