LibreOffice Module connectivity (master) 1
HTable.hxx
Go to the documentation of this file.
1/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2/*
3 * This file is part of the LibreOffice project.
4 *
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/.
8 *
9 * This file incorporates work covered by the following license notice:
10 *
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 .
18 */
19
20#pragma once
21
22#include <sal/config.h>
23
24#include <string_view>
25
28
30 {
31
32 class OHSQLTable;
33 typedef ::comphelper::OIdPropertyArrayUsageHelper< OHSQLTable > OHSQLTable_PROP;
34 class OHSQLTable : public OTableHelper
35 ,public OHSQLTable_PROP
36 {
37 sal_Int32 m_nPrivileges; // we have to set our privileges by our own
38
43 void executeStatement(const OUString& _rStatement );
44 protected:
45
50 virtual sdbcx::OCollection* createColumns(const ::std::vector< OUString>& _rNames) override;
51
56 virtual sdbcx::OCollection* createKeys(const ::std::vector< OUString>& _rNames) override;
57
62 virtual sdbcx::OCollection* createIndexes(const ::std::vector< OUString>& _rNames) override;
63
70 virtual ::cppu::IPropertyArrayHelper* createArrayHelper(sal_Int32 nId) const override;
71 virtual ::cppu::IPropertyArrayHelper & SAL_CALL getInfoHelper() override;
72
73 public:
75 const css::uno::Reference< css::sdbc::XConnection >& _xConnection);
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
84 );
85
86 // ODescriptor
87 virtual void construct() override;
88
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;
94
95 // XRename
96 virtual void SAL_CALL rename( const OUString& newName ) override;
97
101 OUString getAlterTableColumnPart() const;
102
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);
107
108 };
109
110}
111
112/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
void alterColumnType(sal_Int32 nNewType, const OUString &_rColName, const css::uno::Reference< css::beans::XPropertySet > &_xDescriptor)
Definition: HTable.cxx:227
virtual sdbcx::OCollection * createIndexes(const ::std::vector< OUString > &_rNames) override
creates the index collection for the table
Definition: HTable.cxx:113
virtual void SAL_CALL alterColumnByName(const OUString &colName, const css::uno::Reference< css::beans::XPropertySet > &descriptor) override
Definition: HTable.cxx:120
OUString getAlterTableColumnPart() const
returns the ALTER TABLE XXX COLUMN statement
Definition: HTable.cxx:277
void dropDefaultValue(const OUString &_sNewDefault)
Definition: HTable.cxx:266
virtual sdbcx::OCollection * createColumns(const ::std::vector< OUString > &_rNames) override
creates the column collection for the table
Definition: HTable.cxx:101
virtual void SAL_CALL rename(const OUString &newName) override
Definition: HTable.cxx:328
virtual ::cppu::IPropertyArrayHelper &SAL_CALL getInfoHelper() override
Definition: HTable.cxx:96
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)
virtual css::uno::Sequence< css::uno::Type > SAL_CALL getTypes() override
Definition: HTable.cxx:306
OHSQLTable(sdbcx::OCollection *_pTables, const css::uno::Reference< css::sdbc::XConnection > &_xConnection)
virtual sdbcx::OCollection * createKeys(const ::std::vector< OUString > &_rNames) override
creates the key collection for the table
Definition: HTable.cxx:108
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...
Definition: HTable.cxx:91
virtual css::uno::Any SAL_CALL queryInterface(const css::uno::Type &rType) override
Definition: HTable.cxx:364
void alterDefaultValue(std::u16string_view _sNewDefault, const OUString &_rColName)
Definition: HTable.cxx:255
virtual void construct() override
Definition: HTable.cxx:84
void executeStatement(const OUString &_rStatement)
executes the statement.
Definition: HTable.cxx:287
Type
::comphelper::OIdPropertyArrayUsageHelper< OHSQLTable > OHSQLTable_PROP
Definition: HTable.hxx:32