diff options
author | Andrzej J.R. Hunt <andrzej@ahunt.org> | 2013-08-12 17:15:46 +0100 |
---|---|---|
committer | Andrzej J.R. Hunt <andrzej@ahunt.org> | 2013-08-12 17:20:23 +0100 |
commit | ec365165ba7f332df479422174899808e1ff4152 (patch) | |
tree | 22c1def85918e5508db898718718dbc4c7f0db18 | |
parent | 88d74f35c2ce7968fe3f57f34e25d09374164ecd (diff) |
Implement refreshTables. (firebird-sdbc)
Change-Id: Ie2fe0c92c3cb1eb0ae68cdea8ad709021a8d8392
-rw-r--r-- | connectivity/source/drivers/firebird/Catalog.cxx | 24 | ||||
-rw-r--r-- | connectivity/source/drivers/firebird/Tables.cxx | 5 | ||||
-rw-r--r-- | connectivity/source/drivers/firebird/Tables.hxx | 3 |
3 files changed, 27 insertions, 5 deletions
diff --git a/connectivity/source/drivers/firebird/Catalog.cxx b/connectivity/source/drivers/firebird/Catalog.cxx index 552889a1d6e5..0f84c94b63a4 100644 --- a/connectivity/source/drivers/firebird/Catalog.cxx +++ b/connectivity/source/drivers/firebird/Catalog.cxx @@ -8,11 +8,15 @@ */ #include "Catalog.hxx" +#include "Tables.hxx" using namespace ::connectivity::firebird; +using namespace ::rtl; + using namespace ::com::sun::star; using namespace ::com::sun::star::sdbc; +using namespace ::com::sun::star::uno; Catalog::Catalog(const uno::Reference< XConnection >& rConnection): OCatalog(rConnection), @@ -23,8 +27,24 @@ Catalog::Catalog(const uno::Reference< XConnection >& rConnection): //----- OCatalog ------------------------------------------------------------- void Catalog::refreshTables() { - // TODO: implement me. - // Sets m_pTables (OCatalog) + // TODO: set type -- currenty we also get system tables... + uno::Reference< XResultSet > xTables = m_xMetaData->getTables(Any(), + "%", + "%", + Sequence< OUString >()); + + TStringVector aTableNames; + + fillNames(xTables, aTableNames); + + if (!m_pTables) + m_pTables = new Tables(m_xConnection->getMetaData(), + *this, + m_aMutex, + aTableNames); + else + m_pTables->reFill(aTableNames); + } void Catalog::refreshViews() diff --git a/connectivity/source/drivers/firebird/Tables.cxx b/connectivity/source/drivers/firebird/Tables.cxx index be3d2314cc99..8828b97209cc 100644 --- a/connectivity/source/drivers/firebird/Tables.cxx +++ b/connectivity/source/drivers/firebird/Tables.cxx @@ -28,11 +28,12 @@ using namespace ::com::sun::star::uno; Tables::Tables(const uno::Reference< XDatabaseMetaData >& rMetaData, OWeakObject& rParent, - Mutex& rMutex) : + Mutex& rMutex, + TStringVector& rNames) : OCollection(rParent, sal_True, rMutex, - TStringVector(1, "TABLE")), // std::vector with 1 element + rNames), m_rMutex(rMutex), m_xMetaData(rMetaData) { diff --git a/connectivity/source/drivers/firebird/Tables.hxx b/connectivity/source/drivers/firebird/Tables.hxx index 2f21cd6d6b21..c025e1bf4b28 100644 --- a/connectivity/source/drivers/firebird/Tables.hxx +++ b/connectivity/source/drivers/firebird/Tables.hxx @@ -41,7 +41,8 @@ namespace connectivity public: Tables(const ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XDatabaseMetaData >& rMetaData, ::cppu::OWeakObject& rParent, - ::osl::Mutex& rMutex); + ::osl::Mutex& rMutex, + ::connectivity::TStringVector& rNames); // TODO: we should also implement XDataDescriptorFactory, XRefreshable, // XAppend, etc., but all are optional. |