Line data Source code
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 : #ifndef INCLUDED_CONNECTIVITY_SOURCE_INC_FILE_FRESULTSET_HXX
21 : #define INCLUDED_CONNECTIVITY_SOURCE_INC_FILE_FRESULTSET_HXX
22 :
23 : #include <com/sun/star/sdbc/XResultSet.hpp>
24 : #include <com/sun/star/sdbc/XRow.hpp>
25 : #include <com/sun/star/sdbc/XResultSetMetaDataSupplier.hpp>
26 : #include <com/sun/star/sdbc/XCloseable.hpp>
27 : #include <com/sun/star/sdbc/XColumnLocate.hpp>
28 : #include <com/sun/star/util/XCancellable.hpp>
29 : #include <com/sun/star/sdbc/XWarningsSupplier.hpp>
30 : #include <com/sun/star/sdbc/XResultSetUpdate.hpp>
31 : #include <com/sun/star/sdbc/XRowUpdate.hpp>
32 : #include <cppuhelper/compbase12.hxx>
33 : #include <comphelper/proparrhlp.hxx>
34 : #include "file/FStatement.hxx"
35 : #include <connectivity/CommonTools.hxx>
36 : #include <comphelper/propertycontainer.hxx>
37 : #include "file/fanalyzer.hxx"
38 : #include "file/FTable.hxx"
39 : #include "file/filedllapi.hxx"
40 : #include <comphelper/broadcasthelper.hxx>
41 : #include <connectivity/StdTypeDefs.hxx>
42 : #include "TSortIndex.hxx"
43 : #include "TSkipDeletedSet.hxx"
44 : #include <com/sun/star/lang/XEventListener.hpp>
45 :
46 : namespace connectivity
47 : {
48 : namespace file
49 : {
50 : typedef ::cppu::WeakComponentImplHelper12< ::com::sun::star::sdbc::XResultSet,
51 : ::com::sun::star::sdbc::XRow,
52 : ::com::sun::star::sdbc::XResultSetMetaDataSupplier,
53 : ::com::sun::star::util::XCancellable,
54 : ::com::sun::star::sdbc::XWarningsSupplier,
55 : ::com::sun::star::sdbc::XResultSetUpdate,
56 : ::com::sun::star::sdbc::XRowUpdate,
57 : ::com::sun::star::sdbc::XCloseable,
58 : ::com::sun::star::sdbc::XColumnLocate,
59 : ::com::sun::star::lang::XServiceInfo,
60 : ::com::sun::star::lang::XEventListener,
61 : ::com::sun::star::lang::XUnoTunnel> OResultSet_BASE;
62 :
63 : class OOO_DLLPUBLIC_FILE OResultSet :
64 : public comphelper::OBaseMutex,
65 : public ::connectivity::IResultSetHelper,
66 : public OResultSet_BASE,
67 : public ::comphelper::OPropertyContainer,
68 : public ::comphelper::OPropertyArrayUsageHelper<OResultSet>
69 : {
70 :
71 : protected:
72 : ::std::vector<void*> m_aBindVector;
73 : ::std::vector<sal_Int32> m_aColMapping; // pos 0 is unused so we don't have to decrement 1 every time
74 :
75 : ::std::vector<sal_Int32> m_aOrderbyColumnNumber;
76 : ::std::vector<TAscendingOrder> m_aOrderbyAscending;
77 :
78 : OValueRefRow m_aSelectRow;
79 : OValueRefRow m_aRow;
80 : OValueRefRow m_aEvaluateRow; // contains all values of a row
81 : OValueRefRow m_aParameterRow;
82 : OValueRefRow m_aInsertRow; // needed for insert by cursor
83 : ORefAssignValues m_aAssignValues; // needed for insert,update and parameters
84 : // to compare with the restrictions
85 : TIntVector* m_pEvaluationKeySet;
86 : TIntVector::iterator m_aEvaluateIter;
87 :
88 :
89 : OSkipDeletedSet m_aSkipDeletedSet;
90 :
91 : ::rtl::Reference<OKeySet> m_pFileSet;
92 : OKeySet::Vector::iterator m_aFileSetIter;
93 :
94 :
95 :
96 : OSortIndex* m_pSortIndex;
97 : ::rtl::Reference<connectivity::OSQLColumns> m_xColumns; // this are the select columns
98 : ::rtl::Reference<connectivity::OSQLColumns> m_xParamColumns;
99 : OFileTable* m_pTable;
100 : connectivity::OSQLParseNode* m_pParseTree;
101 :
102 : OSQLAnalyzer* m_pSQLAnalyzer;
103 : connectivity::OSQLParseTreeIterator& m_aSQLIterator;
104 :
105 : sal_Int32 m_nFetchSize;
106 : sal_Int32 m_nResultSetType;
107 : sal_Int32 m_nFetchDirection;
108 : sal_Int32 m_nResultSetConcurrency;
109 :
110 : ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface> m_xStatement;
111 : ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XResultSetMetaData> m_xMetaData;
112 : ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XDatabaseMetaData> m_xDBMetaData;
113 : ::com::sun::star::uno::Reference< ::com::sun::star::container::XNameAccess> m_xColNames; // table columns
114 : ::com::sun::star::uno::Reference< ::com::sun::star::container::XIndexAccess> m_xColsIdx; // table columns
115 :
116 :
117 : OUString m_aTableRange;
118 : rtl_TextEncoding m_nTextEncoding;
119 : sal_Int32 m_nRowPos;
120 : sal_Int32 m_nFilePos;
121 : sal_Int32 m_nLastVisitedPos;
122 : sal_Int32 m_nRowCountResult;
123 : sal_Int32 m_nColumnCount;
124 : bool m_bWasNull;
125 : bool m_bEOF; // after last record
126 : bool m_bLastRecord;
127 : bool m_bInserted; // true when moveToInsertRow was called
128 : // set to false when cursor moved or cancel
129 : bool m_bRowUpdated;
130 : bool m_bRowInserted;
131 : bool m_bRowDeleted;
132 : bool m_bShowDeleted;
133 : bool m_bIsCount;
134 :
135 : static void initializeRow(OValueRefRow& _rRow,sal_Int32 _nColumnCount);
136 : void construct();
137 : //sal_Bool evaluate();
138 :
139 : bool ExecuteRow(IResultSetHelper::Movement eFirstCursorPosition,
140 : sal_Int32 nOffset = 1,
141 : bool bEvaluate = true,
142 : bool bRetrieveData = true);
143 :
144 : OKeyValue* GetOrderbyKeyValue(OValueRefRow& _rRow);
145 29 : bool IsSorted() const { return !m_aOrderbyColumnNumber.empty() && m_aOrderbyColumnNumber[0] >= 0;}
146 :
147 : // return true when the select statement is "select count(*) from table"
148 4535 : inline bool isCount() const { return m_bIsCount; }
149 : void checkIndex(sal_Int32 columnIndex ) throw(::com::sun::star::sdbc::SQLException);
150 :
151 : const ORowSetValue& getValue(sal_Int32 columnIndex)
152 : throw (css::sdbc::SQLException, css::uno::RuntimeException);
153 : void updateValue(sal_Int32 columnIndex,const ORowSetValue& x ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
154 : // clear insert row
155 : void clearInsertRow();
156 : void sortRows();
157 : protected:
158 :
159 : using OResultSet_BASE::rBHelper;
160 :
161 : bool Move(IResultSetHelper::Movement eCursorPosition, sal_Int32 nOffset, bool bRetrieveData);
162 : virtual bool fillIndexValues(const ::com::sun::star::uno::Reference< ::com::sun::star::sdbcx::XColumnsSupplier> &_xIndex);
163 :
164 : // OPropertyArrayUsageHelper
165 : virtual ::cppu::IPropertyArrayHelper* createArrayHelper( ) const SAL_OVERRIDE;
166 : // OPropertySetHelper
167 : virtual ::cppu::IPropertyArrayHelper & SAL_CALL getInfoHelper() SAL_OVERRIDE;
168 :
169 : virtual ~OResultSet();
170 : public:
171 : DECLARE_SERVICE_INFO();
172 : // a Constructor, that is needed for when Returning the Object is needed:
173 : OResultSet( OStatement_Base* pStmt,connectivity::OSQLParseTreeIterator& _aSQLIterator);
174 :
175 : ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > operator *()
176 : {
177 : return ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface >(*static_cast<OResultSet_BASE*>(this));
178 : }
179 :
180 : // ::cppu::OComponentHelper
181 : virtual void SAL_CALL disposing() SAL_OVERRIDE;
182 : // XInterface
183 : virtual ::com::sun::star::uno::Any SAL_CALL queryInterface( const ::com::sun::star::uno::Type & rType ) throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
184 : virtual void SAL_CALL acquire() throw() SAL_OVERRIDE;
185 : virtual void SAL_CALL release() throw() SAL_OVERRIDE;
186 : //XTypeProvider
187 : virtual ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Type > SAL_CALL getTypes( ) throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
188 : // XPropertySet
189 : virtual ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySetInfo > SAL_CALL getPropertySetInfo( ) throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
190 : // XResultSet
191 : virtual sal_Bool SAL_CALL next( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
192 : virtual sal_Bool SAL_CALL isBeforeFirst( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
193 : virtual sal_Bool SAL_CALL isAfterLast( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
194 : virtual sal_Bool SAL_CALL isFirst( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
195 : virtual sal_Bool SAL_CALL isLast( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
196 : virtual void SAL_CALL beforeFirst( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
197 : virtual void SAL_CALL afterLast( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
198 : virtual sal_Bool SAL_CALL first( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
199 : virtual sal_Bool SAL_CALL last( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
200 : virtual sal_Int32 SAL_CALL getRow( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
201 : virtual sal_Bool SAL_CALL absolute( sal_Int32 row ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
202 : virtual sal_Bool SAL_CALL relative( sal_Int32 rows ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
203 : virtual sal_Bool SAL_CALL previous( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
204 : virtual void SAL_CALL refreshRow( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
205 : virtual sal_Bool SAL_CALL rowUpdated( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
206 : virtual sal_Bool SAL_CALL rowInserted( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
207 : virtual sal_Bool SAL_CALL rowDeleted( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
208 : virtual ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > SAL_CALL getStatement( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
209 : // XRow
210 : virtual sal_Bool SAL_CALL wasNull( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
211 : virtual OUString SAL_CALL getString( sal_Int32 columnIndex ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
212 : virtual sal_Bool SAL_CALL getBoolean( sal_Int32 columnIndex ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
213 : virtual sal_Int8 SAL_CALL getByte( sal_Int32 columnIndex ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
214 : virtual sal_Int16 SAL_CALL getShort( sal_Int32 columnIndex ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
215 : virtual sal_Int32 SAL_CALL getInt( sal_Int32 columnIndex ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
216 : virtual sal_Int64 SAL_CALL getLong( sal_Int32 columnIndex ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
217 : virtual float SAL_CALL getFloat( sal_Int32 columnIndex ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
218 : virtual double SAL_CALL getDouble( sal_Int32 columnIndex ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
219 : virtual ::com::sun::star::uno::Sequence< sal_Int8 > SAL_CALL getBytes( sal_Int32 columnIndex ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
220 : virtual ::com::sun::star::util::Date SAL_CALL getDate( sal_Int32 columnIndex ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
221 : virtual ::com::sun::star::util::Time SAL_CALL getTime( sal_Int32 columnIndex ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
222 : virtual ::com::sun::star::util::DateTime SAL_CALL getTimestamp( sal_Int32 columnIndex ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
223 : virtual ::com::sun::star::uno::Reference< ::com::sun::star::io::XInputStream > SAL_CALL getBinaryStream( sal_Int32 columnIndex ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
224 : virtual ::com::sun::star::uno::Reference< ::com::sun::star::io::XInputStream > SAL_CALL getCharacterStream( sal_Int32 columnIndex ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
225 : virtual ::com::sun::star::uno::Any SAL_CALL getObject( sal_Int32 columnIndex, const ::com::sun::star::uno::Reference< ::com::sun::star::container::XNameAccess >& typeMap ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
226 : virtual ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XRef > SAL_CALL getRef( sal_Int32 columnIndex ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
227 : virtual ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XBlob > SAL_CALL getBlob( sal_Int32 columnIndex ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
228 : virtual ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XClob > SAL_CALL getClob( sal_Int32 columnIndex ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
229 : virtual ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XArray > SAL_CALL getArray( sal_Int32 columnIndex ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
230 : // XResultSetMetaDataSupplier
231 : virtual ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XResultSetMetaData > SAL_CALL getMetaData( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
232 : // XCancellable
233 : virtual void SAL_CALL cancel( ) throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
234 : // XCloseable
235 : virtual void SAL_CALL close( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
236 : // XWarningsSupplier
237 : virtual ::com::sun::star::uno::Any SAL_CALL getWarnings( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
238 : virtual void SAL_CALL clearWarnings( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
239 : // XResultSetUpdate
240 : virtual void SAL_CALL insertRow( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
241 : virtual void SAL_CALL updateRow( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
242 : virtual void SAL_CALL deleteRow( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
243 : virtual void SAL_CALL cancelRowUpdates( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
244 : virtual void SAL_CALL moveToInsertRow( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
245 : virtual void SAL_CALL moveToCurrentRow( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
246 : // XRowUpdate
247 : virtual void SAL_CALL updateNull( sal_Int32 columnIndex ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
248 : virtual void SAL_CALL updateBoolean( sal_Int32 columnIndex, sal_Bool x ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
249 : virtual void SAL_CALL updateByte( sal_Int32 columnIndex, sal_Int8 x ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
250 : virtual void SAL_CALL updateShort( sal_Int32 columnIndex, sal_Int16 x ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
251 : virtual void SAL_CALL updateInt( sal_Int32 columnIndex, sal_Int32 x ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
252 : virtual void SAL_CALL updateLong( sal_Int32 columnIndex, sal_Int64 x ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
253 : virtual void SAL_CALL updateFloat( sal_Int32 columnIndex, float x ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
254 : virtual void SAL_CALL updateDouble( sal_Int32 columnIndex, double x ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
255 : virtual void SAL_CALL updateString( sal_Int32 columnIndex, const OUString& x ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
256 : virtual void SAL_CALL updateBytes( sal_Int32 columnIndex, const ::com::sun::star::uno::Sequence< sal_Int8 >& x ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
257 : virtual void SAL_CALL updateDate( sal_Int32 columnIndex, const ::com::sun::star::util::Date& x ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
258 : virtual void SAL_CALL updateTime( sal_Int32 columnIndex, const ::com::sun::star::util::Time& x ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
259 : virtual void SAL_CALL updateTimestamp( sal_Int32 columnIndex, const ::com::sun::star::util::DateTime& x ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
260 : virtual void SAL_CALL updateBinaryStream( sal_Int32 columnIndex, const ::com::sun::star::uno::Reference< ::com::sun::star::io::XInputStream >& x, sal_Int32 length ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
261 : virtual void SAL_CALL updateCharacterStream( sal_Int32 columnIndex, const ::com::sun::star::uno::Reference< ::com::sun::star::io::XInputStream >& x, sal_Int32 length ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
262 : virtual void SAL_CALL updateObject( sal_Int32 columnIndex, const ::com::sun::star::uno::Any& x ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
263 : virtual void SAL_CALL updateNumericObject( sal_Int32 columnIndex, const ::com::sun::star::uno::Any& x, sal_Int32 scale ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
264 : // XColumnLocate
265 : virtual sal_Int32 SAL_CALL findColumn( const OUString& columnName ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
266 : // com::sun::star::lang::XUnoTunnel
267 : virtual sal_Int64 SAL_CALL getSomething( const ::com::sun::star::uno::Sequence< sal_Int8 >& aIdentifier ) throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
268 : static ::com::sun::star::uno::Sequence< sal_Int8 > getUnoTunnelImplementationId();
269 : //XEventlistener
270 : virtual void SAL_CALL disposing( const ::com::sun::star::lang::EventObject& Source ) throw (::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
271 :
272 : // special methods
273 : inline sal_Int32 mapColumn(sal_Int32 column);
274 : bool OpenImpl();
275 : void doTableSpecials(const OSQLTable& _xTable);
276 :
277 0 : inline sal_Int32 getRowCountResult() const { return m_nRowCountResult; }
278 29 : inline void setParameterRow(const OValueRefRow& _rParaRow) { m_aParameterRow = _rParaRow; }
279 29 : inline void setEvaluationRow(const OValueRefRow& _aRow) { m_aEvaluateRow = _aRow; }
280 29 : inline void setParameterColumns(const ::rtl::Reference<connectivity::OSQLColumns>& _xParamColumns) { m_xParamColumns = _xParamColumns; }
281 29 : inline void setAssignValues(const ORefAssignValues& _aAssignValues) { m_aAssignValues = _aAssignValues; }
282 29 : inline void setBindingRow(const OValueRefRow& _aRow) { m_aRow = _aRow; }
283 29 : inline void setSelectRow(const OValueRefRow& _rRow)
284 : {
285 29 : m_aSelectRow = _rRow;
286 29 : m_nColumnCount = m_aSelectRow->get().size();
287 29 : }
288 29 : inline void setColumnMapping(const ::std::vector<sal_Int32>& _aColumnMapping) { m_aColMapping = _aColumnMapping; }
289 29 : inline void setSqlAnalyzer(OSQLAnalyzer* _pSQLAnalyzer) { m_pSQLAnalyzer = _pSQLAnalyzer; }
290 :
291 29 : inline void setOrderByColumns(const ::std::vector<sal_Int32>& _aColumnOrderBy) { m_aOrderbyColumnNumber = _aColumnOrderBy; }
292 29 : inline void setOrderByAscending(const ::std::vector<TAscendingOrder>& _aOrderbyAsc) { m_aOrderbyAscending = _aOrderbyAsc; }
293 29 : inline void setEvaluationKeySet(TIntVector* _pEvaluationKeySet) { m_pEvaluationKeySet = _pEvaluationKeySet; }
294 29 : inline void setMetaData(const ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XResultSetMetaData>& _xMetaData) { m_xMetaData = _xMetaData;}
295 :
296 : static void setBoundedColumns(const OValueRefRow& _rRow,
297 : const OValueRefRow& _rSelectRow,
298 : const ::rtl::Reference<connectivity::OSQLColumns>& _rxColumns,
299 : const ::com::sun::star::uno::Reference< ::com::sun::star::container::XIndexAccess>& _xNames,
300 : bool _bSetColumnMapping,
301 : const ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XDatabaseMetaData>& _xMetaData,
302 : ::std::vector<sal_Int32>& _rColMapping);
303 :
304 : // IResultSetHelper
305 : virtual bool move(IResultSetHelper::Movement _eCursorPosition, sal_Int32 _nOffset, bool _bRetrieveData) SAL_OVERRIDE;
306 : virtual sal_Int32 getDriverPos() const SAL_OVERRIDE;
307 : virtual bool deletedVisible() const SAL_OVERRIDE;
308 : virtual bool isRowDeleted() const SAL_OVERRIDE;
309 : };
310 :
311 5 : inline sal_Int32 OResultSet::mapColumn(sal_Int32 column)
312 : {
313 5 : sal_Int32 map = column;
314 :
315 : OSL_ENSURE(column > 0, "file::OResultSet::mapColumn: invalid column index!");
316 : // the first column (index 0) is for convenience only. The first real select column is number 1.
317 5 : if ((column > 0) && (column < (sal_Int32)m_aColMapping.size()))
318 5 : map = m_aColMapping[column];
319 :
320 5 : return map;
321 : }
322 : }
323 : }
324 : #endif // _CONNECTIVITY_FILE_ORESULTSET_HXX_
325 :
326 :
327 : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|