# HG changeset patch # User Tim Englich # Date 1257853679 0 # Node ID f304f2f12db47b9226d0abf156b74a4a49be4bb9 # Parent 6503bc864017d345749a6ca1da6fa03148d440e5 Changed the splitting of the Statements for ARCSDE-Transformation. Now it is possible to use a Select-Statement as an Table. geo-backend/trunk@312 c6561f87-3c4e-4783-a992-168aeb5c3f6f diff -r 6503bc864017 -r f304f2f12db4 geo-backend/ChangeLog --- a/geo-backend/ChangeLog Fri Nov 06 09:32:48 2009 +0000 +++ b/geo-backend/ChangeLog Tue Nov 10 11:47:59 2009 +0000 @@ -1,3 +1,9 @@ +2009-11-10 Tim Englich + + * src/main/java/de/intevation/gnv/geobackend/sde/datasources/ArcSDEStatement.java (executeQuery): + Changed the splitting of the Statements for ARCSDE-Transformation. + Now it is possible to use a Select-Statement as an Table. + 2009-11-06 Ingo Weinzierl * target/**: Removed. Should not be in version control. diff -r 6503bc864017 -r f304f2f12db4 geo-backend/src/main/java/de/intevation/gnv/geobackend/sde/datasources/ArcSDEStatement.java --- a/geo-backend/src/main/java/de/intevation/gnv/geobackend/sde/datasources/ArcSDEStatement.java Fri Nov 06 09:32:48 2009 +0000 +++ b/geo-backend/src/main/java/de/intevation/gnv/geobackend/sde/datasources/ArcSDEStatement.java Tue Nov 10 11:47:59 2009 +0000 @@ -127,9 +127,10 @@ String[] values = statement.toLowerCase().split("where", 2); String where = values.length > 1 ? values[1].trim() : ""; - values = values[0].split("from", 2); - String[] tableNames = values[1].toUpperCase().trim().split(","); - String[] returnFields = values[0].replaceAll("select", "").trim().split(","); + String[] tableNames = values[0].substring(values[0].indexOf("from")).replaceFirst("from", "").toUpperCase().trim().split(", "); + String columnValueString = values[0].substring(0, values[0].indexOf("from")).trim(); + columnValueString = columnValueString.replaceFirst("select", "").trim(); + String[] returnFields = columnValueString.split(","); String geometryColumnName = null; String byClause = null; int byClausePos = where.indexOf("group by");