diff options
author | Frank Schoenheit [fs] <frank.schoenheit@sun.com> | 2010-04-16 13:55:24 +0200 |
---|---|---|
committer | Frank Schoenheit [fs] <frank.schoenheit@sun.com> | 2010-04-16 13:55:24 +0200 |
commit | a5c79e695f9dfd332d88e56ddbcea285201e6dcc (patch) | |
tree | c48935add10efe98ed234ec5d99df82d8228502a /connectivity/inc | |
parent | a001605a190749900d3e09aa864ce56925ff848e (diff) | |
parent | 2fa1d80dfd4ee347d4df32ca49fa8e9ad46ada10 (diff) |
dba33f: merge with m76-branch
Diffstat (limited to 'connectivity/inc')
-rw-r--r-- | connectivity/inc/connectivity/PColumn.hxx | 32 | ||||
-rw-r--r-- | connectivity/inc/connectivity/SQLStatementHelper.hxx | 54 | ||||
-rw-r--r-- | connectivity/inc/connectivity/TTableHelper.hxx | 3 | ||||
-rw-r--r-- | connectivity/inc/connectivity/dbtools.hxx | 38 | ||||
-rw-r--r-- | connectivity/inc/connectivity/sdbcx/VColumn.hxx | 1 | ||||
-rw-r--r-- | connectivity/inc/connectivity/sqliterator.hxx | 8 | ||||
-rw-r--r-- | connectivity/inc/connectivity/sqlnode.hxx | 5 |
7 files changed, 114 insertions, 27 deletions
diff --git a/connectivity/inc/connectivity/PColumn.hxx b/connectivity/inc/connectivity/PColumn.hxx index 8f22de0be964..547cc8fb9970 100644 --- a/connectivity/inc/connectivity/PColumn.hxx +++ b/connectivity/inc/connectivity/PColumn.hxx @@ -33,6 +33,7 @@ #include <vos/ref.hxx> #include <com/sun/star/sdbc/XResultSetMetaData.hpp> #include <com/sun/star/sdbc/XDatabaseMetaData.hpp> +#include <com/sun/star/container/XNameAccess.hpp> #include <comphelper/proparrhlp.hxx> namespace connectivity @@ -49,6 +50,7 @@ namespace connectivity { ::rtl::OUString m_aRealName; ::rtl::OUString m_aTableName; + ::rtl::OUString m_sLabel; sal_Bool m_bFunction; sal_Bool m_bDbasePrecisionChanged; sal_Bool m_bAggregateFunction; @@ -64,6 +66,7 @@ namespace connectivity OParseColumn(const ::rtl::OUString& _Name, const ::rtl::OUString& _TypeName, const ::rtl::OUString& _DefaultValue, + const ::rtl::OUString& _Description, sal_Int32 _IsNullable, sal_Int32 _Precision, sal_Int32 _Scale, @@ -75,15 +78,17 @@ namespace connectivity virtual void construct(); void setRealName(const ::rtl::OUString& _rName) { m_aRealName = _rName; } + void setLabel(const ::rtl::OUString& i_sLabel) { m_sLabel = i_sLabel; } void setTableName(const ::rtl::OUString& _rName) { m_aTableName = _rName; } void setFunction(sal_Bool _bFunction) { m_bFunction = _bFunction; } void setAggregateFunction(sal_Bool _bFunction) { m_bAggregateFunction = _bFunction; } void setIsSearchable( sal_Bool _bIsSearchable ) { m_bIsSearchable = _bIsSearchable; } void setDbasePrecisionChanged(sal_Bool _bDbasePrecisionChanged) { m_bDbasePrecisionChanged = _bDbasePrecisionChanged; } - ::rtl::OUString getRealName() const { return m_aRealName; } - ::rtl::OUString getTableName() const { return m_aTableName; } - sal_Bool getFunction() const { return m_bFunction; } + ::rtl::OUString getRealName() const { return m_aRealName; } + ::rtl::OUString getLabel() const { return m_sLabel; } + ::rtl::OUString getTableName() const { return m_aTableName; } + sal_Bool getFunction() const { return m_bFunction; } sal_Bool getDbasePrecisionChanged() const { return m_bDbasePrecisionChanged; } public: @@ -92,16 +97,20 @@ namespace connectivity static ::vos::ORef< OSQLColumns > createColumnsForResultSet( const ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XResultSetMetaData >& _rxResMetaData, - const ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XDatabaseMetaData >& _rxDBMetaData + const ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XDatabaseMetaData >& _rxDBMetaData, + const ::com::sun::star::uno::Reference< ::com::sun::star::container::XNameAccess>& i_xQueryColumns ); - /** creates a single OParseColumn, as described by a result set meta data instance + DECLARE_STL_USTRINGACCESS_MAP(int,StringMap); + /** creates a single OParseColumn, as described by a result set meta data instance. + The column names are unique. */ static OParseColumn* createColumnForResultSet( const ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XResultSetMetaData >& _rxResMetaData, const ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XDatabaseMetaData >& _rxDBMetaData, - sal_Int32 _nColumnPos + sal_Int32 _nColumnPos, + StringMap& _rColumns ); private: @@ -125,17 +134,6 @@ namespace connectivity virtual ~OOrderColumn(); public: OOrderColumn(const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet>& _xColumn,sal_Bool _bCase,sal_Bool _bAscending); - OOrderColumn(const ::rtl::OUString& _Name, - const ::rtl::OUString& _TypeName, - const ::rtl::OUString& _DefaultValue, - sal_Int32 _IsNullable, - sal_Int32 _Precision, - sal_Int32 _Scale, - sal_Int32 _Type, - sal_Bool _IsAutoIncrement, - sal_Bool _IsCurrency, - sal_Bool _bCase - ,sal_Bool _bAscending); virtual void construct(); diff --git a/connectivity/inc/connectivity/SQLStatementHelper.hxx b/connectivity/inc/connectivity/SQLStatementHelper.hxx new file mode 100644 index 000000000000..0d1bb97c7b7f --- /dev/null +++ b/connectivity/inc/connectivity/SQLStatementHelper.hxx @@ -0,0 +1,54 @@ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2008 by Sun Microsystems, Inc. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * $RCSfile: dbtools.hxx,v $ + * $Revision: 1.37 $ + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * <http://www.openoffice.org/license.html> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +#ifndef _CONNECTIVITY_SQLSTATEMENTHELPER_HXX_ +#define _CONNECTIVITY_SQLSTATEMENTHELPER_HXX_ + +#include "connectivity/dbtoolsdllapi.hxx" +#include <com/sun/star/beans/XPropertySet.hpp> +namespace rtl +{ + class OUStringBuffer; +} +//......................................................................... +namespace dbtools +{ + class OOO_DLLPUBLIC_DBTOOLS ISQLStatementHelper + { + public: + virtual void addComment(const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet >& descriptor,::rtl::OUStringBuffer& _rOut) = 0; + }; + +//......................................................................... +} // namespace dbtools +//......................................................................... + +#endif // _CONNECTIVITY_SQLSTATEMENTHELPER_HXX_ + diff --git a/connectivity/inc/connectivity/TTableHelper.hxx b/connectivity/inc/connectivity/TTableHelper.hxx index 9f0a644e0b6d..f99a106bce37 100644 --- a/connectivity/inc/connectivity/TTableHelper.hxx +++ b/connectivity/inc/connectivity/TTableHelper.hxx @@ -45,6 +45,7 @@ namespace connectivity { ::rtl::OUString sName; ::rtl::OUString aField6; + ::rtl::OUString sField12; // REMARKS ::rtl::OUString sField13; sal_Int32 nField5 , nField7 @@ -60,10 +61,12 @@ namespace connectivity , sal_Int32 _nField7 , sal_Int32 _nField9 , sal_Int32 _nField11 + , const ::rtl::OUString& _sField12 , const ::rtl::OUString& _sField13 ,OrdinalPosition _nPosition ) :sName( _rName ) ,aField6(_aField6) + ,sField12(_sField12) ,sField13(_sField13) ,nField5(_nField5) ,nField7(_nField7) diff --git a/connectivity/inc/connectivity/dbtools.hxx b/connectivity/inc/connectivity/dbtools.hxx index 1503291ef9b7..9b93830aeefe 100644 --- a/connectivity/inc/connectivity/dbtools.hxx +++ b/connectivity/inc/connectivity/dbtools.hxx @@ -87,6 +87,7 @@ namespace rtl //......................................................................... namespace dbtools { + class ISQLStatementHelper; typedef ::utl::SharedUNOComponent< ::com::sun::star::sdbc::XConnection > SharedConnection; enum EComposeRule @@ -225,6 +226,15 @@ namespace dbtools const ::rtl::OUString& _rName ); + /** returns the primary key columns of the table + */ + OOO_DLLPUBLIC_DBTOOLS ::com::sun::star::uno::Reference< ::com::sun::star::container::XNameAccess> getPrimaryKeyColumns_throw( + const ::com::sun::star::uno::Any& i_aTable + ); + OOO_DLLPUBLIC_DBTOOLS ::com::sun::star::uno::Reference< ::com::sun::star::container::XNameAccess> getPrimaryKeyColumns_throw( + const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet >& i_xTable + ); + /** get fields for a result set given by a "command descriptor" <p>A command descriptor here means: @@ -661,6 +671,7 @@ namespace dbtools OOO_DLLPUBLIC_DBTOOLS ::rtl::OUString createStandardCreateStatement( const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet >& descriptor, const ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XConnection>& _xConnection, + ISQLStatementHelper* _pHelper, const ::rtl::OUString& _sCreatePattern = ::rtl::OUString()); /** creates the standard sql statement for the key part of a create table statement. @@ -674,32 +685,39 @@ namespace dbtools const ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XConnection>& _xConnection); /** creates the standard sql statement for the column part of a create table statement. + @param _pHelper + Allow to add special SQL constructs. @param descriptor The descriptor of the column. @param _xConnection The connection. - @param _bAddScale - The scale will also be added when the value is 0. + @param _pHelper + Allow to add special SQL constructs. */ OOO_DLLPUBLIC_DBTOOLS - ::rtl::OUString createStandardColumnPart( const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet >& descriptor, - const ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XConnection>& _xConnection, - const ::rtl::OUString& _sCreatePattern = ::rtl::OUString()); + ::rtl::OUString createStandardColumnPart( const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet >& descriptor + ,const ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XConnection>& _xConnection + ,ISQLStatementHelper* _pHelper = NULL + ,const ::rtl::OUString& _sCreatePattern = ::rtl::OUString()); /** creates a SQL CREATE TABLE statement + @param descriptor The descriptor of the new table. @param _xConnection The connection. - @param _bAddScale - The scale will also be added when the value is 0. + @param _pHelper + Allow to add special SQL constructs. + @param _sCreatePattern + @return The CREATE TABLE statement. */ OOO_DLLPUBLIC_DBTOOLS - ::rtl::OUString createSqlCreateTableStatement( const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet >& descriptor, - const ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XConnection>& _xConnection, - const ::rtl::OUString& _sCreatePattern = ::rtl::OUString()); + ::rtl::OUString createSqlCreateTableStatement( const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet >& descriptor + ,const ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XConnection>& _xConnection + ,ISQLStatementHelper* _pHelper = NULL + ,const ::rtl::OUString& _sCreatePattern = ::rtl::OUString()); /** creates a SDBC column with the help of getColumns. @param _xTable diff --git a/connectivity/inc/connectivity/sdbcx/VColumn.hxx b/connectivity/inc/connectivity/sdbcx/VColumn.hxx index 2c9fa31a2d7e..0a8c5498cf60 100644 --- a/connectivity/inc/connectivity/sdbcx/VColumn.hxx +++ b/connectivity/inc/connectivity/sdbcx/VColumn.hxx @@ -84,6 +84,7 @@ namespace connectivity OColumn( const ::rtl::OUString& _Name, const ::rtl::OUString& _TypeName, const ::rtl::OUString& _DefaultValue, + const ::rtl::OUString& _Description, sal_Int32 _IsNullable, sal_Int32 _Precision, sal_Int32 _Scale, diff --git a/connectivity/inc/connectivity/sqliterator.hxx b/connectivity/inc/connectivity/sqliterator.hxx index 3b7db6968671..5152b7221f85 100644 --- a/connectivity/inc/connectivity/sqliterator.hxx +++ b/connectivity/inc/connectivity/sqliterator.hxx @@ -40,6 +40,7 @@ #include <map> #include <memory> +#include <vector> namespace connectivity { @@ -47,6 +48,8 @@ namespace connectivity class OSQLParseNode; class OSQLParser; + typedef ::std::pair<const OSQLParseNode*,const OSQLParseNode* > TNodePair; + enum OSQLStatementType { SQL_STATEMENT_UNKNOWN, SQL_STATEMENT_SELECT, @@ -279,6 +282,10 @@ namespace connectivity // tries to find the correct type of the function sal_Int32 getFunctionReturnType(const OSQLParseNode* _pNode ); + + // returns a lis of all joined columns + ::std::vector< TNodePair >& getJoinConditions() const; + private: /** traverses the list of table names, and filles _rTables */ @@ -351,6 +358,7 @@ namespace connectivity { m_aErrors = ::com::sun::star::sdbc::SQLException(); } + void impl_fillJoinConditions(const OSQLParseNode* i_pJoinCondition); }; } diff --git a/connectivity/inc/connectivity/sqlnode.hxx b/connectivity/inc/connectivity/sqlnode.hxx index 5f1d7137e678..fa283cb5cf04 100644 --- a/connectivity/inc/connectivity/sqlnode.hxx +++ b/connectivity/inc/connectivity/sqlnode.hxx @@ -226,6 +226,11 @@ namespace connectivity concatenation, char_factor, bit_value_fct, + comparison_predicate_part_2, + parenthesized_boolean_value_expression, + character_string_type, + other_like_predicate_part_2, + between_predicate_part_2, rule_count, // letzter_wert UNKNOWN_RULE // ID indicating that a node is no rule with a matching Rule-enum value (see getKnownRuleID) }; |