changeset 2802:3fdac7b43dac

Registered missing Floodmaps and set its Geometry type to Geometry. flys-backend/trunk@4159 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author Ingo Weinzierl <ingo.weinzierl@intevation.de>
date Mon, 19 Mar 2012 06:09:31 +0000
parents 970dc0ad9dc6
children cdc084071c14
files flys-backend/ChangeLog flys-backend/src/main/java/de/intevation/flys/backend/SessionFactoryProvider.java flys-backend/src/main/java/de/intevation/flys/model/Floodmaps.java
diffstat 3 files changed, 15 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/flys-backend/ChangeLog	Fri Mar 16 07:25:59 2012 +0000
+++ b/flys-backend/ChangeLog	Mon Mar 19 06:09:31 2012 +0000
@@ -1,3 +1,12 @@
+2012-03-16  Ingo Weinzierl <ingo@intevation.de>
+
+	* src/main/java/de/intevation/flys/model/Floodmaps.java: Set geometry type
+	  to 'Geometry', because Oracle can save POLYGONS and MULTIPOLYGONS in the
+	  same relation; Hibernate seems unable to load both types.
+
+	* src/main/java/de/intevation/flys/backend/SessionFactoryProvider.java:
+	  Registered missing Floodmaps.
+
 2012-03-16  Ingo Weinzierl <ingo@intevation.de>
 
 	* Tagged module as 'pre2.7-2012-03-16'.
--- a/flys-backend/src/main/java/de/intevation/flys/backend/SessionFactoryProvider.java	Fri Mar 16 07:25:59 2012 +0000
+++ b/flys-backend/src/main/java/de/intevation/flys/backend/SessionFactoryProvider.java	Mon Mar 19 06:09:31 2012 +0000
@@ -225,6 +225,7 @@
         cfg.addAnnotatedClass(Edge.class);
         cfg.addAnnotatedClass(Fixpoint.class);
         cfg.addAnnotatedClass(Floodplain.class);
+        cfg.addAnnotatedClass(Floodmaps.class);
         cfg.addAnnotatedClass(Gauge.class);
         cfg.addAnnotatedClass(Hws.class);
         cfg.addAnnotatedClass(HYK.class);
--- a/flys-backend/src/main/java/de/intevation/flys/model/Floodmaps.java	Fri Mar 16 07:25:59 2012 +0000
+++ b/flys-backend/src/main/java/de/intevation/flys/model/Floodmaps.java	Mon Mar 19 06:09:31 2012 +0000
@@ -15,6 +15,7 @@
 import org.hibernate.Query;
 import org.hibernate.annotations.Type;
 
+import com.vividsolutions.jts.geom.Geometry;
 import com.vividsolutions.jts.geom.MultiPolygon;
 
 import de.intevation.flys.backend.SessionHolder;
@@ -33,7 +34,7 @@
     private BigDecimal   diff;
     private BigDecimal   area;
     private BigDecimal   perimeter;
-    private MultiPolygon geom;
+    private Geometry     geom;
 
     public Floodmaps() {
     }
@@ -63,7 +64,7 @@
     }
 
 
-    @JoinColumn(name = "name")
+    @Column(name = "name")
     public String getName() {
         return name;
     }
@@ -131,12 +132,12 @@
 
     @Column(name = "geom")
     @Type(type = "org.hibernatespatial.GeometryUserType")
-    public MultiPolygon getGeom() {
+    public Geometry getGeom() {
         return geom;
     }
 
 
-    public void setGeom(MultiPolygon geom) {
+    public void setGeom(Geometry geom) {
         this.geom = geom;
     }
 

http://dive4elements.wald.intevation.org