cid#1607171 Data race condition
[LibreOffice.git] / connectivity / source / inc / hsqldb / HTable.hxx
blobd6ac5ced76469eadd091c51cbc1e0b250575b83c
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
3 * This file is part of the LibreOffice project.
5 * This Source Code Form is subject to the terms of the Mozilla Public
6 * License, v. 2.0. If a copy of the MPL was not distributed with this
7 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
9 * This file incorporates work covered by the following license notice:
11 * Licensed to the Apache Software Foundation (ASF) under one or more
12 * contributor license agreements. See the NOTICE file distributed
13 * with this work for additional information regarding copyright
14 * ownership. The ASF licenses this file to you under the Apache
15 * License, Version 2.0 (the "License"); you may not use this file
16 * except in compliance with the License. You may obtain a copy of
17 * the License at http://www.apache.org/licenses/LICENSE-2.0 .
20 #pragma once
22 #include <sal/config.h>
24 #include <string_view>
26 #include <connectivity/TTableHelper.hxx>
27 #include <comphelper/IdPropArrayHelper.hxx>
29 namespace connectivity::hsqldb
32 class OHSQLTable;
33 typedef ::comphelper::OIdPropertyArrayUsageHelper< OHSQLTable > OHSQLTable_PROP;
34 class OHSQLTable : public OTableHelper
35 ,public OHSQLTable_PROP
37 sal_Int32 m_nPrivileges; // we have to set our privileges by our own
39 /** executes the statement.
40 @param _rStatement
41 The statement to execute.
43 void executeStatement(const OUString& _rStatement );
44 protected:
46 /** creates the column collection for the table
47 @param _rNames
48 The column names.
50 virtual sdbcx::OCollection* createColumns(const ::std::vector< OUString>& _rNames) override;
52 /** creates the key collection for the table
53 @param _rNames
54 The key names.
56 virtual sdbcx::OCollection* createKeys(const ::std::vector< OUString>& _rNames) override;
58 /** creates the index collection for the table
59 @param _rNames
60 The index names.
62 virtual sdbcx::OCollection* createIndexes(const ::std::vector< OUString>& _rNames) override;
64 /** used to implement the creation of the array helper which is shared amongst all instances of the class.
65 This method needs to be implemented in derived classes.
66 <BR>
67 The method gets called with s_aMutex acquired.
68 @return a pointer to the newly created array helper. Must not be NULL.
70 virtual ::cppu::IPropertyArrayHelper* createArrayHelper(sal_Int32 nId) const override;
71 virtual ::cppu::IPropertyArrayHelper & SAL_CALL getInfoHelper() override;
73 public:
74 OHSQLTable( sdbcx::OCollection* _pTables,
75 const css::uno::Reference< css::sdbc::XConnection >& _xConnection);
76 OHSQLTable( sdbcx::OCollection* _pTables,
77 const css::uno::Reference< css::sdbc::XConnection >& _xConnection,
78 const OUString& Name,
79 const OUString& Type,
80 const OUString& Description,
81 const OUString& SchemaName,
82 const OUString& CatalogName,
83 sal_Int32 _nPrivileges
86 // ODescriptor
87 virtual void construct() override;
89 virtual css::uno::Any SAL_CALL queryInterface( const css::uno::Type & rType ) override;
90 //XTypeProvider
91 virtual css::uno::Sequence< css::uno::Type > SAL_CALL getTypes( ) override;
92 // XAlterTable
93 virtual void SAL_CALL alterColumnByName( const OUString& colName, const css::uno::Reference< css::beans::XPropertySet >& descriptor ) override;
95 // XRename
96 virtual void SAL_CALL rename( const OUString& newName ) override;
98 /**
99 returns the ALTER TABLE XXX COLUMN statement
101 OUString getAlterTableColumnPart() const;
103 // some methods to alter table structures
104 void alterColumnType(sal_Int32 nNewType,const OUString& _rColName,const css::uno::Reference< css::beans::XPropertySet >& _xDescriptor);
105 void alterDefaultValue(std::u16string_view _sNewDefault,const OUString& _rColName);
106 void dropDefaultValue(const OUString& _sNewDefault);
112 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */