LibreOffice Module connectivity (master) 1
MacabStatement.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 "MacabConnection.hxx"
23#include "MacabHeader.hxx"
26#include <com/sun/star/sdbc/XStatement.hpp>
27#include <com/sun/star/sdbc/SQLWarning.hpp>
28#include <com/sun/star/util/XCancellable.hpp>
33
34namespace connectivity::macab
35{
36 typedef ::cppu::WeakComponentImplHelper< css::sdbc::XStatement,
37 css::sdbc::XWarningsSupplier,
38 css::util::XCancellable,
39 css::sdbc::XCloseable> MacabCommonStatement_BASE;
40
41
42 // Class MacabCommonStatement
43 // is a base class for the normal statement and for the prepared statement
44
48 public comphelper::OPropertyArrayUsageHelper<MacabCommonStatement>
49
50 {
51 css::sdbc::SQLWarning m_aLastWarning;
52
53 protected:
57 MacabConnection* m_pConnection; // The owning Connection object
58 MacabHeader* m_pHeader; // The header of the address book on which to run queries (provided by m_pConnection)
59 css::uno::WeakReference< css::sdbc::XResultSet> m_xResultSet; // The last ResultSet created
60
61
62 protected:
65 const OSQLParseNode *pParseNode) const;
68 const OSQLParseNode *pParseNode) const;
69 OUString getTableName( ) const;
71 void setMacabFields(class MacabResultSet *pResult) const;
73 void selectRecords(MacabResultSet *pResult) const;
75 void sortRecords(MacabResultSet *pResult) const;
76
77 // OPropertyArrayUsageHelper
78 virtual ::cppu::IPropertyArrayHelper* createArrayHelper() const override;
79
80 // OPropertySetHelper
81 virtual ::cppu::IPropertyArrayHelper & SAL_CALL getInfoHelper() override;
82 virtual sal_Bool SAL_CALL convertFastPropertyValue(
83 css::uno::Any & rConvertedValue,
84 css::uno::Any & rOldValue,
85 sal_Int32 nHandle,
86 const css::uno::Any& rValue) override;
87 virtual void SAL_CALL setFastPropertyValue_NoBroadcast(
88 sal_Int32 nHandle,
89 const css::uno::Any& rValue) override;
90 virtual void SAL_CALL getFastPropertyValue(
91 css::uno::Any& rValue,
92 sal_Int32 nHandle) const override;
93
95 virtual void resetParameters() const;
97 virtual void getNextParameter(OUString &rParameter) const;
98 virtual ~MacabCommonStatement() override;
99
100 public:
101 using MacabCommonStatement_BASE::rBHelper;
102
103 explicit MacabCommonStatement(MacabConnection *_pConnection);
104 using MacabCommonStatement_BASE::operator css::uno::Reference< css::uno::XInterface >;
105
106 // OComponentHelper
107 using MacabCommonStatement_BASE::disposing;
108
109 // XInterface
110 virtual void SAL_CALL release() noexcept override;
111 virtual void SAL_CALL acquire() noexcept override;
112 virtual css::uno::Any SAL_CALL queryInterface(
113 const css::uno::Type & rType
114 ) override;
115
116 // XTypeProvider
117 virtual css::uno::Sequence< css::uno::Type > SAL_CALL getTypes(
118 ) override;
119
120 // XPropertySet
121 virtual css::uno::Reference< css::beans::XPropertySetInfo > SAL_CALL getPropertySetInfo(
122 ) override;
123
124 // XStatement
125 virtual css::uno::Reference< css::sdbc::XResultSet > SAL_CALL executeQuery(
126 const OUString& sql ) override;
127 virtual sal_Int32 SAL_CALL executeUpdate(
128 const OUString& sql ) override;
129 virtual sal_Bool SAL_CALL execute(
130 const OUString& sql ) override;
131 virtual css::uno::Reference< css::sdbc::XConnection > SAL_CALL getConnection(
132 ) override;
133
134 // XWarningsSupplier
135 virtual css::uno::Any SAL_CALL getWarnings(
136 ) override;
137 virtual void SAL_CALL clearWarnings(
138 ) override;
139
140 // XCancellable
141 virtual void SAL_CALL cancel(
142 ) override;
143
144 // XCloseable
145 virtual void SAL_CALL close(
146 ) override;
147
148 // other methods
150 };
151
152
153 // Class MacabStatement
154
155 typedef ::cppu::ImplInheritanceHelper<
156 MacabCommonStatement, css::lang::XServiceInfo > MacabStatement_BASE;
157
159 {
160 protected:
161 virtual ~MacabStatement() override { }
162
163 public:
164 explicit MacabStatement(MacabConnection* _pConnection);
166 };
167}
168
169/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
Parser for SQL92.
Definition: sqlparse.hxx:110
virtual sal_Bool SAL_CALL execute(const OUString &sql) override
void selectRecords(MacabResultSet *pResult) const
virtual css::uno::Reference< css::beans::XPropertySetInfo > SAL_CALL getPropertySetInfo() override
virtual css::uno::Any SAL_CALL queryInterface(const css::uno::Type &rType) override
virtual void SAL_CALL setFastPropertyValue_NoBroadcast(sal_Int32 nHandle, const css::uno::Any &rValue) override
virtual void SAL_CALL cancel() override
class MacabOrder * analyseOrderByClause(const OSQLParseNode *pParseNode) const
virtual ::cppu::IPropertyArrayHelper &SAL_CALL getInfoHelper() override
connectivity::OSQLParseNode * m_pParseTree
connectivity::OSQLParseTreeIterator m_aSQLIterator
virtual void SAL_CALL release() noexcept override
void sortRecords(MacabResultSet *pResult) const
virtual ::cppu::IPropertyArrayHelper * createArrayHelper() const override
virtual void getNextParameter(OUString &rParameter) const
virtual void SAL_CALL clearWarnings() override
virtual css::uno::Any SAL_CALL getWarnings() override
virtual sal_Bool SAL_CALL convertFastPropertyValue(css::uno::Any &rConvertedValue, css::uno::Any &rOldValue, sal_Int32 nHandle, const css::uno::Any &rValue) override
void setMacabFields(class MacabResultSet *pResult) const
virtual css::uno::Reference< css::sdbc::XConnection > SAL_CALL getConnection() override
virtual void SAL_CALL acquire() noexcept override
virtual sal_Int32 SAL_CALL executeUpdate(const OUString &sql) override
class MacabCondition * analyseWhereClause(const OSQLParseNode *pParseNode) const
css::uno::WeakReference< css::sdbc::XResultSet > m_xResultSet
virtual void SAL_CALL getFastPropertyValue(css::uno::Any &rValue, sal_Int32 nHandle) const override
MacabConnection * getOwnConnection() const
virtual css::uno::Sequence< css::uno::Type > SAL_CALL getTypes() override
virtual void SAL_CALL close() override
virtual css::uno::Reference< css::sdbc::XResultSet > SAL_CALL executeQuery(const OUString &sql) override
MacabCommonStatement(MacabConnection *_pConnection)
MacabStatement(MacabConnection *_pConnection)
Type
::cppu::WeakComponentImplHelper< css::sdbc::XStatement, css::sdbc::XWarningsSupplier, css::util::XCancellable, css::sdbc::XCloseable > MacabCommonStatement_BASE
::cppu::ImplInheritanceHelper< MacabCommonStatement, css::lang::XServiceInfo > MacabStatement_BASE
unsigned char sal_Bool