summaryrefslogtreecommitdiff
path: root/connectivity
diff options
context:
space:
mode:
authorAndrzej J.R. Hunt <andrzej@ahunt.org>2013-08-14 14:23:42 +0100
committerAndrzej J.R. Hunt <andrzej@ahunt.org>2013-08-14 17:24:59 +0100
commit60cda25e1d75144bdf15cad7a3f90f9a9e5b1282 (patch)
tree0802e470cd0f4aa3485d6406bb4654be6beb4cb1 /connectivity
parent488f62781e20ebe196ed9cb00a0d41ca00ee0808 (diff)
Remove XRename support from XTable. (firebird-sdbc)
Firebird doesn't support the renaming of tables, hence we need to disable the api to rename tables. Change-Id: I86045697f684280c591979dad4fdea2dde0db4ba
Diffstat (limited to 'connectivity')
-rw-r--r--connectivity/source/drivers/firebird/Table.cxx37
-rw-r--r--connectivity/source/drivers/firebird/Table.hxx21
2 files changed, 58 insertions, 0 deletions
diff --git a/connectivity/source/drivers/firebird/Table.cxx b/connectivity/source/drivers/firebird/Table.cxx
index 03d7657e1db6..56f46beede14 100644
--- a/connectivity/source/drivers/firebird/Table.cxx
+++ b/connectivity/source/drivers/firebird/Table.cxx
@@ -10,6 +10,7 @@
#include "Columns.hxx"
#include "Table.hxx"
+#include <comphelper/sequence.hxx>
#include <connectivity/TIndexes.hxx>
#include <connectivity/TKeys.hxx>
@@ -103,4 +104,40 @@ void SAL_CALL Table::alterColumnByName(const OUString& rColName,
m_pColumns->refresh();
// TODO: implement me
}
+
+// ----- XRename --------------------------------------------------------------
+void SAL_CALL Table::rename(const OUString& rName)
+ throw(SQLException, ElementExistException, RuntimeException)
+{
+ (void) rName;
+ throw RuntimeException(); // Firebird doesn't support this.
+}
+
+// ----- XInterface -----------------------------------------------------------
+Any SAL_CALL Table::queryInterface(const Type& rType)
+ throw(RuntimeException)
+{
+ if (rType.getTypeName() == "com.sun.star.sdbcx.XRename")
+ return Any();
+
+ return OTableHelper::queryInterface(rType);
+}
+
+// ----- XTypeProvider --------------------------------------------------------
+uno::Sequence< Type > SAL_CALL Table::getTypes()
+ throw(RuntimeException)
+{
+ uno::Sequence< Type > aTypes = OTableHelper::getTypes();
+
+ for (int i = 0; i < aTypes.getLength(); i++)
+ {
+ if (aTypes[i].getTypeName() == "com.sun.star.sdbcx.XRename")
+ {
+ ::comphelper::removeElementAt(aTypes, i);
+ break;
+ }
+ }
+
+ return OTableHelper::getTypes();
+}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ \ No newline at end of file
diff --git a/connectivity/source/drivers/firebird/Table.hxx b/connectivity/source/drivers/firebird/Table.hxx
index cfeaea178005..6ee5e366a5b3 100644
--- a/connectivity/source/drivers/firebird/Table.hxx
+++ b/connectivity/source/drivers/firebird/Table.hxx
@@ -19,6 +19,10 @@ namespace connectivity
namespace firebird
{
+ /**
+ * Implements sdbcx.Table. We don't support table renaming (XRename)
+ * hence the appropriate methods are overriden.
+ */
class Table: public OTableHelper
{
private:
@@ -52,6 +56,23 @@ namespace connectivity
::com::sun::star::container::NoSuchElementException,
::com::sun::star::uno::RuntimeException);
+ // XRename -- UNSUPPORTED
+ virtual void SAL_CALL rename(const ::rtl::OUString& sName)
+ throw(::com::sun::star::sdbc::SQLException,
+ ::com::sun::star::container::ElementExistException,
+ ::com::sun::star::uno::RuntimeException);
+
+ //XInterface
+ virtual ::com::sun::star::uno::Any
+ SAL_CALL queryInterface(const ::com::sun::star::uno::Type & rType)
+ throw(::com::sun::star::uno::RuntimeException);
+
+ //XTypeProvider
+ virtual ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Type >
+ SAL_CALL getTypes()
+ throw(::com::sun::star::uno::RuntimeException);
+
+
};
} // namespace firebird