diff options
author | Vladimir Glazounov <vg@openoffice.org> | 2008-08-19 09:33:45 +0000 |
---|---|---|
committer | Vladimir Glazounov <vg@openoffice.org> | 2008-08-19 09:33:45 +0000 |
commit | 919ba9cd66464a4a1b9182a5e84148e7e9cc112e (patch) | |
tree | 69a814624ae17c61aae44dab05608a938391fb52 | |
parent | 3d437c3894be9e8327668ce835fc8dabebac125a (diff) |
INTEGRATION: CWS dba31a (1.12.10); FILE MERGED
2008/07/02 12:06:10 fs 1.12.10.1: copying following changes from CWS dba30f to CWS dba31a:
2008/07/01 09:41:34 lla 1.12.2.1: #i82743# problem with 'Title' as DB Entry name
-rw-r--r-- | wizards/com/sun/star/wizards/db/SQLQueryComposer.java | 28 |
1 files changed, 20 insertions, 8 deletions
diff --git a/wizards/com/sun/star/wizards/db/SQLQueryComposer.java b/wizards/com/sun/star/wizards/db/SQLQueryComposer.java index 73de73861..460b5572d 100644 --- a/wizards/com/sun/star/wizards/db/SQLQueryComposer.java +++ b/wizards/com/sun/star/wizards/db/SQLQueryComposer.java @@ -7,7 +7,7 @@ * OpenOffice.org - a multi-platform office productivity suite * * $RCSfile: SQLQueryComposer.java,v $ - * $Revision: 1.12 $ + * $Revision: 1.13 $ * * This file is part of OpenOffice.org. * @@ -94,28 +94,40 @@ public class SQLQueryComposer { return true; } - public void appendSelectClause(boolean _baddAliasFieldNames) throws SQLException { + public void appendSelectClause(boolean _baddAliasFieldNames) throws SQLException + { String sSelectBaseClause = "SELECT "; selectclause = sSelectBaseClause; - for (int i = 0; i < CurDBMetaData.FieldColumns.length; i++) { - if (addtoSelectClause(CurDBMetaData.FieldColumns[i].DisplayFieldName)) { + for (int i = 0; i < CurDBMetaData.FieldColumns.length; i++) + { + if (addtoSelectClause(CurDBMetaData.FieldColumns[i].DisplayFieldName)) + { int iAggregate = CurDBMetaData.getAggregateIndex(CurDBMetaData.FieldColumns[i].DisplayFieldName); - if (iAggregate > -1) { + if (iAggregate > -1) + { selectclause += CurDBMetaData.AggregateFieldNames[iAggregate][1] + "(" + getComposedAliasFieldName(CurDBMetaData.AggregateFieldNames[iAggregate][0]) + ")"; if (_baddAliasFieldNames) + { selectclause += getAliasFieldNameClause(CurDBMetaData.AggregateFieldNames[iAggregate][0]); - } else { + } + } + else + { selectclause += getComposedAliasFieldName(CurDBMetaData.FieldColumns[i].DisplayFieldName); if (_baddAliasFieldNames) + { selectclause += getAliasFieldNameClause(CurDBMetaData.FieldColumns[i].DisplayFieldName); } + } selectclause += ", "; } } - if (selectclause.equals(sSelectBaseClause)){ + if (selectclause.equals(sSelectBaseClause)) + { selectclause = selectclause.substring(0, selectclause.length() - 1); } - else{ + else + { selectclause = selectclause.substring(0, selectclause.length() - 2); } } |