diff options
Diffstat (limited to 'connectivity/source/inc/mysql')
-rw-r--r-- | connectivity/source/inc/mysql/YCatalog.hxx | 64 | ||||
-rw-r--r-- | connectivity/source/inc/mysql/YColumns.hxx | 48 | ||||
-rw-r--r-- | connectivity/source/inc/mysql/YTable.hxx | 152 | ||||
-rw-r--r-- | connectivity/source/inc/mysql/YTables.hxx | 66 | ||||
-rw-r--r-- | connectivity/source/inc/mysql/YUser.hxx | 76 | ||||
-rw-r--r-- | connectivity/source/inc/mysql/YViews.hxx | 40 |
6 files changed, 223 insertions, 223 deletions
diff --git a/connectivity/source/inc/mysql/YCatalog.hxx b/connectivity/source/inc/mysql/YCatalog.hxx index 5eb348af997d..f8d6156f480a 100644 --- a/connectivity/source/inc/mysql/YCatalog.hxx +++ b/connectivity/source/inc/mysql/YCatalog.hxx @@ -21,39 +21,39 @@ #include <sdbcx/VCatalog.hxx> namespace connectivity::mysql +{ + // please don't name the class the same name as in another namespaces + // some compilers have problems with this task as I noticed on windows + class OMySQLCatalog : public connectivity::sdbcx::OCatalog { - // please don't name the class the same name as in another namespaces - // some compilers have problems with this task as I noticed on windows - class OMySQLCatalog : public connectivity::sdbcx::OCatalog - { - css::uno::Reference< css::sdbc::XConnection > m_xConnection; - - /** calls XDatabaseMetaData::getTables. - @param _sKindOfObject - The type of tables to be fetched. - @param _rNames - The container for the names to be filled. <OUT/> - */ - void refreshObjects(const css::uno::Sequence< OUString >& _sKindOfObject,::std::vector< OUString>& _rNames); - - public: - // implementation of the pure virtual methods - virtual void refreshTables() override; - virtual void refreshViews() override ; - virtual void refreshGroups() override; - virtual void refreshUsers() override ; - - public: - OMySQLCatalog(const css::uno::Reference< css::sdbc::XConnection >& _xConnection); - - sdbcx::OCollection* getPrivateTables() const { return m_pTables.get();} - sdbcx::OCollection* getPrivateViews() const { return m_pViews.get(); } - const css::uno::Reference< css::sdbc::XConnection >& getConnection() const { return m_xConnection; } - - virtual css::uno::Any SAL_CALL queryInterface( const css::uno::Type & rType ) override; - // ::cppu::OComponentHelper - virtual css::uno::Sequence< css::uno::Type > SAL_CALL getTypes( ) override; - }; + css::uno::Reference< css::sdbc::XConnection > m_xConnection; + + /** calls XDatabaseMetaData::getTables. + @param _sKindOfObject + The type of tables to be fetched. + @param _rNames + The container for the names to be filled. <OUT/> + */ + void refreshObjects(const css::uno::Sequence< OUString >& _sKindOfObject,::std::vector< OUString>& _rNames); + + public: + // implementation of the pure virtual methods + virtual void refreshTables() override; + virtual void refreshViews() override ; + virtual void refreshGroups() override; + virtual void refreshUsers() override ; + + public: + OMySQLCatalog(const css::uno::Reference< css::sdbc::XConnection >& _xConnection); + + sdbcx::OCollection* getPrivateTables() const { return m_pTables.get();} + sdbcx::OCollection* getPrivateViews() const { return m_pViews.get(); } + const css::uno::Reference< css::sdbc::XConnection >& getConnection() const { return m_xConnection; } + + virtual css::uno::Any SAL_CALL queryInterface( const css::uno::Type & rType ) override; + // ::cppu::OComponentHelper + virtual css::uno::Sequence< css::uno::Type > SAL_CALL getTypes( ) override; + }; } diff --git a/connectivity/source/inc/mysql/YColumns.hxx b/connectivity/source/inc/mysql/YColumns.hxx index 1ffcfc95338b..88102c2fb864 100644 --- a/connectivity/source/inc/mysql/YColumns.hxx +++ b/connectivity/source/inc/mysql/YColumns.hxx @@ -21,35 +21,35 @@ #include <connectivity/sdbcx/VColumn.hxx> namespace connectivity::mysql +{ + class OMySQLColumns : public OColumnsHelper { - class OMySQLColumns : public OColumnsHelper - { - protected: - virtual css::uno::Reference< css::beans::XPropertySet > createDescriptor() override; - public: - OMySQLColumns( ::cppu::OWeakObject& _rParent - ,::osl::Mutex& _rMutex - ,const ::std::vector< OUString> &_rVector - ); - }; + protected: + virtual css::uno::Reference< css::beans::XPropertySet > createDescriptor() override; + public: + OMySQLColumns( ::cppu::OWeakObject& _rParent + ,::osl::Mutex& _rMutex + ,const ::std::vector< OUString> &_rVector + ); + }; - class OMySQLColumn; - typedef ::comphelper::OIdPropertyArrayUsageHelper<OMySQLColumn> OMySQLColumn_PROP; + class OMySQLColumn; + typedef ::comphelper::OIdPropertyArrayUsageHelper<OMySQLColumn> OMySQLColumn_PROP; - class OMySQLColumn : public sdbcx::OColumn, - public OMySQLColumn_PROP - { - OUString m_sAutoIncrement; - protected: - virtual ::cppu::IPropertyArrayHelper* createArrayHelper( sal_Int32 _nId) const override; - virtual ::cppu::IPropertyArrayHelper & SAL_CALL getInfoHelper() override; + class OMySQLColumn : public sdbcx::OColumn, + public OMySQLColumn_PROP + { + OUString m_sAutoIncrement; + protected: + virtual ::cppu::IPropertyArrayHelper* createArrayHelper( sal_Int32 _nId) const override; + virtual ::cppu::IPropertyArrayHelper & SAL_CALL getInfoHelper() override; - public: - OMySQLColumn(); - virtual void construct() override; + public: + OMySQLColumn(); + virtual void construct() override; - virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames( ) override; - }; + virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames( ) override; + }; } diff --git a/connectivity/source/inc/mysql/YTable.hxx b/connectivity/source/inc/mysql/YTable.hxx index c891b7d7d95e..7e01a085423f 100644 --- a/connectivity/source/inc/mysql/YTable.hxx +++ b/connectivity/source/inc/mysql/YTable.hxx @@ -27,85 +27,85 @@ #include <comphelper/IdPropArrayHelper.hxx> namespace connectivity::mysql - { - - class OMySQLTable; - typedef ::comphelper::OIdPropertyArrayUsageHelper< OMySQLTable > OMySQLTable_PROP; - class OMySQLTable : public OTableHelper - ,public OMySQLTable_PROP - { - sal_Int32 m_nPrivileges; // we have to set our privileges by our own - - /** executes the statement. - @param _rStatement - The statement to execute. - */ - void executeStatement(const OUString& _rStatement ); - protected: - - /** creates the column collection for the table - @param _rNames - The column names. - */ - virtual sdbcx::OCollection* createColumns(const ::std::vector< OUString>& _rNames) override; - - /** creates the key collection for the table - @param _rNames - The key names. - */ - virtual sdbcx::OCollection* createKeys(const ::std::vector< OUString>& _rNames) override; - - /** creates the index collection for the table - @param _rNames - The index names. - */ - virtual sdbcx::OCollection* createIndexes(const ::std::vector< OUString>& _rNames) override; +{ - /** Returns always "RENAME TABLE " even for views. - * - * \return The start of the rename statement. - * @see http://dev.mysql.com/doc/refman/5.1/de/rename-table.html - */ - virtual OUString getRenameStart() const override; + class OMySQLTable; + typedef ::comphelper::OIdPropertyArrayUsageHelper< OMySQLTable > OMySQLTable_PROP; + class OMySQLTable : public OTableHelper + ,public OMySQLTable_PROP + { + sal_Int32 m_nPrivileges; // we have to set our privileges by our own - /** used to implement the creation of the array helper which is shared amongst all instances of the class. - This method needs to be implemented in derived classes. - <BR> - The method gets called with s_aMutex acquired. - @return a pointer to the newly created array helper. Must not be NULL. + /** executes the statement. + @param _rStatement + The statement to execute. */ - virtual ::cppu::IPropertyArrayHelper* createArrayHelper(sal_Int32 nId) const override; - virtual ::cppu::IPropertyArrayHelper & SAL_CALL getInfoHelper() override; - - public: - OMySQLTable( sdbcx::OCollection* _pTables, - const css::uno::Reference< css::sdbc::XConnection >& _xConnection); - OMySQLTable( sdbcx::OCollection* _pTables, - const css::uno::Reference< css::sdbc::XConnection >& _xConnection, - const OUString& Name, - const OUString& Type, - const OUString& Description, - const OUString& SchemaName, - const OUString& CatalogName, - sal_Int32 _nPrivileges - ); - - // ODescriptor - virtual void construct() override; - - // XAlterTable - virtual void SAL_CALL alterColumnByName( const OUString& colName, const css::uno::Reference< css::beans::XPropertySet >& descriptor ) override; - /** returns the ALTER TABLE XXX statement - */ - OUString getAlterTableColumnPart() const; - - // some methods to alter table structures - void alterColumnType(sal_Int32 nNewType,const OUString& _rColName,const css::uno::Reference< css::beans::XPropertySet >& _xDescriptor); - void alterDefaultValue(std::u16string_view _sNewDefault,const OUString& _rColName); - void dropDefaultValue(const OUString& _sNewDefault); - - virtual OUString getTypeCreatePattern() const override; - }; + void executeStatement(const OUString& _rStatement ); + protected: + + /** creates the column collection for the table + @param _rNames + The column names. + */ + virtual sdbcx::OCollection* createColumns(const ::std::vector< OUString>& _rNames) override; + + /** creates the key collection for the table + @param _rNames + The key names. + */ + virtual sdbcx::OCollection* createKeys(const ::std::vector< OUString>& _rNames) override; + + /** creates the index collection for the table + @param _rNames + The index names. + */ + virtual sdbcx::OCollection* createIndexes(const ::std::vector< OUString>& _rNames) override; + + /** Returns always "RENAME TABLE " even for views. + * + * \return The start of the rename statement. + * @see http://dev.mysql.com/doc/refman/5.1/de/rename-table.html + */ + virtual OUString getRenameStart() const override; + + /** used to implement the creation of the array helper which is shared amongst all instances of the class. + This method needs to be implemented in derived classes. + <BR> + The method gets called with s_aMutex acquired. + @return a pointer to the newly created array helper. Must not be NULL. + */ + virtual ::cppu::IPropertyArrayHelper* createArrayHelper(sal_Int32 nId) const override; + virtual ::cppu::IPropertyArrayHelper & SAL_CALL getInfoHelper() override; + + public: + OMySQLTable( sdbcx::OCollection* _pTables, + const css::uno::Reference< css::sdbc::XConnection >& _xConnection); + OMySQLTable( sdbcx::OCollection* _pTables, + const css::uno::Reference< css::sdbc::XConnection >& _xConnection, + const OUString& Name, + const OUString& Type, + const OUString& Description, + const OUString& SchemaName, + const OUString& CatalogName, + sal_Int32 _nPrivileges + ); + + // ODescriptor + virtual void construct() override; + + // XAlterTable + virtual void SAL_CALL alterColumnByName( const OUString& colName, const css::uno::Reference< css::beans::XPropertySet >& descriptor ) override; + /** returns the ALTER TABLE XXX statement + */ + OUString getAlterTableColumnPart() const; + + // some methods to alter table structures + void alterColumnType(sal_Int32 nNewType,const OUString& _rColName,const css::uno::Reference< css::beans::XPropertySet >& _xDescriptor); + void alterDefaultValue(std::u16string_view _sNewDefault,const OUString& _rColName); + void dropDefaultValue(const OUString& _sNewDefault); + + virtual OUString getTypeCreatePattern() const override; + }; } diff --git a/connectivity/source/inc/mysql/YTables.hxx b/connectivity/source/inc/mysql/YTables.hxx index af1d145e9595..8aaa5c8d80bb 100644 --- a/connectivity/source/inc/mysql/YTables.hxx +++ b/connectivity/source/inc/mysql/YTables.hxx @@ -23,40 +23,40 @@ #include <com/sun/star/sdbc/XDatabaseMetaData.hpp> #include <utility> namespace connectivity::mysql +{ + class OTables final : public sdbcx::OCollection, + public ::dbtools::ISQLStatementHelper { - class OTables final : public sdbcx::OCollection, - public ::dbtools::ISQLStatementHelper - { - css::uno::Reference< css::sdbc::XDatabaseMetaData > m_xMetaData; - - virtual css::uno::Reference< css::beans::XPropertySet > createObject(const OUString& _rName) override; - virtual void impl_refresh() override; - virtual css::uno::Reference< css::beans::XPropertySet > createDescriptor() override; - virtual css::uno::Reference< css::beans::XPropertySet > appendObject( const OUString& _rForName, const css::uno::Reference< css::beans::XPropertySet >& descriptor ) override; - virtual void dropObject(sal_Int32 _nPos, const OUString& _sElementName) override; - - void createTable( const css::uno::Reference< css::beans::XPropertySet >& descriptor ); - virtual OUString getNameForObject(const css::uno::Reference< css::beans::XPropertySet >& _xObject) override; - public: - OTables(css::uno::Reference< css::sdbc::XDatabaseMetaData > _xMetaData, ::cppu::OWeakObject& _rParent, ::osl::Mutex& _rMutex, - const ::std::vector< OUString> &_rVector) : sdbcx::OCollection(_rParent, true, _rMutex, _rVector) - ,m_xMetaData(std::move(_xMetaData)) - {} - - // only the name is identical to ::cppu::OComponentHelper - virtual void disposing() override; - - // XDrop - void appendNew(const OUString& _rsNewTable); - - /** convert the sql statement to fit MySQL notation - @param _sSql in/out - */ - static OUString adjustSQL(const OUString& _sSql); - - // ISQLStatementHelper - virtual void addComment(const css::uno::Reference< css::beans::XPropertySet >& descriptor,OUStringBuffer& _rOut) override; - }; + css::uno::Reference< css::sdbc::XDatabaseMetaData > m_xMetaData; + + virtual css::uno::Reference< css::beans::XPropertySet > createObject(const OUString& _rName) override; + virtual void impl_refresh() override; + virtual css::uno::Reference< css::beans::XPropertySet > createDescriptor() override; + virtual css::uno::Reference< css::beans::XPropertySet > appendObject( const OUString& _rForName, const css::uno::Reference< css::beans::XPropertySet >& descriptor ) override; + virtual void dropObject(sal_Int32 _nPos, const OUString& _sElementName) override; + + void createTable( const css::uno::Reference< css::beans::XPropertySet >& descriptor ); + virtual OUString getNameForObject(const css::uno::Reference< css::beans::XPropertySet >& _xObject) override; + public: + OTables(css::uno::Reference< css::sdbc::XDatabaseMetaData > _xMetaData, ::cppu::OWeakObject& _rParent, ::osl::Mutex& _rMutex, + const ::std::vector< OUString> &_rVector) : sdbcx::OCollection(_rParent, true, _rMutex, _rVector) + ,m_xMetaData(std::move(_xMetaData)) + {} + + // only the name is identical to ::cppu::OComponentHelper + virtual void disposing() override; + + // XDrop + void appendNew(const OUString& _rsNewTable); + + /** convert the sql statement to fit MySQL notation + @param _sSql in/out + */ + static OUString adjustSQL(const OUString& _sSql); + + // ISQLStatementHelper + virtual void addComment(const css::uno::Reference< css::beans::XPropertySet >& descriptor,OUStringBuffer& _rOut) override; + }; } diff --git a/connectivity/source/inc/mysql/YUser.hxx b/connectivity/source/inc/mysql/YUser.hxx index 1713f63bfb64..739cf6f75e0a 100644 --- a/connectivity/source/inc/mysql/YUser.hxx +++ b/connectivity/source/inc/mysql/YUser.hxx @@ -23,50 +23,50 @@ #include <com/sun/star/sdbc/XConnection.hpp> namespace connectivity::mysql - { - typedef connectivity::sdbcx::OUser OUser_TYPEDEF; +{ + typedef connectivity::sdbcx::OUser OUser_TYPEDEF; - class OMySQLUser : public OUser_TYPEDEF - { - css::uno::Reference< css::sdbc::XConnection > m_xConnection; + class OMySQLUser : public OUser_TYPEDEF + { + css::uno::Reference< css::sdbc::XConnection > m_xConnection; - static OUString getPrivilegeString(sal_Int32 nRights); - // return the privileges and additional the grant rights - /// @throws css::sdbc::SQLException - /// @throws css::uno::RuntimeException - void findPrivilegesAndGrantPrivileges(const OUString& objName, sal_Int32 objType,sal_Int32& nRights,sal_Int32& nRightsWithGrant); - public: - virtual void refreshGroups() override; - public: - OMySQLUser( css::uno::Reference< css::sdbc::XConnection > _xConnection); - OMySQLUser( css::uno::Reference< css::sdbc::XConnection > _xConnection, const OUString& Name); + static OUString getPrivilegeString(sal_Int32 nRights); + // return the privileges and additional the grant rights + /// @throws css::sdbc::SQLException + /// @throws css::uno::RuntimeException + void findPrivilegesAndGrantPrivileges(const OUString& objName, sal_Int32 objType,sal_Int32& nRights,sal_Int32& nRightsWithGrant); + public: + virtual void refreshGroups() override; + public: + OMySQLUser( css::uno::Reference< css::sdbc::XConnection > _xConnection); + OMySQLUser( css::uno::Reference< css::sdbc::XConnection > _xConnection, const OUString& Name); - // XUser - virtual void SAL_CALL changePassword( const OUString& objPassword, const OUString& newPassword ) override; - // XAuthorizable - virtual sal_Int32 SAL_CALL getPrivileges( const OUString& objName, sal_Int32 objType ) override; - virtual sal_Int32 SAL_CALL getGrantablePrivileges( const OUString& objName, sal_Int32 objType ) override; - virtual void SAL_CALL grantPrivileges( const OUString& objName, sal_Int32 objType, sal_Int32 objPrivileges ) override; - virtual void SAL_CALL revokePrivileges( const OUString& objName, sal_Int32 objType, sal_Int32 objPrivileges ) override; - }; + // XUser + virtual void SAL_CALL changePassword( const OUString& objPassword, const OUString& newPassword ) override; + // XAuthorizable + virtual sal_Int32 SAL_CALL getPrivileges( const OUString& objName, sal_Int32 objType ) override; + virtual sal_Int32 SAL_CALL getGrantablePrivileges( const OUString& objName, sal_Int32 objType ) override; + virtual void SAL_CALL grantPrivileges( const OUString& objName, sal_Int32 objType, sal_Int32 objPrivileges ) override; + virtual void SAL_CALL revokePrivileges( const OUString& objName, sal_Int32 objType, sal_Int32 objPrivileges ) override; + }; - class OUserExtend; - typedef ::comphelper::OPropertyArrayUsageHelper<OUserExtend> OUserExtend_PROP; + class OUserExtend; + typedef ::comphelper::OPropertyArrayUsageHelper<OUserExtend> OUserExtend_PROP; - class OUserExtend : public OMySQLUser, - public OUserExtend_PROP - { - OUString m_Password; - protected: - // OPropertyArrayUsageHelper - virtual ::cppu::IPropertyArrayHelper* createArrayHelper() const override; - // OPropertySetHelper - virtual ::cppu::IPropertyArrayHelper & SAL_CALL getInfoHelper() override; - public: - OUserExtend(const css::uno::Reference< css::sdbc::XConnection >& _xConnection); + class OUserExtend : public OMySQLUser, + public OUserExtend_PROP + { + OUString m_Password; + protected: + // OPropertyArrayUsageHelper + virtual ::cppu::IPropertyArrayHelper* createArrayHelper() const override; + // OPropertySetHelper + virtual ::cppu::IPropertyArrayHelper & SAL_CALL getInfoHelper() override; + public: + OUserExtend(const css::uno::Reference< css::sdbc::XConnection >& _xConnection); - virtual void construct() override; - }; + virtual void construct() override; + }; } diff --git a/connectivity/source/inc/mysql/YViews.hxx b/connectivity/source/inc/mysql/YViews.hxx index e1ea94d2d6c2..551b1358dd2d 100644 --- a/connectivity/source/inc/mysql/YViews.hxx +++ b/connectivity/source/inc/mysql/YViews.hxx @@ -22,30 +22,30 @@ #include <com/sun/star/sdbc/XDatabaseMetaData.hpp> #include <utility> namespace connectivity::mysql +{ + class OViews final : public sdbcx::OCollection { - class OViews final : public sdbcx::OCollection - { - css::uno::Reference< css::sdbc::XDatabaseMetaData > m_xMetaData; - bool m_bInDrop; - virtual css::uno::Reference< css::beans::XPropertySet > createObject(const OUString& _rName) override; - virtual void impl_refresh() override; - virtual css::uno::Reference< css::beans::XPropertySet > createDescriptor() override; - virtual css::uno::Reference< css::beans::XPropertySet > appendObject( const OUString& _rForName, const css::uno::Reference< css::beans::XPropertySet >& descriptor ) override; - virtual void dropObject(sal_Int32 _nPos, const OUString& _sElementName) override; + css::uno::Reference< css::sdbc::XDatabaseMetaData > m_xMetaData; + bool m_bInDrop; + virtual css::uno::Reference< css::beans::XPropertySet > createObject(const OUString& _rName) override; + virtual void impl_refresh() override; + virtual css::uno::Reference< css::beans::XPropertySet > createDescriptor() override; + virtual css::uno::Reference< css::beans::XPropertySet > appendObject( const OUString& _rForName, const css::uno::Reference< css::beans::XPropertySet >& descriptor ) override; + virtual void dropObject(sal_Int32 _nPos, const OUString& _sElementName) override; - void createView( const css::uno::Reference< css::beans::XPropertySet >& descriptor ); - public: - OViews(css::uno::Reference< css::sdbc::XDatabaseMetaData > _xMetaData, ::cppu::OWeakObject& _rParent, ::osl::Mutex& _rMutex, - const ::std::vector< OUString> &_rVector) : sdbcx::OCollection(_rParent, true, _rMutex, _rVector) - ,m_xMetaData(std::move(_xMetaData)) - ,m_bInDrop(false) - {} + void createView( const css::uno::Reference< css::beans::XPropertySet >& descriptor ); + public: + OViews(css::uno::Reference< css::sdbc::XDatabaseMetaData > _xMetaData, ::cppu::OWeakObject& _rParent, ::osl::Mutex& _rMutex, + const ::std::vector< OUString> &_rVector) : sdbcx::OCollection(_rParent, true, _rMutex, _rVector) + ,m_xMetaData(std::move(_xMetaData)) + ,m_bInDrop(false) + {} - // only the name is identical to ::cppu::OComponentHelper - virtual void disposing() override; + // only the name is identical to ::cppu::OComponentHelper + virtual void disposing() override; - void dropByNameImpl(const OUString& elementName); - }; + void dropByNameImpl(const OUString& elementName); + }; } |