Mercurial > dive4elements > gnv-client
changeset 756:1614b27dcbfa
Added Support of Layers which are Joined from two Tables.
gnv-artifacts/trunk@804 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author | Tim Englich <tim.englich@intevation.de> |
---|---|
date | Fri, 19 Mar 2010 12:12:10 +0000 |
parents | 8dc8d04084d4 |
children | 76cbea5a455a |
files | gnv-artifacts/ChangeLog gnv-artifacts/doc/conf/queries.properties gnv-artifacts/src/main/java/de/intevation/gnv/state/layer/LayerOutputState.java |
diffstat | 3 files changed, 15 insertions(+), 2 deletions(-) [+] |
line wrap: on
line diff
--- 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 <tim.englich@intevation.de> + + * 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 <tim.englich@intevation.de> * src/main/resources/lang/artifactMessages*.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 \
--- 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();