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/source/sdbcx | |
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/source/sdbcx')
-rw-r--r-- | connectivity/source/sdbcx/VColumn.cxx | 16 | ||||
-rw-r--r-- | connectivity/source/sdbcx/VIndexColumn.cxx | 10 | ||||
-rw-r--r-- | connectivity/source/sdbcx/VKeyColumn.cxx | 10 |
3 files changed, 30 insertions, 6 deletions
diff --git a/connectivity/source/sdbcx/VColumn.cxx b/connectivity/source/sdbcx/VColumn.cxx index f8cae2530774..8de64c8ff189 100644 --- a/connectivity/source/sdbcx/VColumn.cxx +++ b/connectivity/source/sdbcx/VColumn.cxx @@ -87,7 +87,10 @@ OColumn::OColumn( const ::rtl::OUString& _Name, 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) :OColumnDescriptor_BASE(m_aMutex) ,ODescriptor(OColumnDescriptor_BASE::rBHelper,_bCase) ,m_TypeName(_TypeName) @@ -100,6 +103,9 @@ OColumn::OColumn( const ::rtl::OUString& _Name, ,m_IsAutoIncrement(_IsAutoIncrement) ,m_IsRowVersion(_IsRowVersion) ,m_IsCurrency(_IsCurrency) + ,m_CatalogName(_CatalogName) + ,m_SchemaName(_SchemaName) + ,m_TableName(_TableName) { m_Name = _Name; @@ -167,6 +173,9 @@ void OColumn::construct() registerProperty(OMetaConnection::getPropMap().getNameByIndex(PROPERTY_ID_ISAUTOINCREMENT), PROPERTY_ID_ISAUTOINCREMENT, nAttrib, &m_IsAutoIncrement, ::getBooleanCppuType()); registerProperty(OMetaConnection::getPropMap().getNameByIndex(PROPERTY_ID_ISROWVERSION), PROPERTY_ID_ISROWVERSION, nAttrib, &m_IsRowVersion, ::getBooleanCppuType()); registerProperty(OMetaConnection::getPropMap().getNameByIndex(PROPERTY_ID_ISCURRENCY), PROPERTY_ID_ISCURRENCY, nAttrib, &m_IsCurrency, ::getBooleanCppuType()); + registerProperty(OMetaConnection::getPropMap().getNameByIndex(PROPERTY_ID_CATALOGNAME), PROPERTY_ID_CATALOGNAME, nAttrib, &m_CatalogName, ::getCppuType(&m_CatalogName)); + registerProperty(OMetaConnection::getPropMap().getNameByIndex(PROPERTY_ID_SCHEMANAME), PROPERTY_ID_SCHEMANAME, nAttrib, &m_SchemaName, ::getCppuType(&m_SchemaName)); + registerProperty(OMetaConnection::getPropMap().getNameByIndex(PROPERTY_ID_TABLENAME), PROPERTY_ID_TABLENAME, nAttrib, &m_TableName, ::getCppuType(&m_TableName)); } // ------------------------------------------------------------------------- void OColumn::disposing(void) @@ -195,7 +204,10 @@ Reference< XPropertySet > SAL_CALL OColumn::createDataDescriptor( ) throw(Runti m_IsAutoIncrement, m_IsRowVersion, m_IsCurrency, - isCaseSensitive()); + isCaseSensitive(), + m_CatalogName, + m_SchemaName, + m_TableName); pNewColumn->setNew(sal_True); return pNewColumn; } diff --git a/connectivity/source/sdbcx/VIndexColumn.cxx b/connectivity/source/sdbcx/VIndexColumn.cxx index be5fd014ff72..15a20a2dec59 100644 --- a/connectivity/source/sdbcx/VIndexColumn.cxx +++ b/connectivity/source/sdbcx/VIndexColumn.cxx @@ -71,7 +71,10 @@ OIndexColumn::OIndexColumn( sal_Bool _IsAscending, 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 ) : OColumn(_Name, _TypeName, _DefaultValue, @@ -83,7 +86,10 @@ OIndexColumn::OIndexColumn( sal_Bool _IsAscending, _IsAutoIncrement, _IsRowVersion, _IsCurrency, - _bCase) + _bCase, + _CatalogName, + _SchemaName, + _TableName) , m_IsAscending(_IsAscending) { construct(); diff --git a/connectivity/source/sdbcx/VKeyColumn.cxx b/connectivity/source/sdbcx/VKeyColumn.cxx index edb052277d2b..48e1df5154f3 100644 --- a/connectivity/source/sdbcx/VKeyColumn.cxx +++ b/connectivity/source/sdbcx/VKeyColumn.cxx @@ -71,7 +71,10 @@ OKeyColumn::OKeyColumn( const ::rtl::OUString& _ReferencedColumn, 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 ) : OColumn(_Name, _TypeName, _DefaultValue, @@ -83,7 +86,10 @@ OKeyColumn::OKeyColumn( const ::rtl::OUString& _ReferencedColumn, _IsAutoIncrement, _IsRowVersion, _IsCurrency, - _bCase) + _bCase, + _CatalogName, + _SchemaName, + _TableName) , m_ReferencedColumn(_ReferencedColumn) { construct(); |