changeset 5098:a2600507761e dami

Add sequences to the new tables that use sequences
author Andre Heinecke <aheinecke@intevation.de>
date Mon, 25 Feb 2013 16:00:52 +0100
parents 415ac9bc5a56
children f57b096df75a
files flys-backend/src/main/java/de/intevation/flys/model/DGM.java flys-backend/src/main/java/de/intevation/flys/model/HWSLine.java flys-backend/src/main/java/de/intevation/flys/model/HWSPoint.java flys-backend/src/main/java/de/intevation/flys/model/HydrBoundary.java flys-backend/src/main/java/de/intevation/flys/model/HydrBoundaryPoly.java
diffstat 5 files changed, 50 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/flys-backend/src/main/java/de/intevation/flys/model/DGM.java	Mon Feb 25 15:40:15 2013 +0100
+++ b/flys-backend/src/main/java/de/intevation/flys/model/DGM.java	Mon Feb 25 16:00:52 2013 +0100
@@ -6,10 +6,13 @@
 
 import javax.persistence.Column;
 import javax.persistence.Entity;
+import javax.persistence.GeneratedValue;
+import javax.persistence.GenerationType;
 import javax.persistence.Id;
 import javax.persistence.JoinColumn;
 import javax.persistence.OneToOne;
 import javax.persistence.Table;
+import javax.persistence.SequenceGenerator;
 
 import org.hibernate.Session;
 import org.hibernate.Query;
@@ -41,6 +44,13 @@
     }
 
     @Id
+    @SequenceGenerator(
+        name           = "SEQUENCE_DEM_ID_SEQ",
+        sequenceName   = "DEM_ID_SEQ",
+        allocationSize = 1)
+    @GeneratedValue(
+        strategy  = GenerationType.SEQUENCE,
+        generator = "SEQUENCE_DEM_ID_SEQ")
     @Column(name = "id")
     public Integer getId() {
         return id;
--- a/flys-backend/src/main/java/de/intevation/flys/model/HWSLine.java	Mon Feb 25 15:40:15 2013 +0100
+++ b/flys-backend/src/main/java/de/intevation/flys/model/HWSLine.java	Mon Feb 25 16:00:52 2013 +0100
@@ -9,10 +9,13 @@
 
 import javax.persistence.Column;
 import javax.persistence.Entity;
+import javax.persistence.GeneratedValue;
+import javax.persistence.GenerationType;
 import javax.persistence.Id;
 import javax.persistence.JoinColumn;
 import javax.persistence.OneToOne;
 import javax.persistence.Table;
+import javax.persistence.SequenceGenerator;
 
 import org.hibernate.Session;
 import org.hibernate.Query;
@@ -42,6 +45,13 @@
     private Geometry geom;
 
     @Id
+    @SequenceGenerator(
+        name           = "SEQUENCE_HWS_LINES_ID_SEQ",
+        sequenceName   = "HWS_LINES_ID_SEQ",
+        allocationSize = 1)
+    @GeneratedValue(
+        strategy  = GenerationType.SEQUENCE,
+        generator = "SEQUENCE_HWS_LINES_ID_SEQ")
     @Column(name = "id")
     public Integer getId() {
         return id;
--- a/flys-backend/src/main/java/de/intevation/flys/model/HWSPoint.java	Mon Feb 25 15:40:15 2013 +0100
+++ b/flys-backend/src/main/java/de/intevation/flys/model/HWSPoint.java	Mon Feb 25 16:00:52 2013 +0100
@@ -8,10 +8,13 @@
 
 import javax.persistence.Column;
 import javax.persistence.Entity;
+import javax.persistence.GeneratedValue;
+import javax.persistence.GenerationType;
 import javax.persistence.Id;
 import javax.persistence.JoinColumn;
 import javax.persistence.OneToOne;
 import javax.persistence.Table;
+import javax.persistence.SequenceGenerator;
 
 import org.hibernate.annotations.Type;
 
@@ -42,6 +45,13 @@
     private Geometry   geom;
 
     @Id
+    @SequenceGenerator(
+        name           = "SEQUENCE_HWS_POINTS_ID_SEQ",
+        sequenceName   = "HWS_POINTS_ID_SEQ",
+        allocationSize = 1)
+    @GeneratedValue(
+        strategy  = GenerationType.SEQUENCE,
+        generator = "SEQUENCE_HWS_POINTS_ID_SEQ")
     @Column(name = "id")
     public Integer getId() {
         return id;
--- a/flys-backend/src/main/java/de/intevation/flys/model/HydrBoundary.java	Mon Feb 25 15:40:15 2013 +0100
+++ b/flys-backend/src/main/java/de/intevation/flys/model/HydrBoundary.java	Mon Feb 25 16:00:52 2013 +0100
@@ -5,10 +5,13 @@
 
 import javax.persistence.Column;
 import javax.persistence.Entity;
+import javax.persistence.GeneratedValue;
+import javax.persistence.GenerationType;
 import javax.persistence.Id;
 import javax.persistence.JoinColumn;
 import javax.persistence.OneToOne;
 import javax.persistence.Table;
+import javax.persistence.SequenceGenerator;
 
 import org.hibernate.Session;
 import org.hibernate.Query;
@@ -37,6 +40,13 @@
 
 
     @Id
+    @SequenceGenerator(
+        name           = "SEQUENCE_HYDR_BOUNDARIES_ID_SEQ",
+        sequenceName   = "HYDR_BOUNDARIES_ID_SEQ",
+        allocationSize = 1)
+    @GeneratedValue(
+        strategy  = GenerationType.SEQUENCE,
+        generator = "SEQUENCE_HYDR_BOUNDARIES_ID_SEQ")
     @Column(name = "id")
     public Integer getId() {
         return id;
--- a/flys-backend/src/main/java/de/intevation/flys/model/HydrBoundaryPoly.java	Mon Feb 25 15:40:15 2013 +0100
+++ b/flys-backend/src/main/java/de/intevation/flys/model/HydrBoundaryPoly.java	Mon Feb 25 16:00:52 2013 +0100
@@ -5,10 +5,13 @@
 
 import javax.persistence.Column;
 import javax.persistence.Entity;
+import javax.persistence.GeneratedValue;
+import javax.persistence.GenerationType;
 import javax.persistence.Id;
 import javax.persistence.JoinColumn;
 import javax.persistence.OneToOne;
 import javax.persistence.Table;
+import javax.persistence.SequenceGenerator;
 
 import org.hibernate.Session;
 import org.hibernate.Query;
@@ -37,6 +40,13 @@
 
 
     @Id
+    @SequenceGenerator(
+        name           = "SEQUENCE_HYDR_BOUNDARIES_POLY_ID_SEQ",
+        sequenceName   = "HYDR_BOUNDARIES_POLY_ID_SEQ",
+        allocationSize = 1)
+    @GeneratedValue(
+        strategy  = GenerationType.SEQUENCE,
+        generator = "SEQUENCE_HYDR_BOUNDARIES_POLY_ID_SEQ")
     @Column(name = "id")
     public Integer getId() {
         return id;

http://dive4elements.wald.intevation.org