diff options
Diffstat (limited to 'connectivity/source/drivers/firebird/Tables.cxx')
-rw-r--r-- | connectivity/source/drivers/firebird/Tables.cxx | 42 |
1 files changed, 30 insertions, 12 deletions
diff --git a/connectivity/source/drivers/firebird/Tables.cxx b/connectivity/source/drivers/firebird/Tables.cxx index b686f66ecb9c..e3440137381a 100644 --- a/connectivity/source/drivers/firebird/Tables.cxx +++ b/connectivity/source/drivers/firebird/Tables.cxx @@ -9,6 +9,7 @@ #include "Table.hxx" #include "Tables.hxx" +#include "Views.hxx" #include "Catalog.hxx" #include <TConnection.hxx> @@ -29,7 +30,6 @@ using namespace ::osl; using namespace ::com::sun::star; using namespace ::com::sun::star::beans; using namespace ::com::sun::star::container; -using namespace ::com::sun::star::lang; using namespace ::com::sun::star::sdbc; using namespace ::com::sun::star::sdbcx; using namespace ::com::sun::star::uno; @@ -89,9 +89,8 @@ OUString Tables::createStandardColumnPart(const Reference< XPropertySet >& xColP if ( xPropInfo.is() && xPropInfo->hasPropertyByName(rPropMap.getNameByIndex(PROPERTY_ID_AUTOINCREMENTCREATION)) ) xColProp->getPropertyValue(rPropMap.getNameByIndex(PROPERTY_ID_AUTOINCREMENTCREATION)) >>= sAutoIncrementValue; - aSql.append(" "); - - aSql.append(dbtools::createStandardTypePart(xColProp, _xConnection)); + aSql.append(" " + + dbtools::createStandardTypePart(xColProp, _xConnection)); // Add character set for (VAR)BINARY (fix) types: // (VAR) BINARY is distinguished from other CHAR types by its character set. // Octets is a special character set for binary data. @@ -103,15 +102,13 @@ OUString Tables::createStandardColumnPart(const Reference< XPropertySet >& xColP >>= aType; if(aType == DataType::BINARY || aType == DataType::VARBINARY) { - aSql.append(" "); - aSql.append("CHARACTER SET OCTETS"); + aSql.append(" CHARACTER SET OCTETS"); } } if ( bIsAutoIncrement && !sAutoIncrementValue.isEmpty()) { - aSql.append(" "); - aSql.append(sAutoIncrementValue); + aSql.append(" " + sAutoIncrementValue); } // AutoIncrement "IDENTITY" is implicitly "NOT NULL" else if(::comphelper::getINT32(xColProp->getPropertyValue(rPropMap.getNameByIndex(PROPERTY_ID_ISNULLABLE))) == ColumnValue::NO_NULLS) @@ -148,8 +145,8 @@ ObjectType Tables::appendObject(const OUString& rName, if ( sComposedName.isEmpty() ) ::dbtools::throwFunctionSequenceException(xConnection); - aSqlBuffer.append(sComposedName); - aSqlBuffer.append(" ("); + aSqlBuffer.append(sComposedName + + " ("); // columns Reference<XColumnsSupplier> xColumnSup(rDescriptor,UNO_QUERY); @@ -165,8 +162,8 @@ ObjectType Tables::appendObject(const OUString& rName, { if ( (xColumns->getByIndex(i) >>= xColProp) && xColProp.is() ) { - aSqlBuffer.append(createStandardColumnPart(xColProp,xConnection)); - aSqlBuffer.append(","); + aSqlBuffer.append(createStandardColumnPart(xColProp,xConnection) + + ","); } } OUString sSql = aSqlBuffer.makeStringAndClear(); @@ -202,6 +199,27 @@ void Tables::dropObject(sal_Int32 nPosition, const OUString& sName) m_xMetaData->getConnection()->createStatement()->execute( "DROP " + sType + " " + ::dbtools::quoteName(sQuoteString,sName)); + + if (sType == "VIEW") + { + Views* pViews = static_cast<Views*>(static_cast<Catalog&>(m_rParent).getPrivateViews()); + if ( pViews && pViews->hasByName(sName) ) + pViews->dropByNameImpl(sName); + } } +void connectivity::firebird::Tables::appendNew(const OUString& _rsNewTable) +{ + insertElement(_rsNewTable, nullptr); + + // notify our container listeners + css::container::ContainerEvent aEvent(static_cast<XContainer*>(this), + css::uno::Any(_rsNewTable), css::uno::Any(), + css::uno::Any()); + comphelper::OInterfaceIteratorHelper3 aListenerLoop(m_aContainerListeners); + while (aListenerLoop.hasMoreElements()) + aListenerLoop.next()->elementInserted(aEvent); +} + + /* vim:set shiftwidth=4 softtabstop=4 expandtab cinoptions=b1,g0,N-s cinkeys+=0=break: */ |