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 _CONNECTIVITY_FILE_FRESULTSET_HXX_
21 : #define _CONNECTIVITY_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 everytime
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 : sal_Bool m_bWasNull;
125 : sal_Bool m_bEOF; // after last record
126 : sal_Bool m_bLastRecord;
127 : sal_Bool m_bInserted; // true when moveToInsertRow was called
128 : // set to false when cursor moved or cancel
129 : sal_Bool m_bRowUpdated;
130 : sal_Bool m_bRowInserted;
131 : sal_Bool m_bRowDeleted;
132 : sal_Bool m_bShowDeleted;
133 : sal_Bool m_bIsCount;
134 :
135 : void initializeRow(OValueRefRow& _rRow,sal_Int32 _nColumnCount);
136 : void construct();
137 : //sal_Bool evaluate();
138 :
139 : sal_Bool ExecuteRow(IResultSetHelper::Movement eFirstCursorPosition,
140 : sal_Int32 nOffset = 1,
141 : sal_Bool bEvaluate = sal_True,
142 : sal_Bool bRetrieveData = sal_True);
143 :
144 : OKeyValue* GetOrderbyKeyValue(OValueRefRow& _rRow);
145 0 : sal_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 0 : inline sal_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 ) throw(::com::sun::star::sdbc::SQLException);
152 : void updateValue(sal_Int32 columnIndex,const ORowSetValue& x ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
153 : // clear insert row
154 : void clearInsertRow();
155 : void sortRows();
156 : protected:
157 :
158 : using OResultSet_BASE::rBHelper;
159 :
160 : sal_Bool Move(IResultSetHelper::Movement eCursorPosition, sal_Int32 nOffset, sal_Bool bRetrieveData);
161 : virtual sal_Bool fillIndexValues(const ::com::sun::star::uno::Reference< ::com::sun::star::sdbcx::XColumnsSupplier> &_xIndex);
162 :
163 : // OPropertyArrayUsageHelper
164 : virtual ::cppu::IPropertyArrayHelper* createArrayHelper( ) const SAL_OVERRIDE;
165 : // OPropertySetHelper
166 : virtual ::cppu::IPropertyArrayHelper & SAL_CALL getInfoHelper() SAL_OVERRIDE;
167 :
168 : virtual ~OResultSet();
169 : public:
170 : DECLARE_SERVICE_INFO();
171 : // a Constructor, that is needed for when Returning the Object is needed:
172 : OResultSet( OStatement_Base* pStmt,connectivity::OSQLParseTreeIterator& _aSQLIterator);
173 :
174 : ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > operator *()
175 : {
176 : return ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface >(*(OResultSet_BASE*)this);
177 : }
178 :
179 : // ::cppu::OComponentHelper
180 : virtual void SAL_CALL disposing(void) SAL_OVERRIDE;
181 : // XInterface
182 : 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;
183 : virtual void SAL_CALL acquire() throw() SAL_OVERRIDE;
184 : virtual void SAL_CALL release() throw() SAL_OVERRIDE;
185 : //XTypeProvider
186 : virtual ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Type > SAL_CALL getTypes( ) throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
187 : // XPropertySet
188 : virtual ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySetInfo > SAL_CALL getPropertySetInfo( ) throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
189 : // XResultSet
190 : virtual sal_Bool SAL_CALL next( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
191 : virtual sal_Bool SAL_CALL isBeforeFirst( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
192 : virtual sal_Bool SAL_CALL isAfterLast( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
193 : virtual sal_Bool SAL_CALL isFirst( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
194 : virtual sal_Bool SAL_CALL isLast( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
195 : virtual void SAL_CALL beforeFirst( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
196 : virtual void SAL_CALL afterLast( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
197 : virtual sal_Bool SAL_CALL first( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
198 : virtual sal_Bool SAL_CALL last( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
199 : virtual sal_Int32 SAL_CALL getRow( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
200 : virtual sal_Bool SAL_CALL absolute( sal_Int32 row ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
201 : virtual sal_Bool SAL_CALL relative( sal_Int32 rows ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
202 : virtual sal_Bool SAL_CALL previous( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
203 : virtual void SAL_CALL refreshRow( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
204 : virtual sal_Bool SAL_CALL rowUpdated( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
205 : virtual sal_Bool SAL_CALL rowInserted( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
206 : virtual sal_Bool SAL_CALL rowDeleted( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
207 : 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;
208 : // XRow
209 : virtual sal_Bool SAL_CALL wasNull( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
210 : virtual OUString SAL_CALL getString( sal_Int32 columnIndex ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
211 : virtual sal_Bool SAL_CALL getBoolean( sal_Int32 columnIndex ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
212 : virtual sal_Int8 SAL_CALL getByte( sal_Int32 columnIndex ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
213 : virtual sal_Int16 SAL_CALL getShort( sal_Int32 columnIndex ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
214 : virtual sal_Int32 SAL_CALL getInt( sal_Int32 columnIndex ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
215 : virtual sal_Int64 SAL_CALL getLong( sal_Int32 columnIndex ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
216 : virtual float SAL_CALL getFloat( sal_Int32 columnIndex ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
217 : virtual double SAL_CALL getDouble( sal_Int32 columnIndex ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
218 : 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;
219 : 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;
220 : 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;
221 : 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;
222 : 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;
223 : 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;
224 : 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;
225 : 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;
226 : 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;
227 : 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;
228 : 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;
229 : // XResultSetMetaDataSupplier
230 : 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;
231 : // XCancellable
232 : virtual void SAL_CALL cancel( ) throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
233 : // XCloseable
234 : virtual void SAL_CALL close( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
235 : // XWarningsSupplier
236 : virtual ::com::sun::star::uno::Any SAL_CALL getWarnings( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
237 : virtual void SAL_CALL clearWarnings( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
238 : // XResultSetUpdate
239 : virtual void SAL_CALL insertRow( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
240 : virtual void SAL_CALL updateRow( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
241 : virtual void SAL_CALL deleteRow( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
242 : virtual void SAL_CALL cancelRowUpdates( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
243 : virtual void SAL_CALL moveToInsertRow( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
244 : virtual void SAL_CALL moveToCurrentRow( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
245 : // XRowUpdate
246 : virtual void SAL_CALL updateNull( sal_Int32 columnIndex ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
247 : 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;
248 : 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;
249 : 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;
250 : 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;
251 : 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;
252 : 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;
253 : 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;
254 : 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;
255 : 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;
256 : 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;
257 : 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;
258 : 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;
259 : 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;
260 : 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;
261 : 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;
262 : 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;
263 : // XColumnLocate
264 : virtual sal_Int32 SAL_CALL findColumn( const OUString& columnName ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
265 : // com::sun::star::lang::XUnoTunnel
266 : 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;
267 : static ::com::sun::star::uno::Sequence< sal_Int8 > getUnoTunnelImplementationId();
268 : //XEventlistener
269 : virtual void SAL_CALL disposing( const ::com::sun::star::lang::EventObject& Source ) throw (::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
270 :
271 : // special methods
272 : inline sal_Int32 mapColumn(sal_Int32 column);
273 : virtual sal_Bool OpenImpl();
274 : virtual void doTableSpecials(const OSQLTable& _xTable);
275 :
276 0 : inline sal_Int32 getRowCountResult() const { return m_nRowCountResult; }
277 0 : inline void setParameterRow(const OValueRefRow& _rParaRow) { m_aParameterRow = _rParaRow; }
278 0 : inline void setEvaluationRow(const OValueRefRow& _aRow) { m_aEvaluateRow = _aRow; }
279 0 : inline void setParameterColumns(const ::rtl::Reference<connectivity::OSQLColumns>& _xParamColumns) { m_xParamColumns = _xParamColumns; }
280 0 : inline void setAssignValues(const ORefAssignValues& _aAssignValues) { m_aAssignValues = _aAssignValues; }
281 0 : inline void setBindingRow(const OValueRefRow& _aRow) { m_aRow = _aRow; }
282 0 : inline void setSelectRow(const OValueRefRow& _rRow)
283 : {
284 0 : m_aSelectRow = _rRow;
285 0 : m_nColumnCount = m_aSelectRow->get().size();
286 0 : }
287 0 : inline void setColumnMapping(const ::std::vector<sal_Int32>& _aColumnMapping) { m_aColMapping = _aColumnMapping; }
288 0 : inline void setSqlAnalyzer(OSQLAnalyzer* _pSQLAnalyzer) { m_pSQLAnalyzer = _pSQLAnalyzer; }
289 :
290 0 : inline void setOrderByColumns(const ::std::vector<sal_Int32>& _aColumnOrderBy) { m_aOrderbyColumnNumber = _aColumnOrderBy; }
291 0 : inline void setOrderByAscending(const ::std::vector<TAscendingOrder>& _aOrderbyAsc) { m_aOrderbyAscending = _aOrderbyAsc; }
292 0 : inline void setEvaluationKeySet(TIntVector* _pEvaluationKeySet) { m_pEvaluationKeySet = _pEvaluationKeySet; }
293 0 : inline void setMetaData(const ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XResultSetMetaData>& _xMetaData) { m_xMetaData = _xMetaData;}
294 :
295 : static void setBoundedColumns(const OValueRefRow& _rRow,
296 : const OValueRefRow& _rSelectRow,
297 : const ::rtl::Reference<connectivity::OSQLColumns>& _rxColumns,
298 : const ::com::sun::star::uno::Reference< ::com::sun::star::container::XIndexAccess>& _xNames,
299 : sal_Bool _bSetColumnMapping,
300 : const ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XDatabaseMetaData>& _xMetaData,
301 : ::std::vector<sal_Int32>& _rColMapping);
302 :
303 : // IResultSetHelper
304 : virtual sal_Bool move(IResultSetHelper::Movement _eCursorPosition, sal_Int32 _nOffset, sal_Bool _bRetrieveData) SAL_OVERRIDE;
305 : virtual sal_Int32 getDriverPos() const SAL_OVERRIDE;
306 : virtual sal_Bool deletedVisible() const SAL_OVERRIDE;
307 : virtual sal_Bool isRowDeleted() const SAL_OVERRIDE;
308 : };
309 :
310 0 : inline sal_Int32 OResultSet::mapColumn(sal_Int32 column)
311 : {
312 0 : sal_Int32 map = column;
313 :
314 : OSL_ENSURE(column > 0, "file::OResultSet::mapColumn: invalid column index!");
315 : // the first column (index 0) is for convenience only. The first real select column is number 1.
316 0 : if ((column > 0) && (column < (sal_Int32)m_aColMapping.size()))
317 0 : map = m_aColMapping[column];
318 :
319 0 : return map;
320 : }
321 : }
322 : }
323 : #endif // _CONNECTIVITY_FILE_ORESULTSET_HXX_
324 :
325 :
326 : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|