# HG changeset patch # User Tim Englich # Date 1269000730 0 # Node ID 1614b27dcbfa567a03773f7a334146aab88f6dab # Parent 8dc8d04084d45e3f761fd291f81f7f92c255c3a2 Added Support of Layers which are Joined from two Tables. gnv-artifacts/trunk@804 c6561f87-3c4e-4783-a992-168aeb5c3f6f diff -r 8dc8d04084d4 -r 1614b27dcbfa gnv-artifacts/ChangeLog --- a/gnv-artifacts/ChangeLog Fri Mar 19 10:57:40 2010 +0000 +++ b/gnv-artifacts/ChangeLog Fri Mar 19 12:12:10 2010 +0000 @@ -1,3 +1,14 @@ +2010-03-19 Tim Englich + + * src/main/java/de/intevation/gnv/state/layer/LayerOutputState.java: + Added Support of Layers which are Joined from two Tables. + Only the Columns of the first Table will be inserted to prevent Namecollisions + of Attributenames. + + * doc/conf/queries.properties: + Added full qualified Columnname to prevent Namecolliosions in SQL-Statement + for querying Layer-Data if two Tables are Joined to one Layer. + 2010-03-19 Tim Englich * src/main/resources/lang/artifactMessages*.properties: diff -r 8dc8d04084d4 -r 1614b27dcbfa gnv-artifacts/doc/conf/queries.properties --- a/gnv-artifacts/doc/conf/queries.properties Fri Mar 19 10:57:40 2010 +0000 +++ b/gnv-artifacts/doc/conf/queries.properties Fri Mar 19 12:12:10 2010 +0000 @@ -1324,7 +1324,7 @@ WHERE (FEATURETYPE = 7 OR FEATURETYPE = 8) AND \ FEATURECODE = ? -layer_colums= SELECT COLUMN_NAME \ +layer_colums= SELECT OWNER || '.' || TABLE_NAME || '.' || COLUMN_NAME \ FROM SDE.COLUMN_REGISTRY \ WHERE COLUMN_NAME NOT LIKE 'SHAPE' AND \ OWNER = '?' AND \ diff -r 8dc8d04084d4 -r 1614b27dcbfa gnv-artifacts/src/main/java/de/intevation/gnv/state/layer/LayerOutputState.java --- a/gnv-artifacts/src/main/java/de/intevation/gnv/state/layer/LayerOutputState.java Fri Mar 19 10:57:40 2010 +0000 +++ b/gnv-artifacts/src/main/java/de/intevation/gnv/state/layer/LayerOutputState.java Fri Mar 19 12:12:10 2010 +0000 @@ -245,7 +245,9 @@ private String fetchColumns(String tableName){ String returnValue = null; try { - String[] filter = tableName.toUpperCase().split("\\."); + String[] tables = tableName.toUpperCase().split(","); + String[] filter = tables[0].split("\\."); + // Only use the first Table the second one will be ignored. QueryExecutor queryExecutor = QueryExecutorFactory.getInstance() .getQueryExecutor();