summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrzej J.R. Hunt <andrzej@ahunt.org>2013-08-12 12:08:33 +0100
committerAndrzej J.R. Hunt <andrzej@ahunt.org>2013-08-12 17:20:22 +0100
commit64deb339a97c1977f363fa08fd2b7d9fcfe2e957 (patch)
tree5e2b0016e971e49b51f64df3c0b43f9fb557ea30
parent6878fa8a9cba2d484f5fad264188c5a825fc5315 (diff)
Implement getTables(). (firebird-sdbc)
Change-Id: I6b13fe51547ac5a51a03bf9b55f8e684275652cb
-rw-r--r--connectivity/source/drivers/firebird/Connection.cxx6
-rw-r--r--connectivity/source/drivers/firebird/Tables.cxx22
-rw-r--r--connectivity/source/drivers/firebird/Tables.hxx8
3 files changed, 19 insertions, 17 deletions
diff --git a/connectivity/source/drivers/firebird/Connection.cxx b/connectivity/source/drivers/firebird/Connection.cxx
index 63daf08a0e08..9dbc87fb6fd8 100644
--- a/connectivity/source/drivers/firebird/Connection.cxx
+++ b/connectivity/source/drivers/firebird/Connection.cxx
@@ -766,8 +766,8 @@ void OConnection::clearStatements()
uno::Reference< XNameAccess > SAL_CALL OConnection::getTables()
throw (RuntimeException)
{
- // TODO: IMPLEMENT ME PROPERLY
- //return new Tables();
- return 0;
+ return new Tables(getMetaData(),
+ *this,
+ m_aMutex);
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/connectivity/source/drivers/firebird/Tables.cxx b/connectivity/source/drivers/firebird/Tables.cxx
index 607fdc32bd38..be3d2314cc99 100644
--- a/connectivity/source/drivers/firebird/Tables.cxx
+++ b/connectivity/source/drivers/firebird/Tables.cxx
@@ -26,13 +26,15 @@ using namespace ::com::sun::star::sdbc;
using namespace ::com::sun::star::uno;
-Tables::Tables(ODatabaseMetaData& xMetaData,
+Tables::Tables(const uno::Reference< XDatabaseMetaData >& rMetaData,
OWeakObject& rParent,
- Mutex& rMutex,
- const TStringVector& rVector) :
- OCollection(rParent, sal_True, rMutex, rVector),
+ Mutex& rMutex) :
+ OCollection(rParent,
+ sal_True,
+ rMutex,
+ TStringVector(1, "TABLE")), // std::vector with 1 element
m_rMutex(rMutex),
- m_xMetaData(xMetaData)
+ m_xMetaData(rMetaData)
{
}
@@ -47,10 +49,10 @@ ObjectType Tables::createObject(const OUString& rName)
{
// TODO: parse the name.
// TODO: use table types
- uno::Reference< XResultSet > xTables = m_xMetaData.getTables(Any(),
- OUString(),
- rName,
- uno::Sequence< OUString >());
+ uno::Reference< XResultSet > xTables = m_xMetaData->getTables(Any(),
+ OUString(),
+ rName,
+ uno::Sequence< OUString >());
if (!xTables.is())
throw RuntimeException();
@@ -62,7 +64,7 @@ ObjectType Tables::createObject(const OUString& rName)
ObjectType xRet(new Table(this,
m_rMutex,
- m_xMetaData.getConnection(),
+ m_xMetaData->getConnection(),
xRow->getString(3), // Name
xRow->getString(4), // Type
xRow->getString(5))); // Description / Remarks / Comments
diff --git a/connectivity/source/drivers/firebird/Tables.hxx b/connectivity/source/drivers/firebird/Tables.hxx
index 8128fb472079..2f21cd6d6b21 100644
--- a/connectivity/source/drivers/firebird/Tables.hxx
+++ b/connectivity/source/drivers/firebird/Tables.hxx
@@ -35,13 +35,13 @@ namespace connectivity
virtual ::connectivity::sdbcx::ObjectType createObject(
const ::rtl::OUString& rName);
- ODatabaseMetaData& m_xMetaData;
+ ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XDatabaseMetaData >
+ m_xMetaData;
public:
- Tables(ODatabaseMetaData& xMetaData,
+ Tables(const ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XDatabaseMetaData >& rMetaData,
::cppu::OWeakObject& rParent,
- ::osl::Mutex& rMutex,
- const ::connectivity::TStringVector& rVector);
+ ::osl::Mutex& rMutex);
// TODO: we should also implement XDataDescriptorFactory, XRefreshable,
// XAppend, etc., but all are optional.