21#include <com/sun/star/beans/PropertyAttribute.hpp>
22#include <com/sun/star/sdbcx/Privilege.hpp>
47 const Reference< XConnection >& _xConnection)
51 m_nPrivileges = Privilege::DROP |
52 Privilege::REFERENCE |
64 const Reference< XConnection >& _xConnection,
67 const OUString& Description ,
68 const OUString& SchemaName,
69 const OUString& CatalogName,
70 sal_Int32 _nPrivileges
79 , m_nPrivileges(_nPrivileges)
84void OHSQLTable::construct()
125 ::connectivity::sdbcx::OTableDescriptor_BASE::rBHelper.bDisposed
132 throw NoSuchElementException(colName,*
this);
138 Reference<XPropertySet> xProp;
141 sal_Int32 nOldType = 0,nNewType = 0,nOldPrec = 0,nNewPrec = 0,nOldScale = 0,nNewScale = 0;
142 OUString sOldTypeName, sNewTypeName;
159 sal_Int32 nOldNullable = 0,nNewNullable = 0;
169 OUString sNewColumnName;
171 if ( sNewColumnName != colName )
184 if ( nOldType != nNewType
185 || sOldTypeName != sNewTypeName
186 || nOldPrec != nNewPrec
187 || nOldScale != nNewScale
188 || nNewNullable != nOldNullable
201 OUString sNewDefault,sOldDefault;
205 if(!sOldDefault.isEmpty())
208 if(!sNewDefault.isEmpty() && sOldDefault != sNewDefault)
211 else if(sOldDefault.isEmpty() && !sNewDefault.isEmpty())
230#if OSL_DEBUG_LEVEL > 0
233 OUString sDescriptorName;
234 OSL_ENSURE( _xDescriptor.is()
236 && ( sDescriptorName == _rColName ),
237 "OHSQLTable::alterColumnType: unexpected column name!" );
248 ::comphelper::copyProperties(_xDescriptor,pColumn);
261 " SET DEFAULT '" + _sNewDefault +
"'";
279 OUString sSql(
"ALTER TABLE " );
289 OUString sSQL = _rStatement;
290 if(sSQL.endsWith(
","))
291 sSQL = sSQL.replaceAt(sSQL.getLength()-1, 1,
u")");
293 Reference< XStatement > xStmt =
getConnection()->createStatement( );
296 try { xStmt->execute(sSQL); }
299 ::comphelper::disposeComponent(xStmt);
302 ::comphelper::disposeComponent(xStmt);
311 std::vector<Type> aOwnTypes;
312 aOwnTypes.reserve(
aTypes.getLength());
314 const Type* pEnd = pIter +
aTypes.getLength();
315 for(;pIter != pEnd;++pIter)
319 aOwnTypes.push_back(*pIter);
322 return Sequence< Type >(aOwnTypes.data(), aOwnTypes.size());
333 ::connectivity::sdbcx::OTableDescriptor_BASE::rBHelper.bDisposed
341 OUString sSql =
"ALTER ";
OptionalString sComposedName
::cppu::IPropertyArrayHelper * getArrayHelper(sal_Int32 nId)
void registerProperty(const OUString &_rName, sal_Int32 _nHandle, sal_Int32 _nAttributes, void *_pPointerToMember, const css::uno::Type &_rMemberType)
void setParent(OTableHelper *_pTable)
set the parent of the columns.
css::uno::Reference< css::sdbc::XConnection > const & getConnection() const
virtual css::uno::Reference< css::sdbc::XDatabaseMetaData > getMetaData() const override
void alterColumnType(sal_Int32 nNewType, const OUString &_rColName, const css::uno::Reference< css::beans::XPropertySet > &_xDescriptor)
virtual sdbcx::OCollection * createIndexes(const ::std::vector< OUString > &_rNames) override
creates the index collection for the table
virtual void SAL_CALL alterColumnByName(const OUString &colName, const css::uno::Reference< css::beans::XPropertySet > &descriptor) override
OUString getAlterTableColumnPart() const
returns the ALTER TABLE XXX COLUMN statement
void dropDefaultValue(const OUString &_sNewDefault)
virtual sdbcx::OCollection * createColumns(const ::std::vector< OUString > &_rNames) override
creates the column collection for the table
virtual void SAL_CALL rename(const OUString &newName) override
virtual ::cppu::IPropertyArrayHelper &SAL_CALL getInfoHelper() override
virtual css::uno::Sequence< css::uno::Type > SAL_CALL getTypes() override
virtual sdbcx::OCollection * createKeys(const ::std::vector< OUString > &_rNames) override
creates the key collection for the table
virtual ::cppu::IPropertyArrayHelper * createArrayHelper(sal_Int32 nId) const override
used to implement the creation of the array helper which is shared amongst all instances of the class...
virtual css::uno::Any SAL_CALL queryInterface(const css::uno::Type &rType) override
void alterDefaultValue(std::u16string_view _sNewDefault, const OUString &_rColName)
void executeStatement(const OUString &_rStatement)
executes the statement.
::cppu::IPropertyArrayHelper * doCreateArrayHelper() const
helper for derived classes to implement OPropertyArrayUsageHelper::createArrayHelper
std::unique_ptr< OCollection > m_xColumns
virtual void SAL_CALL rename(const OUString &newName) override
virtual void construct() override
virtual css::uno::Sequence< css::uno::Type > SAL_CALL getTypes() override
virtual css::uno::Any SAL_CALL queryInterface(const css::uno::Type &rType) override
mutable::osl::Mutex m_aMutex
#define DBG_UNHANDLED_EXCEPTION(...)
void checkDisposed(bool _bThrow)
OUString newName(std::u16string_view aNewPrefix, std::u16string_view aOldPrefix, std::u16string_view old_Name)
#define PROPERTY_ID_PRIVILEGES
#define PROPERTY_ID_ISNULLABLE
#define PROPERTY_ID_PRECISION
#define PROPERTY_ID_ISAUTOINCREMENT
#define PROPERTY_ID_TYPENAME
#define PROPERTY_ID_DEFAULTVALUE
#define PROPERTY_ID_SCALE