LibreOffice Module connectivity (master) 1
mysqlc_catalog.cxx
Go to the documentation of this file.
1/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4; fill-column: 100 -*- */
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
10#include "mysqlc_catalog.hxx"
11#include "mysqlc_tables.hxx"
12#include "mysqlc_views.hxx"
13
15 const css::uno::Reference<css::sdbc::XConnection>& rConnection)
16 : OCatalog(rConnection)
17 , m_xConnection(rConnection)
18{
19}
20
21//----- OCatalog -------------------------------------------------------------
23{
24 css::uno::Reference<css::sdbc::XResultSet> xTables
25 = m_xMetaData->getTables(css::uno::Any(), "%", "%", {});
26
27 if (!xTables.is())
28 return;
29
30 ::std::vector<OUString> aTableNames;
31
32 fillNames(xTables, aTableNames);
33
34 if (!m_pTables)
35 m_pTables.reset(new Tables(m_xConnection->getMetaData(), *this, m_aMutex, aTableNames));
36 else
37 m_pTables->reFill(aTableNames);
38}
39
41{
42 css::uno::Reference<css::sdbc::XResultSet> xViews
43 = m_xMetaData->getTables(css::uno::Any(), "%", "%", { "VIEW" });
44
45 if (!xViews.is())
46 return;
47
48 ::std::vector<OUString> aViewNames;
49
50 fillNames(xViews, aViewNames);
51
52 if (!m_pViews)
53 m_pViews.reset(new Views(m_xConnection, *this, m_aMutex, aViewNames));
54 else
55 m_pViews->reFill(aViewNames);
56}
57
58//----- IRefreshableGroups ---------------------------------------------------
60{
61 // TODO: implement me
62}
63
64//----- IRefreshableUsers ----------------------------------------------------
66{
67 // TODO: implement me
68}
69
70/* vim:set shiftwidth=4 softtabstop=4 expandtab cinoptions=b1,g0,N-s cinkeys+=0=break: */
virtual void refreshViews() override
virtual void refreshTables() override
Catalog(const css::uno::Reference< css::sdbc::XConnection > &rConnection)
virtual void refreshGroups() override
virtual void refreshUsers() override
This implements com.sun.star.sdbcx.Container, which seems to be also known by the name of Tables and ...
std::mutex m_aMutex
Reference< XConnection > m_xConnection