[Dive4elements-commits] [PATCH] Fixed datacage to be oracle compatible
Wald Commits
scm-commit at wald.intevation.org
Mon Mar 4 11:44:25 CET 2013
# HG changeset patch
# User Raimund Renkert <rrenkert at intevation.de>
# Date 1362393851 -3600
# Node ID 8c65acf01adc7083c5936d0f8acf67374c97140b
# Parent 9474e27e319aacf2c5745a45f1a060ada42482ea
Fixed datacage to be oracle compatible.
diff -r 9474e27e319a -r 8c65acf01adc flys-artifacts/doc/conf/meta-data.xml
--- a/flys-artifacts/doc/conf/meta-data.xml Mon Mar 04 11:21:50 2013 +0100
+++ b/flys-artifacts/doc/conf/meta-data.xml Mon Mar 04 11:44:11 2013 +0100
@@ -591,7 +591,7 @@
<dc:attribute name="id" value="flood-protections-${river_id}"/>
<dc:context connection="system">
<dc:statement>
- SELECT DISTINCT ON (cs.id)
+ SELECT DISTINCT
cs.id AS prot_id,
cs.description AS prot_description
FROM cross_sections cs
@@ -617,7 +617,7 @@
<dc:attribute name="id" value="hyk-${river_id}"/>
<dc:context connection="system">
<dc:statement>
- SELECT DISTINCT ON (h.id)
+ SELECT DISTINCT
h.id AS hyk_id,
h.description AS hyk_description
FROM hyks h
diff -r 9474e27e319a -r 8c65acf01adc flys-artifacts/src/main/java/de/intevation/flys/artifacts/datacage/templating/FunctionResolver.java
--- a/flys-artifacts/src/main/java/de/intevation/flys/artifacts/datacage/templating/FunctionResolver.java Mon Mar 04 11:21:50 2013 +0100
+++ b/flys-artifacts/src/main/java/de/intevation/flys/artifacts/datacage/templating/FunctionResolver.java Mon Mar 04 11:44:11 2013 +0100
@@ -93,17 +93,17 @@
Object from = args.get(2);
if (!(mode instanceof String)){
- return -Double.MAX_VALUE;
+ return -99999d;
}
if (mode.equals("locations")) {
if (!(locations instanceof String)) {
- return -Double.MAX_VALUE;
+ return -99999d;
}
String loc = ((String)locations).replace(" ", "");
String[] split = loc.split(",");
if (split.length < 1) {
- return -Double.MAX_VALUE;
+ return -99999d;
}
try {
double min = Double.parseDouble(split[0]);
@@ -116,23 +116,23 @@
return min;
}
catch (NumberFormatException nfe) {
- return -Double.MAX_VALUE;
+ return -99999d;
}
}
else if (mode.equals("distance")) {
if (!(from instanceof String)) {
- return -Double.MAX_VALUE;
+ return -99999d;
}
String f = (String)from;
try {
return Double.parseDouble(f);
}
catch(NumberFormatException nfe) {
- return -Double.MAX_VALUE;
+ return -99999d;
}
}
else {
- return -Double.MAX_VALUE;
+ return -99999d;
}
}
});
@@ -149,18 +149,18 @@
Object to = args.get(2);
if (!(mode instanceof String)){
- return Double.MAX_VALUE;
+ return 99999d;
}
if (mode.equals("locations")) {
if (!(locations instanceof String)) {
- return Double.MAX_VALUE;
+ return 99999d;
}
try {
String loc = ((String)locations).replace(" ", "");
String[] split = loc.split(",");
if (split.length < 1) {
- return Double.MAX_VALUE;
+ return 99999d;
}
double max = Double.parseDouble(split[0]);
for (int i = 1; i < split.length; ++i) {
@@ -172,12 +172,12 @@
return max;
}
catch (NumberFormatException nfe) {
- return Double.MAX_VALUE;
+ return 99999d;
}
}
else if (mode.equals("distance")) {
if (!(to instanceof String)) {
- return Double.MAX_VALUE;
+ return 99999d;
}
else {
String t = (String)to;
@@ -185,12 +185,12 @@
return Double.parseDouble(t);
}
catch(NumberFormatException nfe) {
- return Double.MAX_VALUE;
+ return 99999d;
}
}
}
else {
- return Double.MAX_VALUE;
+ return 99999d;
}
}
});
More information about the Dive4elements-commits
mailing list