LibreOffice Module connectivity (master) 1
YTable.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
29namespace connectivity::mysql
30 {
31
32 class OMySQLTable;
33 typedef ::comphelper::OIdPropertyArrayUsageHelper< OMySQLTable > OMySQLTable_PROP;
35 ,public OMySQLTable_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
69 virtual OUString getRenameStart() const override;
70
77 virtual ::cppu::IPropertyArrayHelper* createArrayHelper(sal_Int32 nId) const override;
78 virtual ::cppu::IPropertyArrayHelper & SAL_CALL getInfoHelper() override;
79
80 public:
82 const css::uno::Reference< css::sdbc::XConnection >& _xConnection);
84 const css::uno::Reference< css::sdbc::XConnection >& _xConnection,
85 const OUString& Name,
86 const OUString& Type,
87 const OUString& Description,
88 const OUString& SchemaName,
89 const OUString& CatalogName,
90 sal_Int32 _nPrivileges
91 );
92
93 // ODescriptor
94 virtual void construct() override;
95
96 // XAlterTable
97 virtual void SAL_CALL alterColumnByName( const OUString& colName, const css::uno::Reference< css::beans::XPropertySet >& descriptor ) override;
100 OUString getAlterTableColumnPart() const;
101
102 // some methods to alter table structures
103 void alterColumnType(sal_Int32 nNewType,const OUString& _rColName,const css::uno::Reference< css::beans::XPropertySet >& _xDescriptor);
104 void alterDefaultValue(std::u16string_view _sNewDefault,const OUString& _rColName);
105 void dropDefaultValue(const OUString& _sNewDefault);
106
107 virtual OUString getTypeCreatePattern() const override;
108 };
109
110}
111
112/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
virtual void construct() override
Definition: YTable.cxx:83
virtual sdbcx::OCollection * createKeys(const ::std::vector< OUString > &_rNames) override
creates the key collection for the table
Definition: YTable.cxx:109
virtual OUString getTypeCreatePattern() const override
Definition: YTable.cxx:265
OMySQLTable(sdbcx::OCollection *_pTables, const css::uno::Reference< css::sdbc::XConnection > &_xConnection)
void alterColumnType(sal_Int32 nNewType, const OUString &_rColName, const css::uno::Reference< css::beans::XPropertySet > &_xDescriptor)
Definition: YTable.cxx:248
virtual void SAL_CALL alterColumnByName(const OUString &colName, const css::uno::Reference< css::beans::XPropertySet > &descriptor) override
Definition: YTable.cxx:120
void dropDefaultValue(const OUString &_sNewDefault)
Definition: YTable.cxx:276
virtual sdbcx::OCollection * createColumns(const ::std::vector< OUString > &_rNames) override
creates the column collection for the table
Definition: YTable.cxx:102
virtual ::cppu::IPropertyArrayHelper &SAL_CALL getInfoHelper() override
Definition: YTable.cxx:97
void alterDefaultValue(std::u16string_view _sNewDefault, const OUString &_rColName)
Definition: YTable.cxx:267
virtual sdbcx::OCollection * createIndexes(const ::std::vector< OUString > &_rNames) override
creates the index collection for the table
Definition: YTable.cxx:114
void executeStatement(const OUString &_rStatement)
executes the statement.
Definition: YTable.cxx:297
OUString getAlterTableColumnPart() const
returns the ALTER TABLE XXX statement
Definition: YTable.cxx:285
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)
virtual OUString getRenameStart() const override
Returns always "RENAME TABLE " even for views.
Definition: YTable.cxx:311
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: YTable.cxx:92
Type
::comphelper::OIdPropertyArrayUsageHelper< OMySQLTable > OMySQLTable_PROP
Definition: YTable.hxx:32