changeset 613:afaee6f0f3ec

Use dynamic update/insert for *_translation tables
author Raimund Renkert <raimund.renkert@intevation.de>
date Thu, 16 Apr 2015 17:04:09 +0200
parents 23ab3247b36e
children d51d0418d027
files src/main/java/de/intevation/lada/model/land/MessungTranslation.java src/main/java/de/intevation/lada/model/land/ProbeTranslation.java
diffstat 2 files changed, 11 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/src/main/java/de/intevation/lada/model/land/MessungTranslation.java	Thu Apr 16 15:50:02 2015 +0200
+++ b/src/main/java/de/intevation/lada/model/land/MessungTranslation.java	Thu Apr 16 17:04:09 2015 +0200
@@ -17,6 +17,9 @@
 import javax.persistence.OneToOne;
 import javax.persistence.Table;
 
+import org.hibernate.annotations.DynamicInsert;
+import org.hibernate.annotations.DynamicUpdate;
+
 import com.fasterxml.jackson.annotation.JsonIgnore;
 
 
@@ -25,6 +28,8 @@
  */
 @Entity
 @Table(name="messung_translation")
+@DynamicInsert
+@DynamicUpdate
 public class MessungTranslation implements Serializable {
     private static final long serialVersionUID = 1L;
 
@@ -36,7 +41,6 @@
     @OneToOne
     private LMessung messungs;
 
-    @GeneratedValue(strategy=GenerationType.IDENTITY)
     @Column(name="messungs_id_alt")
     private Integer messungsIdAlt;
 
--- a/src/main/java/de/intevation/lada/model/land/ProbeTranslation.java	Thu Apr 16 15:50:02 2015 +0200
+++ b/src/main/java/de/intevation/lada/model/land/ProbeTranslation.java	Thu Apr 16 17:04:09 2015 +0200
@@ -17,6 +17,9 @@
 import javax.persistence.OneToOne;
 import javax.persistence.Table;
 
+import org.hibernate.annotations.DynamicInsert;
+import org.hibernate.annotations.DynamicUpdate;
+
 import com.fasterxml.jackson.annotation.JsonIgnore;
 
 
@@ -25,6 +28,8 @@
  */
 @Entity
 @Table(name="probe_translation")
+@DynamicInsert
+@DynamicUpdate
 public class ProbeTranslation implements Serializable {
     private static final long serialVersionUID = 1L;
 
@@ -36,8 +41,7 @@
     @OneToOne
     private LProbe probe;
 
-    @GeneratedValue(strategy=GenerationType.IDENTITY)
-    @Column(name="probe_id_alt")
+    @Column(name="probe_id_alt", insertable= true, updatable=true, nullable=true)
     private String probeIdAlt;
 
     public ProbeTranslation() {
This site is hosted by Intevation GmbH (Datenschutzerklärung und Impressum | Privacy Policy and Imprint)