LibreOffice Module dbaccess (master) 1
table.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 <com/sun/star/sdbc/XConnection.hpp>
23
24#include "datasettings.hxx"
25#include "column.hxx"
29
30namespace dbaccess
31{
32
33 // OTables
34 class ODBTable;
35 class OContainerMediator;
36 typedef ::comphelper::OIdPropertyArrayUsageHelper< ODBTable > ODBTable_PROP;
38
40 ,public ODBTable_PROP
41 ,public OTable_Base
42 ,public IColumnFactory
43 {
44 private:
46
47 css::uno::Reference< css::container::XNameAccess > m_xColumnDefinitions;
48 css::uno::Reference< css::container::XNameAccess > m_xDriverColumns;
49
50 // <properties>
51 sal_Int32 m_nPrivileges;
52 // </properties>
53
54 protected:
55 virtual ::cppu::IPropertyArrayHelper* createArrayHelper( sal_Int32 _nId) const override;
56 virtual ::cppu::IPropertyArrayHelper & SAL_CALL getInfoHelper() override;
57
58 // IColumnFactory
59 virtual rtl::Reference<OColumn> createColumn(const OUString& _rName) const override;
60 virtual css::uno::Reference< css::beans::XPropertySet > createColumnDescriptor() override;
61 virtual void columnAppended( const css::uno::Reference< css::beans::XPropertySet >& _rxSourceDescriptor ) override;
62 virtual void columnDropped(const OUString& _sName) override;
63
68 virtual ::connectivity::sdbcx::OCollection* createColumns(const ::std::vector< OUString>& _rNames) override;
69
74 virtual ::connectivity::sdbcx::OCollection* createKeys(const ::std::vector< OUString>& _rNames) override;
75
80 virtual ::connectivity::sdbcx::OCollection* createIndexes(const ::std::vector< OUString>& _rNames) override;
81
82 // OComponentHelper
83 virtual void SAL_CALL disposing() override;
84 public:
96 ,const css::uno::Reference< css::sdbc::XConnection >& _rxConn
97 ,const OUString& _rCatalog
98 , const OUString& _rSchema
99 , const OUString& _rName
100 ,const OUString& _rType
101 , const OUString& _rDesc
102 ,const css::uno::Reference< css::container::XNameAccess >& _rxColumnDefinitions);
103
106 ,const css::uno::Reference< css::sdbc::XConnection >& _rxConn);
107 virtual ~ODBTable() override;
108
109 // ODescriptor
110 virtual void construct() override;
111
112 //XInterface
113 virtual css::uno::Any SAL_CALL queryInterface( const css::uno::Type& aType ) override;
114 //XTypeProvider
115 virtual css::uno::Sequence< css::uno::Type > SAL_CALL getTypes( ) override;
116 virtual css::uno::Sequence< sal_Int8 > SAL_CALL getImplementationId() override;
117
118 // css::lang::XServiceInfo
120
121 // css::beans::XPropertySet
122 virtual void SAL_CALL getFastPropertyValue(css::uno::Any& rValue, sal_Int32 nHandle) const override;
123
124 // css::sdbcx::XRename,
125 virtual void SAL_CALL rename( const OUString& _rNewName ) override;
126
127 // css::sdbcx::XAlterTable,
128 virtual void SAL_CALL alterColumnByName( const OUString& _rName, const css::uno::Reference< css::beans::XPropertySet >& _rxDescriptor ) override;
129
130 private:
132 using OTable_Base::getFastPropertyValue;
133 };
134}
135
136/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
virtual ::cppu::IPropertyArrayHelper * createArrayHelper(sal_Int32 _nId) const override
virtual css::uno::Sequence< css::uno::Type > SAL_CALL getTypes() override
Definition: table.cxx:263
virtual void SAL_CALL rename(const OUString &_rNewName) override
Definition: table.cxx:284
virtual ::connectivity::sdbcx::OCollection * createColumns(const ::std::vector< OUString > &_rNames) override
creates the column collection for the table
Definition: table.cxx:317
virtual void columnAppended(const css::uno::Reference< css::beans::XPropertySet > &_rxSourceDescriptor) override
notifies that a column, created from a column descriptor, has been appended
Definition: table.cxx:105
virtual css::uno::Reference< css::beans::XPropertySet > createColumnDescriptor() override
creates a column descriptor object.
Definition: table.cxx:312
virtual void SAL_CALL getFastPropertyValue(css::uno::Any &rValue, sal_Int32 nHandle) const override
Definition: table.cxx:134
ODBTable(connectivity::sdbcx::OCollection *_pTables, const css::uno::Reference< css::sdbc::XConnection > &_rxConn)
virtual css::uno::Any SAL_CALL queryInterface(const css::uno::Type &aType) override
Definition: table.cxx:254
virtual ::connectivity::sdbcx::OCollection * createIndexes(const ::std::vector< OUString > &_rNames) override
creates the index collection for the table
Definition: table.cxx:335
virtual ~ODBTable() override
Definition: table.cxx:82
virtual ::connectivity::sdbcx::OCollection * createKeys(const ::std::vector< OUString > &_rNames) override
creates the key collection for the table
Definition: table.cxx:330
virtual void SAL_CALL disposing() override
Definition: table.cxx:125
ODBTable(connectivity::sdbcx::OCollection *_pTables, const css::uno::Reference< css::sdbc::XConnection > &_rxConn, const OUString &_rCatalog, const OUString &_rSchema, const OUString &_rName, const OUString &_rType, const OUString &_rDesc, const css::uno::Reference< css::container::XNameAccess > &_rxColumnDefinitions)
constructs a wrapper supporting the com.sun.star.sdb.Table service.
css::uno::Reference< css::container::XNameAccess > m_xDriverColumns
Definition: table.hxx:48
virtual void construct() override
Definition: table.cxx:144
::rtl::Reference< OContainerMediator > m_pColumnMediator
Definition: table.hxx:45
virtual rtl::Reference< OColumn > createColumn(const OUString &_rName) const override
creates an OColumn object which should represent the column with a given name
Definition: table.cxx:86
virtual void SAL_CALL alterColumnByName(const OUString &_rName, const css::uno::Reference< css::beans::XPropertySet > &_rxDescriptor) override
Definition: table.cxx:297
sal_Int32 m_nPrivileges
Definition: table.hxx:51
virtual void columnDropped(const OUString &_sName) override
notifies that a column with a given name has been dropped
Definition: table.cxx:110
virtual ::cppu::IPropertyArrayHelper &SAL_CALL getInfoHelper() override
Definition: table.cxx:229
virtual ::cppu::IPropertyArrayHelper * createArrayHelper(sal_Int32 _nId) const override
Definition: table.cxx:207
css::uno::Reference< css::container::XNameAccess > m_xColumnDefinitions
Definition: table.hxx:47
virtual css::uno::Sequence< sal_Int8 > SAL_CALL getImplementationId() override
Definition: table.cxx:119
::comphelper::OIdPropertyArrayUsageHelper< ODBTable > ODBTable_PROP
Definition: table.hxx:35
::connectivity::OTableHelper OTable_Base
Definition: table.hxx:37