changeset 3961:f5912365619c

Adapted the spatial schema for DEMs and the DgmSqlConverter. flys-backend/trunk@5632 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author Ingo Weinzierl <ingo.weinzierl@intevation.de>
date Fri, 28 Sep 2012 08:37:08 +0000
parents 9e4468d50329
children d609fd83310a
files flys-backend/ChangeLog flys-backend/doc/schema/oracle-spatial.sql flys-backend/doc/schema/postgresql-spatial.sql flys-backend/src/main/java/de/intevation/flys/utils/DgmSqlConverter.java
diffstat 4 files changed, 21 insertions(+), 8 deletions(-) [+]
line wrap: on
line diff
--- a/flys-backend/ChangeLog	Thu Sep 27 17:45:49 2012 +0000
+++ b/flys-backend/ChangeLog	Fri Sep 28 08:37:08 2012 +0000
@@ -1,3 +1,16 @@
+2012-09-28  Ingo Weinzierl <ingo@intevation.de>
+
+	* doc/schema/postgresql-spatial.sql,
+	  doc/schema/oracle-spatial.sql: Changed the type of date columns to
+	  VARCHAR. This is a quick fix to solve the concatination problem in
+	  Oracle and PostgreSQL. Both aren't able to concatinate null values.
+	  So, null values are not valid for those columns. Users can now decide
+	  to fill these columns with correct values or an empty string.
+
+	* src/main/java/de/intevation/flys/utils/DgmSqlConverter.java: Set
+	  year_from and year_to values to an empty string if no correct value is
+	  specified.
+
 2012-09-27  Felix Wolfsteller <felix.wolfsteller@intevation.de>
 
 	For issue862/1, fix parsing of year field of bed height csvs,
--- a/flys-backend/doc/schema/oracle-spatial.sql	Thu Sep 27 17:45:49 2012 +0000
+++ b/flys-backend/doc/schema/oracle-spatial.sql	Fri Sep 28 08:37:08 2012 +0000
@@ -158,9 +158,9 @@
     name            VARCHAR(64),
     lower           NUMBER(19,5),
     upper           NUMBER(19,5),
-    year_from       NUMBER(38),
-    year_to         NUMBER(38),
-    projection      VARCHAR(32),
+    year_from       VARCHAR(32) NOT NULL,
+    year_to         VARCHAR(32) NOT NULL,
+    projection      VARCHAR(32) NOT NULL,
     elevation_state VARCHAR(32),
     format          VARCHAR(32),
     border_break    BOOLEAN NOT NULL DEFAULT FALSE,
--- a/flys-backend/doc/schema/postgresql-spatial.sql	Thu Sep 27 17:45:49 2012 +0000
+++ b/flys-backend/doc/schema/postgresql-spatial.sql	Fri Sep 28 08:37:08 2012 +0000
@@ -107,9 +107,9 @@
     name            VARCHAR(64),
     lower           NUMERIC,
     upper           NUMERIC,
-    year_from       int,
-    year_to         int,
-    projection      VARCHAR(32),
+    year_from       VARCHAR(32) NOT NULL,
+    year_to         VARCHAR(32) NOT NULL,
+    projection      VARCHAR(32) NOT NULL,
     elevation_state VARCHAR(32),
     format          VARCHAR(32),
     border_break    BOOLEAN NOT NULL DEFAULT FALSE,
--- a/flys-backend/src/main/java/de/intevation/flys/utils/DgmSqlConverter.java	Thu Sep 27 17:45:49 2012 +0000
+++ b/flys-backend/src/main/java/de/intevation/flys/utils/DgmSqlConverter.java	Fri Sep 28 08:37:08 2012 +0000
@@ -110,9 +110,9 @@
             String lower = String.valueOf(this.lower);
             String upper = String.valueOf(this.upper);
             String yearFrom = this.yearFrom != null ? String
-                .valueOf(this.yearFrom) : "null";
+                .valueOf(this.yearFrom) : "";
             String yearTo = this.yearTo != null ? String.valueOf(this.yearTo)
-                : "null";
+                : "";
 
             return String.format(SQL_INSERT, riverId, name, lower, upper,
                 yearFrom, yearTo, projection, elevationState, format,

http://dive4elements.wald.intevation.org