INTEGRATION: CWS dba24a (1.10.118); FILE MERGED
2007/09/25 10:37:15 oj 1.10.118.1: #i81922# new method to get drop stmt
This commit is contained in:
parent
76b480fa08
commit
743e937576
2 changed files with 32 additions and 6 deletions
|
@ -4,9 +4,9 @@
|
|||
*
|
||||
* $RCSfile: TKeys.cxx,v $
|
||||
*
|
||||
* $Revision: 1.10 $
|
||||
* $Revision: 1.11 $
|
||||
*
|
||||
* last change: $Author: obo $ $Date: 2006-09-17 02:00:42 $
|
||||
* last change: $Author: hr $ $Date: 2007-09-26 14:27:56 $
|
||||
*
|
||||
* The Contents of this file are made available subject to
|
||||
* the terms of GNU Lesser General Public License Version 2.1.
|
||||
|
@ -308,6 +308,11 @@ sdbcx::ObjectType OKeysHelper::appendObject( const ::rtl::OUString& _rForName, c
|
|||
|
||||
return createObject( sNewName );
|
||||
}
|
||||
// -----------------------------------------------------------------------------
|
||||
::rtl::OUString OKeysHelper::getDropForeignKey() const
|
||||
{
|
||||
return ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(" DROP CONSTRAINT "));
|
||||
}
|
||||
// -------------------------------------------------------------------------
|
||||
// XDrop
|
||||
void OKeysHelper::dropObject(sal_Int32 _nPos,const ::rtl::OUString _sElementName)
|
||||
|
@ -332,7 +337,7 @@ void OKeysHelper::dropObject(sal_Int32 _nPos,const ::rtl::OUString _sElementName
|
|||
}
|
||||
else
|
||||
{
|
||||
aSql += ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(" DROP CONSTRAINT "));
|
||||
aSql += getDropForeignKey();
|
||||
::rtl::OUString aQuote = m_pTable->getConnection()->getMetaData()->getIdentifierQuoteString();
|
||||
aSql += ::dbtools::quoteName( aQuote,_sElementName);
|
||||
}
|
||||
|
|
|
@ -4,9 +4,9 @@
|
|||
*
|
||||
* $RCSfile: YTable.cxx,v $
|
||||
*
|
||||
* $Revision: 1.10 $
|
||||
* $Revision: 1.11 $
|
||||
*
|
||||
* last change: $Author: obo $ $Date: 2006-09-17 03:03:45 $
|
||||
* last change: $Author: hr $ $Date: 2007-09-26 14:30:03 $
|
||||
*
|
||||
* The Contents of this file are made available subject to
|
||||
* the terms of GNU Lesser General Public License Version 2.1.
|
||||
|
@ -109,6 +109,27 @@ using namespace ::com::sun::star::sdbcx;
|
|||
using namespace ::com::sun::star::sdbc;
|
||||
using namespace ::com::sun::star::container;
|
||||
using namespace ::com::sun::star::lang;
|
||||
namespace connectivity
|
||||
{
|
||||
namespace mysql
|
||||
{
|
||||
class OMySQLKeysHelper : public OKeysHelper
|
||||
{
|
||||
protected:
|
||||
// -----------------------------------------------------------------------------
|
||||
virtual ::rtl::OUString getDropForeignKey() const
|
||||
{
|
||||
return ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(" DROP FOREIGN KEY "));
|
||||
}
|
||||
public:
|
||||
OMySQLKeysHelper( OTableHelper* _pTable,
|
||||
::osl::Mutex& _rMutex,
|
||||
const TStringVector& _rVector
|
||||
) : OKeysHelper(_pTable,_rMutex,_rVector){}
|
||||
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
OMySQLTable::OMySQLTable( sdbcx::OCollection* _pTables,
|
||||
const Reference< XConnection >& _xConnection)
|
||||
|
@ -174,7 +195,7 @@ sdbcx::OCollection* OMySQLTable::createColumns(const TStringVector& _rNames)
|
|||
// -----------------------------------------------------------------------------
|
||||
sdbcx::OCollection* OMySQLTable::createKeys(const TStringVector& _rNames)
|
||||
{
|
||||
return new OKeysHelper(this,m_aMutex,_rNames);
|
||||
return new OMySQLKeysHelper(this,m_aMutex,_rNames);
|
||||
}
|
||||
// -----------------------------------------------------------------------------
|
||||
sdbcx::OCollection* OMySQLTable::createIndexes(const TStringVector& _rNames)
|
||||
|
|
Loading…
Reference in a new issue