diff options
author | Lionel Elie Mamane <lionel@mamane.lu> | 2012-11-01 14:19:14 +0100 |
---|---|---|
committer | Lionel Elie Mamane <lionel@mamane.lu> | 2012-11-02 10:54:12 +0100 |
commit | 10359585eb1fa338b686c288c1d3b3e0fe9fca66 (patch) | |
tree | 2ef2c81441026c718c258d19451f1d453e00eab3 /connectivity/inc | |
parent | 20380f26b47faffe0cf541f46b8706439a5d4219 (diff) |
Columns should know their table
For example dbaccess::OSingleSelectQueryComposer::appendOrderByColumn expects it
(via impl_getColumnName_throw via getTableAlias)
There is some vagueness:
Should the TableName property contain just the table name,
or the *composed* table name
(that is with catalog and/or schema if used by this DB)?
In the case of a query, should it contain the table name (alias)
*in* *the* *query* or of the original table?
In the former case, what meaning do SchemaName and CatalogName have?
They should be empty?
For now, commit as such and deal with the fallout, if any,
when it hits the fan.
If we really need to store these *different* values,
(that is, some code validly needs them)
it would be easier / cleaner / ...
to define *different* properties
for these *different* notions.
Change-Id: I032e619a60e7563cd51478db16cb5e0e5452bfde
Diffstat (limited to 'connectivity/inc')
-rw-r--r-- | connectivity/inc/connectivity/PColumn.hxx | 15 | ||||
-rw-r--r-- | connectivity/inc/connectivity/sdbcx/VColumn.hxx | 29 | ||||
-rw-r--r-- | connectivity/inc/connectivity/sdbcx/VIndexColumn.hxx | 5 | ||||
-rw-r--r-- | connectivity/inc/connectivity/sdbcx/VKeyColumn.hxx | 5 |
4 files changed, 34 insertions, 20 deletions
diff --git a/connectivity/inc/connectivity/PColumn.hxx b/connectivity/inc/connectivity/PColumn.hxx index 9ac4eb5a272c..7da2c0691769 100644 --- a/connectivity/inc/connectivity/PColumn.hxx +++ b/connectivity/inc/connectivity/PColumn.hxx @@ -41,7 +41,6 @@ namespace connectivity public OParseColumn_BASE, public OParseColumn_PROP { ::rtl::OUString m_aRealName; - ::rtl::OUString m_aTableName; ::rtl::OUString m_sLabel; sal_Bool m_bFunction; sal_Bool m_bDbasePrecisionChanged; @@ -65,21 +64,24 @@ namespace connectivity sal_Int32 _Type, sal_Bool _IsAutoIncrement, sal_Bool _IsCurrency, - sal_Bool _bCase); + sal_Bool _bCase, + const ::rtl::OUString& _CatalogName, + const ::rtl::OUString& _SchemaName, + const ::rtl::OUString& _TableName); 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 setTableName(const ::rtl::OUString& _rName) { m_TableName = _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 getLabel() const { return m_sLabel; } - ::rtl::OUString getTableName() const { return m_aTableName; } + const ::rtl::OUString& getRealName() const { return m_aRealName; } + const ::rtl::OUString& getLabel() const { return m_sLabel; } + const ::rtl::OUString& getTableName() const { return m_TableName; } sal_Bool getFunction() const { return m_bFunction; } sal_Bool getDbasePrecisionChanged() const { return m_bDbasePrecisionChanged; } @@ -118,7 +120,6 @@ namespace connectivity public OOrderColumn_BASE, public OOrderColumn_PROP { const sal_Bool m_bAscending; - const ::rtl::OUString m_sTableName; protected: virtual ::cppu::IPropertyArrayHelper* createArrayHelper() const; diff --git a/connectivity/inc/connectivity/sdbcx/VColumn.hxx b/connectivity/inc/connectivity/sdbcx/VColumn.hxx index c58e7cf2d81e..ca7a0bcc0b1c 100644 --- a/connectivity/inc/connectivity/sdbcx/VColumn.hxx +++ b/connectivity/inc/connectivity/sdbcx/VColumn.hxx @@ -63,6 +63,10 @@ namespace connectivity sal_Bool m_IsRowVersion; sal_Bool m_IsCurrency; + ::rtl::OUString m_CatalogName; + ::rtl::OUString m_SchemaName; + ::rtl::OUString m_TableName; + using OColumnDescriptor_BASE::rBHelper; virtual ::cppu::IPropertyArrayHelper* createArrayHelper( sal_Int32 _nId) const; virtual ::cppu::IPropertyArrayHelper& SAL_CALL getInfoHelper(); @@ -74,17 +78,20 @@ namespace connectivity OColumn( sal_Bool _bCase); 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, - sal_Int32 _Type, - sal_Bool _IsAutoIncrement, - sal_Bool _IsRowVersion, - sal_Bool _IsCurrency, - sal_Bool _bCase); + const ::rtl::OUString& _TypeName, + const ::rtl::OUString& _DefaultValue, + const ::rtl::OUString& _Description, + sal_Int32 _IsNullable, + sal_Int32 _Precision, + sal_Int32 _Scale, + sal_Int32 _Type, + sal_Bool _IsAutoIncrement, + sal_Bool _IsRowVersion, + sal_Bool _IsCurrency, + sal_Bool _bCase, + const ::rtl::OUString& _CatalogName, + const ::rtl::OUString& _SchemaName, + const ::rtl::OUString& _TableName); DECLARE_SERVICE_INFO(); //XInterface diff --git a/connectivity/inc/connectivity/sdbcx/VIndexColumn.hxx b/connectivity/inc/connectivity/sdbcx/VIndexColumn.hxx index d5c11c40b985..bdccd128f172 100644 --- a/connectivity/inc/connectivity/sdbcx/VIndexColumn.hxx +++ b/connectivity/inc/connectivity/sdbcx/VIndexColumn.hxx @@ -50,7 +50,10 @@ namespace connectivity sal_Bool _IsAutoIncrement, sal_Bool _IsRowVersion, sal_Bool _IsCurrency, - sal_Bool _bCase); + sal_Bool _bCase, + const ::rtl::OUString& _CatalogName, + const ::rtl::OUString& _SchemaName, + const ::rtl::OUString& _TableName); virtual void construct(); DECLARE_SERVICE_INFO(); diff --git a/connectivity/inc/connectivity/sdbcx/VKeyColumn.hxx b/connectivity/inc/connectivity/sdbcx/VKeyColumn.hxx index 92624b5caad6..b3624bd69a3a 100644 --- a/connectivity/inc/connectivity/sdbcx/VKeyColumn.hxx +++ b/connectivity/inc/connectivity/sdbcx/VKeyColumn.hxx @@ -50,7 +50,10 @@ namespace connectivity sal_Bool _IsAutoIncrement, sal_Bool _IsRowVersion, sal_Bool _IsCurrency, - sal_Bool _bCase); + sal_Bool _bCase, + const ::rtl::OUString& _CatalogName, + const ::rtl::OUString& _SchemaName, + const ::rtl::OUString& _TableName); // just to make it not inline virtual ~OKeyColumn(); |