diff options
Diffstat (limited to 'connectivity/source/inc/hsqldb')
-rw-r--r-- | connectivity/source/inc/hsqldb/HCatalog.hxx | 64 | ||||
-rw-r--r-- | connectivity/source/inc/hsqldb/HColumns.hxx | 48 | ||||
-rw-r--r-- | connectivity/source/inc/hsqldb/HConnection.hxx | 194 | ||||
-rw-r--r-- | connectivity/source/inc/hsqldb/HDriver.hxx | 166 | ||||
-rw-r--r-- | connectivity/source/inc/hsqldb/HStorageMap.hxx | 94 | ||||
-rw-r--r-- | connectivity/source/inc/hsqldb/HTable.hxx | 152 | ||||
-rw-r--r-- | connectivity/source/inc/hsqldb/HTables.hxx | 40 | ||||
-rw-r--r-- | connectivity/source/inc/hsqldb/HUser.hxx | 76 | ||||
-rw-r--r-- | connectivity/source/inc/hsqldb/HViews.hxx | 38 |
9 files changed, 436 insertions, 436 deletions
diff --git a/connectivity/source/inc/hsqldb/HCatalog.hxx b/connectivity/source/inc/hsqldb/HCatalog.hxx index 8d1da42de111..efd397e3da43 100644 --- a/connectivity/source/inc/hsqldb/HCatalog.hxx +++ b/connectivity/source/inc/hsqldb/HCatalog.hxx @@ -21,39 +21,39 @@ #include <sdbcx/VCatalog.hxx> namespace connectivity::hsqldb +{ + // 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 OHCatalog : 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 OHCatalog : 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. - */ - 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: - OHCatalog(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. + */ + 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: + OHCatalog(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/hsqldb/HColumns.hxx b/connectivity/source/inc/hsqldb/HColumns.hxx index c27645f45891..2dd8881d04d1 100644 --- a/connectivity/source/inc/hsqldb/HColumns.hxx +++ b/connectivity/source/inc/hsqldb/HColumns.hxx @@ -21,35 +21,35 @@ #include <connectivity/sdbcx/VColumn.hxx> namespace connectivity::hsqldb +{ + class OHSQLColumns : public OColumnsHelper { - class OHSQLColumns : public OColumnsHelper - { - protected: - virtual css::uno::Reference< css::beans::XPropertySet > createDescriptor() override; - public: - OHSQLColumns( ::cppu::OWeakObject& _rParent - ,::osl::Mutex& _rMutex - ,const ::std::vector< OUString> &_rVector - ); - }; + protected: + virtual css::uno::Reference< css::beans::XPropertySet > createDescriptor() override; + public: + OHSQLColumns( ::cppu::OWeakObject& _rParent + ,::osl::Mutex& _rMutex + ,const ::std::vector< OUString> &_rVector + ); + }; - class OHSQLColumn; - typedef ::comphelper::OIdPropertyArrayUsageHelper<OHSQLColumn> OHSQLColumn_PROP; + class OHSQLColumn; + typedef ::comphelper::OIdPropertyArrayUsageHelper<OHSQLColumn> OHSQLColumn_PROP; - class OHSQLColumn : public sdbcx::OColumn, - public OHSQLColumn_PROP - { - OUString m_sAutoIncrement; - protected: - virtual ::cppu::IPropertyArrayHelper* createArrayHelper( sal_Int32 _nId) const override; - virtual ::cppu::IPropertyArrayHelper & SAL_CALL getInfoHelper() override; + class OHSQLColumn : public sdbcx::OColumn, + public OHSQLColumn_PROP + { + OUString m_sAutoIncrement; + protected: + virtual ::cppu::IPropertyArrayHelper* createArrayHelper( sal_Int32 _nId) const override; + virtual ::cppu::IPropertyArrayHelper & SAL_CALL getInfoHelper() override; - public: - OHSQLColumn(); - virtual void construct() override; + public: + OHSQLColumn(); + 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/hsqldb/HConnection.hxx b/connectivity/source/inc/hsqldb/HConnection.hxx index f319287774ef..29763b433ccf 100644 --- a/connectivity/source/inc/hsqldb/HConnection.hxx +++ b/connectivity/source/inc/hsqldb/HConnection.hxx @@ -29,110 +29,110 @@ #include <comphelper/interfacecontainer2.hxx> namespace connectivity::hsqldb +{ + class SAL_NO_VTABLE IMethodGuardAccess { - class SAL_NO_VTABLE IMethodGuardAccess - { - public: - virtual ::osl::Mutex& getMutex() const = 0; - virtual void checkDisposed() const = 0; + public: + virtual ::osl::Mutex& getMutex() const = 0; + virtual void checkDisposed() const = 0; - protected: - ~IMethodGuardAccess() {} - }; + protected: + ~IMethodGuardAccess() {} + }; - // OHsqlConnection - wraps all methods to the real connection from the driver - // but when disposed it doesn't dispose the real connection + // OHsqlConnection - wraps all methods to the real connection from the driver + // but when disposed it doesn't dispose the real connection - typedef ::cppu::ImplInheritanceHelper< OConnectionWrapper - , css::util::XFlushable - , css::sdb::application::XTableUIProvider - > OHsqlConnection_BASE; + typedef ::cppu::ImplInheritanceHelper< OConnectionWrapper + , css::util::XFlushable + , css::sdb::application::XTableUIProvider + > OHsqlConnection_BASE; - class OHsqlConnection :public OHsqlConnection_BASE - ,public IMethodGuardAccess - { - private: - ::comphelper::OInterfaceContainerHelper2 m_aFlushListeners; - css::uno::Reference< css::sdbc::XDriver > m_xDriver; - css::uno::Reference< css::uno::XComponentContext > m_xContext; - bool m_bIni; - bool m_bReadOnly; - - protected: - virtual void SAL_CALL disposing() override; - virtual ~OHsqlConnection() override; - - public: - OHsqlConnection( - const css::uno::Reference< css::sdbc::XDriver >& _rxDriver, - const css::uno::Reference< css::sdbc::XConnection >& _xConnection, - const css::uno::Reference< css::uno::XComponentContext>& _rxContext - ); - - // XServiceInfo - DECLARE_SERVICE_INFO(); - - // IMethodGuardAccess - virtual ::osl::Mutex& getMutex() const override; - virtual void checkDisposed() const override; - - // XFlushable - virtual void SAL_CALL flush( ) override; - virtual void SAL_CALL addFlushListener( const css::uno::Reference< css::util::XFlushListener >& l ) override; - virtual void SAL_CALL removeFlushListener( const css::uno::Reference< css::util::XFlushListener >& l ) override; - - // XTableUIProvider - virtual css::uno::Reference< css::graphic::XGraphic > SAL_CALL getTableIcon( const OUString& TableName, ::sal_Int32 ColorMode ) override; - virtual css::uno::Reference< css::uno::XInterface > SAL_CALL getTableEditor( const css::uno::Reference< css::sdb::application::XDatabaseDocumentUI >& DocumentUI, const OUString& TableName ) override; - - private: - - /** retrieves our table container - @return - our table container. Guaranteed to not be <NULL/>. - @throws css::lang::WrappedTargetException - if a non-RuntimeException is caught during obtaining the container. - @throws css::uno::RuntimeException - if a serious error occurs - @precond - We're not disposed. - */ - css::uno::Reference< css::container::XNameAccess > - impl_getTableContainer_throw(); - - /** checks whether the given table name denotes an existing table - @param _rTableName - the fully name of the table to check for existence - @throws css::lang::IllegalArgumentException - if the name does not denote an existing table - @precond - We're not disposed. - */ - void impl_checkExistingTable_throw( const OUString& _rTableName ); - - /** checks whether the given table name refers to a HSQL TEXT TABLE - */ - bool impl_isTextTable_nothrow( const OUString& _rTableName ); - - /** retrieves the icon for HSQL TEXT TABLEs - */ - css::uno::Reference< css::graphic::XGraphic > - impl_getTextTableIcon_nothrow(); - }; - - - // OHsqlConnection - - class MethodGuard : public ::osl::MutexGuard + class OHsqlConnection :public OHsqlConnection_BASE + ,public IMethodGuardAccess + { + private: + ::comphelper::OInterfaceContainerHelper2 m_aFlushListeners; + css::uno::Reference< css::sdbc::XDriver > m_xDriver; + css::uno::Reference< css::uno::XComponentContext > m_xContext; + bool m_bIni; + bool m_bReadOnly; + + protected: + virtual void SAL_CALL disposing() override; + virtual ~OHsqlConnection() override; + + public: + OHsqlConnection( + const css::uno::Reference< css::sdbc::XDriver >& _rxDriver, + const css::uno::Reference< css::sdbc::XConnection >& _xConnection, + const css::uno::Reference< css::uno::XComponentContext>& _rxContext + ); + + // XServiceInfo + DECLARE_SERVICE_INFO(); + + // IMethodGuardAccess + virtual ::osl::Mutex& getMutex() const override; + virtual void checkDisposed() const override; + + // XFlushable + virtual void SAL_CALL flush( ) override; + virtual void SAL_CALL addFlushListener( const css::uno::Reference< css::util::XFlushListener >& l ) override; + virtual void SAL_CALL removeFlushListener( const css::uno::Reference< css::util::XFlushListener >& l ) override; + + // XTableUIProvider + virtual css::uno::Reference< css::graphic::XGraphic > SAL_CALL getTableIcon( const OUString& TableName, ::sal_Int32 ColorMode ) override; + virtual css::uno::Reference< css::uno::XInterface > SAL_CALL getTableEditor( const css::uno::Reference< css::sdb::application::XDatabaseDocumentUI >& DocumentUI, const OUString& TableName ) override; + + private: + + /** retrieves our table container + @return + our table container. Guaranteed to not be <NULL/>. + @throws css::lang::WrappedTargetException + if a non-RuntimeException is caught during obtaining the container. + @throws css::uno::RuntimeException + if a serious error occurs + @precond + We're not disposed. + */ + css::uno::Reference< css::container::XNameAccess > + impl_getTableContainer_throw(); + + /** checks whether the given table name denotes an existing table + @param _rTableName + the fully name of the table to check for existence + @throws css::lang::IllegalArgumentException + if the name does not denote an existing table + @precond + We're not disposed. + */ + void impl_checkExistingTable_throw( const OUString& _rTableName ); + + /** checks whether the given table name refers to a HSQL TEXT TABLE + */ + bool impl_isTextTable_nothrow( const OUString& _rTableName ); + + /** retrieves the icon for HSQL TEXT TABLEs + */ + css::uno::Reference< css::graphic::XGraphic > + impl_getTextTableIcon_nothrow(); + }; + + + // OHsqlConnection + + class MethodGuard : public ::osl::MutexGuard + { + public: + MethodGuard( const IMethodGuardAccess& _rComponent ) + : ::osl::MutexGuard( _rComponent.getMutex() ) { - public: - MethodGuard( const IMethodGuardAccess& _rComponent ) - : ::osl::MutexGuard( _rComponent.getMutex() ) - { - _rComponent.checkDisposed(); - } - }; + _rComponent.checkDisposed(); + } + }; } diff --git a/connectivity/source/inc/hsqldb/HDriver.hxx b/connectivity/source/inc/hsqldb/HDriver.hxx index 8ea41aaa12d6..7b4735517fd5 100644 --- a/connectivity/source/inc/hsqldb/HDriver.hxx +++ b/connectivity/source/inc/hsqldb/HDriver.hxx @@ -31,96 +31,96 @@ namespace connectivity::hsqldb +{ + class OHCatalog; + + typedef ::cppu::WeakComponentImplHelper< css::sdbc::XDriver + , css::sdbcx::XDataDefinitionSupplier + , css::lang::XServiceInfo + , css::sdbcx::XCreateCatalog + , css::embed::XTransactionListener + > ODriverDelegator_BASE; + + struct TConnectionInfo { - class OHCatalog; + css::uno::WeakReference<css::sdbc::XConnection> xOrigConn; + OUString sKey; + css::uno::WeakReference<css::sdbc::XConnection> xConn; + unotools::WeakReference<OHCatalog> xCatalog; + }; - typedef ::cppu::WeakComponentImplHelper< css::sdbc::XDriver - , css::sdbcx::XDataDefinitionSupplier - , css::lang::XServiceInfo - , css::sdbcx::XCreateCatalog - , css::embed::XTransactionListener - > ODriverDelegator_BASE; - struct TConnectionInfo - { - css::uno::WeakReference<css::sdbc::XConnection> xOrigConn; - OUString sKey; - css::uno::WeakReference<css::sdbc::XConnection> xConn; - unotools::WeakReference<OHCatalog> xCatalog; - }; + /** delegates all calls to the original driver and extend the existing one with the SDBCX layer. + */ + class ODriverDelegator final : public ::cppu::BaseMutex + ,public ODriverDelegator_BASE + { + std::vector<TConnectionInfo> m_aConnections; // vector containing a list + // of all the Connection objects + // for this Driver + css::uno::Reference< css::sdbc::XDriver > m_xDriver; + css::uno::Reference< css::uno::XComponentContext > m_xContext; + bool m_bInShutDownConnections; + + /** load the driver we want to delegate. + The <member>m_xDriver</member> may be <NULL/> if the driver could not be loaded. + @return + The driver which was currently selected. + */ + css::uno::Reference< css::sdbc::XDriver > const & loadDriver( ); - /** delegates all calls to the original driver and extend the existing one with the SDBCX layer. + /** shut down the connection and revoke the storage from the map + @param _aIter + The connection to shut down and storage to revoke. + */ + void shutdownConnection(const std::vector<TConnectionInfo>::iterator& _aIter); + public: + /** creates a new delegator for a HSQLDB driver + */ + ODriverDelegator(const css::uno::Reference< css::uno::XComponentContext >& _rxContext); + + // XServiceInfo + DECLARE_SERVICE_INFO(); + + // XDriver + virtual css::uno::Reference< css::sdbc::XConnection > SAL_CALL connect( const OUString& url, const css::uno::Sequence< css::beans::PropertyValue >& info ) override; + virtual sal_Bool SAL_CALL acceptsURL( const OUString& url ) override; + virtual css::uno::Sequence< css::sdbc::DriverPropertyInfo > SAL_CALL getPropertyInfo( const OUString& url, const css::uno::Sequence< css::beans::PropertyValue >& info ) override; + virtual sal_Int32 SAL_CALL getMajorVersion( ) override; + virtual sal_Int32 SAL_CALL getMinorVersion( ) override; + + // XDataDefinitionSupplier + virtual css::uno::Reference< css::sdbcx::XTablesSupplier > SAL_CALL getDataDefinitionByConnection( const css::uno::Reference< css::sdbc::XConnection >& connection ) override; + virtual css::uno::Reference< css::sdbcx::XTablesSupplier > SAL_CALL getDataDefinitionByURL( const OUString& url, const css::uno::Sequence< css::beans::PropertyValue >& info ) override; + + // XCreateCatalog + virtual void SAL_CALL createCatalog( const css::uno::Sequence< css::beans::PropertyValue >& info ) override; + + // XEventListener + virtual void SAL_CALL disposing( const css::lang::EventObject& Source ) override; + + // XTransactionListener + virtual void SAL_CALL preCommit( const css::lang::EventObject& aEvent ) override; + virtual void SAL_CALL commited( const css::lang::EventObject& aEvent ) override; + virtual void SAL_CALL preRevert( const css::lang::EventObject& aEvent ) override; + virtual void SAL_CALL reverted( const css::lang::EventObject& aEvent ) override; + + void shutdownConnections(); + void flushConnections(); + private: + /// dtor + virtual ~ODriverDelegator() override; + // OComponentHelper + virtual void SAL_CALL disposing() override; + + /** called when we connected to a newly created embedded database */ - class ODriverDelegator final : public ::cppu::BaseMutex - ,public ODriverDelegator_BASE - { - std::vector<TConnectionInfo> m_aConnections; // vector containing a list - // of all the Connection objects - // for this Driver - css::uno::Reference< css::sdbc::XDriver > m_xDriver; - css::uno::Reference< css::uno::XComponentContext > m_xContext; - bool m_bInShutDownConnections; - - /** load the driver we want to delegate. - The <member>m_xDriver</member> may be <NULL/> if the driver could not be loaded. - @return - The driver which was currently selected. - */ - css::uno::Reference< css::sdbc::XDriver > const & loadDriver( ); - - /** shut down the connection and revoke the storage from the map - @param _aIter - The connection to shut down and storage to revoke. - */ - void shutdownConnection(const std::vector<TConnectionInfo>::iterator& _aIter); - - public: - /** creates a new delegator for a HSQLDB driver - */ - ODriverDelegator(const css::uno::Reference< css::uno::XComponentContext >& _rxContext); - - // XServiceInfo - DECLARE_SERVICE_INFO(); - - // XDriver - virtual css::uno::Reference< css::sdbc::XConnection > SAL_CALL connect( const OUString& url, const css::uno::Sequence< css::beans::PropertyValue >& info ) override; - virtual sal_Bool SAL_CALL acceptsURL( const OUString& url ) override; - virtual css::uno::Sequence< css::sdbc::DriverPropertyInfo > SAL_CALL getPropertyInfo( const OUString& url, const css::uno::Sequence< css::beans::PropertyValue >& info ) override; - virtual sal_Int32 SAL_CALL getMajorVersion( ) override; - virtual sal_Int32 SAL_CALL getMinorVersion( ) override; - - // XDataDefinitionSupplier - virtual css::uno::Reference< css::sdbcx::XTablesSupplier > SAL_CALL getDataDefinitionByConnection( const css::uno::Reference< css::sdbc::XConnection >& connection ) override; - virtual css::uno::Reference< css::sdbcx::XTablesSupplier > SAL_CALL getDataDefinitionByURL( const OUString& url, const css::uno::Sequence< css::beans::PropertyValue >& info ) override; - - // XCreateCatalog - virtual void SAL_CALL createCatalog( const css::uno::Sequence< css::beans::PropertyValue >& info ) override; - - // XEventListener - virtual void SAL_CALL disposing( const css::lang::EventObject& Source ) override; - - // XTransactionListener - virtual void SAL_CALL preCommit( const css::lang::EventObject& aEvent ) override; - virtual void SAL_CALL commited( const css::lang::EventObject& aEvent ) override; - virtual void SAL_CALL preRevert( const css::lang::EventObject& aEvent ) override; - virtual void SAL_CALL reverted( const css::lang::EventObject& aEvent ) override; - - void shutdownConnections(); - void flushConnections(); - private: - /// dtor - virtual ~ODriverDelegator() override; - // OComponentHelper - virtual void SAL_CALL disposing() override; - - /** called when we connected to a newly created embedded database - */ - void onConnectedNewDatabase( - const css::uno::Reference< css::sdbc::XConnection >& _rxConnection - ); - }; + void onConnectedNewDatabase( + const css::uno::Reference< css::sdbc::XConnection >& _rxConnection + ); + }; } // namespace connectivity::hsqldb diff --git a/connectivity/source/inc/hsqldb/HStorageMap.hxx b/connectivity/source/inc/hsqldb/HStorageMap.hxx index 1186c680ac07..f0ec7d87e264 100644 --- a/connectivity/source/inc/hsqldb/HStorageMap.hxx +++ b/connectivity/source/inc/hsqldb/HStorageMap.hxx @@ -42,54 +42,54 @@ #include <uno/environment.hxx> namespace connectivity::hsqldb +{ + class StreamHelper { - class StreamHelper - { - css::uno::Reference< css::io::XStream> m_xStream; - css::uno::Reference< css::io::XSeekable> m_xSeek; - css::uno::Reference< css::io::XOutputStream> m_xOutputStream; - css::uno::Reference< css::io::XInputStream> m_xInputStream; - public: - StreamHelper(const css::uno::Reference< css::io::XStream>& _xStream); - ~StreamHelper(); - - css::uno::Reference< css::io::XInputStream> const & getInputStream(); - css::uno::Reference< css::io::XOutputStream> const & getOutputStream(); - css::uno::Reference< css::io::XSeekable> const & getSeek(); - }; - - - typedef std::map< OUString, std::shared_ptr<StreamHelper> > TStreamMap; - - struct StorageData { - css::uno::Reference<css::embed::XStorage> storage; - css::uno::Environment storageEnvironment; - OUString url; - TStreamMap streams; - - css::uno::Reference<css::embed::XStorage> mapStorage() const; - }; - - typedef std::map<OUString, StorageData> TStorages; - /** contains all storages so far accessed. - */ - class StorageContainer - { - public: - static OUString registerStorage(const css::uno::Reference< css::embed::XStorage>& _xStorage,const OUString& _sURL); - static TStorages::mapped_type getRegisteredStorage(const OUString& _sKey); - static OUString getRegisteredKey(const css::uno::Reference< css::embed::XStorage>& _xStorage); - static void revokeStorage(const OUString& _sKey,const css::uno::Reference< css::embed::XTransactionListener>& _xListener); - - static TStreamMap::mapped_type registerStream(JNIEnv * env,jstring name, jstring key,sal_Int32 _nMode); - static void revokeStream(JNIEnv * env,jstring name, jstring key); - static TStreamMap::mapped_type getRegisteredStream( JNIEnv * env, jstring name, jstring key); - - static OUString jstring2ustring(JNIEnv * env, jstring jstr); - static OUString removeURLPrefix(std::u16string_view _sURL, std::u16string_view _sFileURL); - static OUString removeOldURLPrefix(const OUString& _sURL); - static void throwJavaException(const css::uno::Exception& _aException,JNIEnv * env); - }; + css::uno::Reference< css::io::XStream> m_xStream; + css::uno::Reference< css::io::XSeekable> m_xSeek; + css::uno::Reference< css::io::XOutputStream> m_xOutputStream; + css::uno::Reference< css::io::XInputStream> m_xInputStream; + public: + StreamHelper(const css::uno::Reference< css::io::XStream>& _xStream); + ~StreamHelper(); + + css::uno::Reference< css::io::XInputStream> const & getInputStream(); + css::uno::Reference< css::io::XOutputStream> const & getOutputStream(); + css::uno::Reference< css::io::XSeekable> const & getSeek(); + }; + + + typedef std::map< OUString, std::shared_ptr<StreamHelper> > TStreamMap; + + struct StorageData { + css::uno::Reference<css::embed::XStorage> storage; + css::uno::Environment storageEnvironment; + OUString url; + TStreamMap streams; + + css::uno::Reference<css::embed::XStorage> mapStorage() const; + }; + + typedef std::map<OUString, StorageData> TStorages; + /** contains all storages so far accessed. + */ + class StorageContainer + { + public: + static OUString registerStorage(const css::uno::Reference< css::embed::XStorage>& _xStorage,const OUString& _sURL); + static TStorages::mapped_type getRegisteredStorage(const OUString& _sKey); + static OUString getRegisteredKey(const css::uno::Reference< css::embed::XStorage>& _xStorage); + static void revokeStorage(const OUString& _sKey,const css::uno::Reference< css::embed::XTransactionListener>& _xListener); + + static TStreamMap::mapped_type registerStream(JNIEnv * env,jstring name, jstring key,sal_Int32 _nMode); + static void revokeStream(JNIEnv * env,jstring name, jstring key); + static TStreamMap::mapped_type getRegisteredStream( JNIEnv * env, jstring name, jstring key); + + static OUString jstring2ustring(JNIEnv * env, jstring jstr); + static OUString removeURLPrefix(std::u16string_view _sURL, std::u16string_view _sFileURL); + static OUString removeOldURLPrefix(const OUString& _sURL); + static void throwJavaException(const css::uno::Exception& _aException,JNIEnv * env); + }; } // namespace connectivity::hsqldb diff --git a/connectivity/source/inc/hsqldb/HTable.hxx b/connectivity/source/inc/hsqldb/HTable.hxx index d6ac5ced7646..4b29ea0b5a7f 100644 --- a/connectivity/source/inc/hsqldb/HTable.hxx +++ b/connectivity/source/inc/hsqldb/HTable.hxx @@ -27,85 +27,85 @@ #include <comphelper/IdPropArrayHelper.hxx> namespace connectivity::hsqldb - { - - class OHSQLTable; - typedef ::comphelper::OIdPropertyArrayUsageHelper< OHSQLTable > OHSQLTable_PROP; - class OHSQLTable : public OTableHelper - ,public OHSQLTable_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; + class OHSQLTable; + typedef ::comphelper::OIdPropertyArrayUsageHelper< OHSQLTable > OHSQLTable_PROP; + class OHSQLTable : public OTableHelper + ,public OHSQLTable_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. - */ - virtual ::cppu::IPropertyArrayHelper* createArrayHelper(sal_Int32 nId) const override; - virtual ::cppu::IPropertyArrayHelper & SAL_CALL getInfoHelper() override; - - public: - OHSQLTable( sdbcx::OCollection* _pTables, - const css::uno::Reference< css::sdbc::XConnection >& _xConnection); - OHSQLTable( 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; - - virtual css::uno::Any SAL_CALL queryInterface( const css::uno::Type & rType ) override; - //XTypeProvider - virtual css::uno::Sequence< css::uno::Type > SAL_CALL getTypes( ) override; - // XAlterTable - virtual void SAL_CALL alterColumnByName( const OUString& colName, const css::uno::Reference< css::beans::XPropertySet >& descriptor ) override; - - // XRename - virtual void SAL_CALL rename( const OUString& newName ) override; - - /** - returns the ALTER TABLE XXX COLUMN statement + /** executes the statement. + @param _rStatement + The statement to execute. */ - 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); - - }; + 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; + + /** 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: + OHSQLTable( sdbcx::OCollection* _pTables, + const css::uno::Reference< css::sdbc::XConnection >& _xConnection); + OHSQLTable( 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; + + virtual css::uno::Any SAL_CALL queryInterface( const css::uno::Type & rType ) override; + //XTypeProvider + virtual css::uno::Sequence< css::uno::Type > SAL_CALL getTypes( ) override; + // XAlterTable + virtual void SAL_CALL alterColumnByName( const OUString& colName, const css::uno::Reference< css::beans::XPropertySet >& descriptor ) override; + + // XRename + virtual void SAL_CALL rename( const OUString& newName ) override; + + /** + returns the ALTER TABLE XXX COLUMN 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); + + }; } diff --git a/connectivity/source/inc/hsqldb/HTables.hxx b/connectivity/source/inc/hsqldb/HTables.hxx index d889ff686cae..cd255f08ed71 100644 --- a/connectivity/source/inc/hsqldb/HTables.hxx +++ b/connectivity/source/inc/hsqldb/HTables.hxx @@ -22,31 +22,31 @@ #include <com/sun/star/sdbc/XDatabaseMetaData.hpp> #include <utility> namespace connectivity::hsqldb +{ + class OTables final : public sdbcx::OCollection { - class OTables final : public sdbcx::OCollection - { - css::uno::Reference< css::sdbc::XDatabaseMetaData > m_xMetaData; + 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; + 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)) - {} + 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; + // only the name is identical to ::cppu::OComponentHelper + virtual void disposing() override; - // XDrop - void appendNew(const OUString& _rsNewTable); - }; + // XDrop + void appendNew(const OUString& _rsNewTable); + }; } diff --git a/connectivity/source/inc/hsqldb/HUser.hxx b/connectivity/source/inc/hsqldb/HUser.hxx index 67c44e185bd2..feb3daf284c6 100644 --- a/connectivity/source/inc/hsqldb/HUser.hxx +++ b/connectivity/source/inc/hsqldb/HUser.hxx @@ -23,50 +23,50 @@ #include <com/sun/star/sdbc/XConnection.hpp> namespace connectivity::hsqldb - { - typedef connectivity::sdbcx::OUser OUser_TYPEDEF; +{ + typedef connectivity::sdbcx::OUser OUser_TYPEDEF; - class OHSQLUser : public OUser_TYPEDEF - { - css::uno::Reference< css::sdbc::XConnection > m_xConnection; + class OHSQLUser : 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: - OHSQLUser( css::uno::Reference< css::sdbc::XConnection > _xConnection); - OHSQLUser( 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: + OHSQLUser( css::uno::Reference< css::sdbc::XConnection > _xConnection); + OHSQLUser( 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 OHSQLUser, - 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 OHSQLUser, + 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/hsqldb/HViews.hxx b/connectivity/source/inc/hsqldb/HViews.hxx index b71b1c87a66e..e1f035dbcf8b 100644 --- a/connectivity/source/inc/hsqldb/HViews.hxx +++ b/connectivity/source/inc/hsqldb/HViews.hxx @@ -21,30 +21,30 @@ #include <connectivity/sdbcx/VCollection.hxx> #include <com/sun/star/sdbc/XDatabaseMetaData.hpp> namespace connectivity::hsqldb +{ + class HViews final : public sdbcx::OCollection { - class HViews final : public sdbcx::OCollection - { - css::uno::Reference< css::sdbc::XConnection > m_xConnection; - css::uno::Reference< css::sdbc::XDatabaseMetaData > m_xMetaData; - bool m_bInDrop; + css::uno::Reference< css::sdbc::XConnection > m_xConnection; + 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; + 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: - HViews( - const css::uno::Reference< css::sdbc::XConnection >& _rxConnection, - ::cppu::OWeakObject& _rParent, ::osl::Mutex& _rMutex, const ::std::vector< OUString> &_rVector ); + void createView( const css::uno::Reference< css::beans::XPropertySet >& descriptor ); + public: + HViews( + const css::uno::Reference< css::sdbc::XConnection >& _rxConnection, + ::cppu::OWeakObject& _rParent, ::osl::Mutex& _rMutex, const ::std::vector< OUString> &_rVector ); - // 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); + }; } |