1 /**************************************************************
2  *
3  * Licensed to the Apache Software Foundation (ASF) under one
4  * or more contributor license agreements.  See the NOTICE file
5  * distributed with this work for additional information
6  * regarding copyright ownership.  The ASF licenses this file
7  * to you under the Apache License, Version 2.0 (the
8  * "License"); you may not use this file except in compliance
9  * with the License.  You may obtain a copy of the License at
10  *
11  *   http://www.apache.org/licenses/LICENSE-2.0
12  *
13  * Unless required by applicable law or agreed to in writing,
14  * software distributed under the License is distributed on an
15  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16  * KIND, either express or implied.  See the License for the
17  * specific language governing permissions and limitations
18  * under the License.
19  *
20  *************************************************************/
21 
22 
23 
24 #ifndef _CONNECTIVITY_FILE_FRESULTSET_HXX_
25 #define _CONNECTIVITY_FILE_FRESULTSET_HXX_
26 
27 #ifndef _COM_SUN_STAR_SQLC_XRESULTSET_HPP_
28 #include <com/sun/star/sdbc/XResultSet.hpp>
29 #endif
30 #ifndef _COM_SUN_STAR_SQLC_XROW_HPP_
31 #include <com/sun/star/sdbc/XRow.hpp>
32 #endif
33 #ifndef _COM_SUN_STAR_SQLC_XRESULTSETMETADATASUPPLIER_HPP_
34 #include <com/sun/star/sdbc/XResultSetMetaDataSupplier.hpp>
35 #endif
36 #ifndef _COM_SUN_STAR_SQLC_XCLOSEABLE_HPP_
37 #include <com/sun/star/sdbc/XCloseable.hpp>
38 #endif
39 #ifndef _COM_SUN_STAR_SQLC_XCOLUMNLOCATE_HPP_
40 #include <com/sun/star/sdbc/XColumnLocate.hpp>
41 #endif
42 #include <com/sun/star/util/XCancellable.hpp>
43 #ifndef _COM_SUN_STAR_SQLC_XWARNINGSSUPPLIER_HPP_
44 #include <com/sun/star/sdbc/XWarningsSupplier.hpp>
45 #endif
46 #ifndef _COM_SUN_STAR_SQLC_XRESULTSETUPDATE_HPP_
47 #include <com/sun/star/sdbc/XResultSetUpdate.hpp>
48 #endif
49 #ifndef _COM_SUN_STAR_SQLC_XROWUPDATE_HPP_
50 #include <com/sun/star/sdbc/XRowUpdate.hpp>
51 #endif
52 #include <cppuhelper/compbase12.hxx>
53 #include <comphelper/proparrhlp.hxx>
54 #include "file/FStatement.hxx"
55 #include "connectivity/CommonTools.hxx"
56 #include <comphelper/propertycontainer.hxx>
57 #include "file/fanalyzer.hxx"
58 #include "file/FTable.hxx"
59 #include "file/filedllapi.hxx"
60 #include <comphelper/broadcasthelper.hxx>
61 #include "connectivity/StdTypeDefs.hxx"
62 #include "TSortIndex.hxx"
63 #include "TSkipDeletedSet.hxx"
64 #include <com/sun/star/lang/XEventListener.hpp>
65 
66 namespace connectivity
67 {
68 	namespace file
69 	{
70 		/*
71 		**	java_sql_ResultSet
72 		*/
73         typedef ::cppu::WeakComponentImplHelper12<  ::com::sun::star::sdbc::XResultSet,
74                                                     ::com::sun::star::sdbc::XRow,
75                                                     ::com::sun::star::sdbc::XResultSetMetaDataSupplier,
76                                                     ::com::sun::star::util::XCancellable,
77                                                     ::com::sun::star::sdbc::XWarningsSupplier,
78                                                     ::com::sun::star::sdbc::XResultSetUpdate,
79                                                     ::com::sun::star::sdbc::XRowUpdate,
80                                                     ::com::sun::star::sdbc::XCloseable,
81                                                     ::com::sun::star::sdbc::XColumnLocate,
82                                                     ::com::sun::star::lang::XServiceInfo,
83 													::com::sun::star::lang::XEventListener,
84 													::com::sun::star::lang::XUnoTunnel> OResultSet_BASE;
85 
86 		class OOO_DLLPUBLIC_FILE OResultSet :
87                             public	comphelper::OBaseMutex,
88 							public	::connectivity::IResultSetHelper,
89 							public	OResultSet_BASE,
90 							public	::comphelper::OPropertyContainer,
91 							public	::comphelper::OPropertyArrayUsageHelper<OResultSet>
92 		{
93 
94 		protected:
95 			::std::vector<void*>					m_aBindVector;
96 			::std::vector<sal_Int32>				m_aColMapping; // pos 0 is unused so we don't have to decrement 1 every time
97 
98 			::std::vector<sal_Int32>				m_aOrderbyColumnNumber;
99             ::std::vector<TAscendingOrder>          m_aOrderbyAscending;
100 
101 			OValueRefRow							m_aSelectRow;
102 			OValueRefRow							m_aRow;
103 			OValueRefRow							m_aEvaluateRow; // contains all values of a row
104 			OValueRefRow							m_aParameterRow;
105 			OValueRefRow							m_aInsertRow;	// needed for insert by cursor
106 			ORefAssignValues						m_aAssignValues; // needed for insert,update and parameters
107 																	// to compare with the restrictions
108 			TIntVector*								m_pEvaluationKeySet;
109 			TIntVector::iterator					m_aEvaluateIter;
110 
111 
112 //			TInt2IntMap								m_aBookmarks;		  // map from bookmarks to logical position
113 //			::std::vector<TInt2IntMap::iterator>	m_aBookmarksPositions;// vector of iterators to bookmark map, the order is the logical position
114 			OSkipDeletedSet							m_aSkipDeletedSet;
115 
116 			::vos::ORef<OKeySet>					m_pFileSet;
117 			OKeySet::Vector::iterator				m_aFileSetIter;
118 
119 
120 
121 			OSortIndex*								m_pSortIndex;
122 			::vos::ORef<connectivity::OSQLColumns>	m_xColumns;	// this are the select columns
123 			::vos::ORef<connectivity::OSQLColumns>	m_xParamColumns;
124 			OFileTable*								m_pTable;
125 			connectivity::OSQLParseNode*			m_pParseTree;
126 
127 			OSQLAnalyzer*							m_pSQLAnalyzer;
128 			connectivity::OSQLParseTreeIterator&	m_aSQLIterator;
129 
130 			sal_Int32								m_nFetchSize;
131 			sal_Int32								m_nResultSetType;
132 			sal_Int32								m_nFetchDirection;
133 			sal_Int32								m_nResultSetConcurrency;
134 
135 			::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface>			m_xStatement;
136             ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XResultSetMetaData>	m_xMetaData;
137             ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XDatabaseMetaData>	m_xDBMetaData;
138 			::com::sun::star::uno::Reference< ::com::sun::star::container::XNameAccess>		m_xColNames; // table columns
139 			::com::sun::star::uno::Reference< ::com::sun::star::container::XIndexAccess>	m_xColsIdx; // table columns
140 
141 
142 			::rtl::OUString							m_aTableRange;
143 			rtl_TextEncoding						m_nTextEncoding;
144 			sal_Int32								m_nRowPos;
145 			sal_Int32								m_nFilePos;
146 			sal_Int32								m_nLastVisitedPos;
147 			sal_Int32								m_nRowCountResult;
148 			sal_Int32								m_nCurrentPosition;		// current position of the resultset is returned when ask for getRow()
149             sal_Int32								m_nColumnCount;
150 			sal_Bool								m_bWasNull;
151 			sal_Bool								m_bEOF;					// after last record
152 			sal_Bool								m_bLastRecord;
153 			sal_Bool								m_bInserted;			// true when moveToInsertRow was called
154 																			// set to false when cursor moved or cancel
155 			sal_Bool								m_bRowUpdated;
156 			sal_Bool								m_bRowInserted;
157 			sal_Bool								m_bRowDeleted;
158 			sal_Bool								m_bShowDeleted;
159             sal_Bool								m_bIsCount;
160 
161 			void initializeRow(OValueRefRow& _rRow,sal_Int32 _nColumnCount);
162 			void construct();
163 			sal_Bool evaluate();
164 
165 			sal_Bool ExecuteRow(IResultSetHelper::Movement eFirstCursorPosition,
166 								sal_Int32 nOffset = 1,
167 								sal_Bool bEvaluate = sal_True,
168 								sal_Bool bRetrieveData = sal_True);
169 
170 			OKeyValue* GetOrderbyKeyValue(OValueRefRow& _rRow);
IsSorted() const171 			sal_Bool IsSorted() const { return !m_aOrderbyColumnNumber.empty() && m_aOrderbyColumnNumber[0] != SQL_COLUMN_NOTFOUND;}
172 
173 			// return true when the select statement is "select count(*) from table"
isCount() const174             inline sal_Bool isCount() const { return m_bIsCount; }
175 			void checkIndex(sal_Int32 columnIndex ) throw(::com::sun::star::sdbc::SQLException);
176 
177 			const ORowSetValue& getValue(sal_Int32 columnIndex ) throw(::com::sun::star::sdbc::SQLException);
178 			void updateValue(sal_Int32 columnIndex,const ORowSetValue& x ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
179 			// clear insert row
180 			void clearInsertRow();
181 			void sortRows();
182 		protected:
183 
184 			using OResultSet_BASE::rBHelper;
185 
186 			sal_Bool Move(IResultSetHelper::Movement eCursorPosition, sal_Int32 nOffset, sal_Bool bRetrieveData);
187 			virtual sal_Bool fillIndexValues(const ::com::sun::star::uno::Reference< ::com::sun::star::sdbcx::XColumnsSupplier> &_xIndex);
188 
189 			// OPropertyArrayUsageHelper
190 			virtual ::cppu::IPropertyArrayHelper* createArrayHelper( ) const;
191 			// OPropertySetHelper
192 			virtual ::cppu::IPropertyArrayHelper & SAL_CALL getInfoHelper();
193 
194 			virtual ~OResultSet();
195 		public:
196 			DECLARE_SERVICE_INFO();
197 			// ein Konstruktor, der fuer das Returnen des Objektes benoetigt wird:
198 			OResultSet( OStatement_Base* pStmt,connectivity::OSQLParseTreeIterator&	_aSQLIterator);
199 
operator *()200 			::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > operator *()
201 			{
202 				return ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface >(*(OResultSet_BASE*)this);
203 			}
204 
205 			// ::cppu::OComponentHelper
206 			virtual void SAL_CALL disposing(void);
207 			// XInterface
208 			virtual ::com::sun::star::uno::Any SAL_CALL queryInterface( const ::com::sun::star::uno::Type & rType ) throw(::com::sun::star::uno::RuntimeException);
209 			virtual void SAL_CALL acquire() throw();
210             virtual void SAL_CALL release() throw();
211 			//XTypeProvider
212 			virtual ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Type > SAL_CALL getTypes(  ) throw(::com::sun::star::uno::RuntimeException);
213 			// XPropertySet
214 			virtual ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySetInfo > SAL_CALL getPropertySetInfo(  ) throw(::com::sun::star::uno::RuntimeException);
215 			// XResultSet
216             virtual sal_Bool SAL_CALL next(  ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
217             virtual sal_Bool SAL_CALL isBeforeFirst(  ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
218             virtual sal_Bool SAL_CALL isAfterLast(  ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
219             virtual sal_Bool SAL_CALL isFirst(  ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
220             virtual sal_Bool SAL_CALL isLast(  ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
221             virtual void SAL_CALL beforeFirst(  ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
222             virtual void SAL_CALL afterLast(  ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
223             virtual sal_Bool SAL_CALL first(  ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
224             virtual sal_Bool SAL_CALL last(  ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
225             virtual sal_Int32 SAL_CALL getRow(  ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
226             virtual sal_Bool SAL_CALL absolute( sal_Int32 row ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
227             virtual sal_Bool SAL_CALL relative( sal_Int32 rows ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
228             virtual sal_Bool SAL_CALL previous(  ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
229             virtual void SAL_CALL refreshRow(  ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
230             virtual sal_Bool SAL_CALL rowUpdated(  ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
231             virtual sal_Bool SAL_CALL rowInserted(  ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
232             virtual sal_Bool SAL_CALL rowDeleted(  ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
233             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);
234 			// XRow
235             virtual sal_Bool SAL_CALL wasNull(  ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
236             virtual ::rtl::OUString SAL_CALL getString( sal_Int32 columnIndex ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
237             virtual sal_Bool SAL_CALL getBoolean( sal_Int32 columnIndex ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
238             virtual sal_Int8 SAL_CALL getByte( sal_Int32 columnIndex ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
239             virtual sal_Int16 SAL_CALL getShort( sal_Int32 columnIndex ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
240             virtual sal_Int32 SAL_CALL getInt( sal_Int32 columnIndex ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
241             virtual sal_Int64 SAL_CALL getLong( sal_Int32 columnIndex ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
242             virtual float SAL_CALL getFloat( sal_Int32 columnIndex ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
243             virtual double SAL_CALL getDouble( sal_Int32 columnIndex ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
244             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);
245             virtual ::com::sun::star::util::Date SAL_CALL getDate( sal_Int32 columnIndex ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
246             virtual ::com::sun::star::util::Time SAL_CALL getTime( sal_Int32 columnIndex ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
247             virtual ::com::sun::star::util::DateTime SAL_CALL getTimestamp( sal_Int32 columnIndex ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
248             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);
249             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);
250             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);
251             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);
252             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);
253             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);
254             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);
255 			// XResultSetMetaDataSupplier
256             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);
257 			// XCancellable
258 			virtual void SAL_CALL cancel(  ) throw(::com::sun::star::uno::RuntimeException);
259 			// XCloseable
260             virtual void SAL_CALL close(  ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
261 			// XWarningsSupplier
262             virtual ::com::sun::star::uno::Any SAL_CALL getWarnings(  ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
263             virtual void SAL_CALL clearWarnings(  ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
264 			// XResultSetUpdate
265             virtual void SAL_CALL insertRow(  ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
266             virtual void SAL_CALL updateRow(  ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
267             virtual void SAL_CALL deleteRow(  ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
268             virtual void SAL_CALL cancelRowUpdates(  ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
269             virtual void SAL_CALL moveToInsertRow(  ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
270             virtual void SAL_CALL moveToCurrentRow(  ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
271 			// XRowUpdate
272             virtual void SAL_CALL updateNull( sal_Int32 columnIndex ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
273             virtual void SAL_CALL updateBoolean( sal_Int32 columnIndex, sal_Bool x ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
274             virtual void SAL_CALL updateByte( sal_Int32 columnIndex, sal_Int8 x ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
275             virtual void SAL_CALL updateShort( sal_Int32 columnIndex, sal_Int16 x ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
276             virtual void SAL_CALL updateInt( sal_Int32 columnIndex, sal_Int32 x ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
277             virtual void SAL_CALL updateLong( sal_Int32 columnIndex, sal_Int64 x ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
278             virtual void SAL_CALL updateFloat( sal_Int32 columnIndex, float x ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
279             virtual void SAL_CALL updateDouble( sal_Int32 columnIndex, double x ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
280             virtual void SAL_CALL updateString( sal_Int32 columnIndex, const ::rtl::OUString& x ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
281             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);
282             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);
283             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);
284             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);
285             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);
286             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);
287             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);
288             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);
289 			// XColumnLocate
290             virtual sal_Int32 SAL_CALL findColumn( const ::rtl::OUString& columnName ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
291 			// com::sun::star::lang::XUnoTunnel
292 			virtual sal_Int64 SAL_CALL getSomething( const ::com::sun::star::uno::Sequence< sal_Int8 >& aIdentifier ) throw(::com::sun::star::uno::RuntimeException);
293 			static ::com::sun::star::uno::Sequence< sal_Int8 > getUnoTunnelImplementationId();
294 			//XEventlistener
295 			virtual void SAL_CALL disposing( const ::com::sun::star::lang::EventObject& Source ) throw (::com::sun::star::uno::RuntimeException);
296 
297 			// special methods
298 			inline sal_Int32 mapColumn(sal_Int32	column);
299 			virtual sal_Bool OpenImpl();
300 			virtual void doTableSpecials(const OSQLTable& _xTable);
301 
getRowCountResult() const302 			inline sal_Int32 getRowCountResult() const { return m_nRowCountResult; }
setParameterRow(const OValueRefRow & _rParaRow)303             inline void setParameterRow(const OValueRefRow& _rParaRow)					{ m_aParameterRow = _rParaRow; }
setEvaluationRow(const OValueRefRow & _aRow)304 			inline void setEvaluationRow(const OValueRefRow& _aRow)						{ m_aEvaluateRow = _aRow; }
setParameterColumns(const::vos::ORef<connectivity::OSQLColumns> & _xParamColumns)305 			inline void setParameterColumns(const ::vos::ORef<connectivity::OSQLColumns>&	_xParamColumns) { m_xParamColumns = _xParamColumns; }
setAssignValues(const ORefAssignValues & _aAssignValues)306 			inline void setAssignValues(const ORefAssignValues& _aAssignValues)			{ m_aAssignValues = _aAssignValues; }
setBindingRow(const OValueRefRow & _aRow)307 			inline void setBindingRow(const OValueRefRow& _aRow)						{ m_aRow = _aRow; }
setSelectRow(const OValueRefRow & _rRow)308 			inline void setSelectRow(const OValueRefRow& _rRow)
309             {
310                 m_aSelectRow = _rRow;
311                 m_nColumnCount = m_aSelectRow->get().size();
312             }
setColumnMapping(const::std::vector<sal_Int32> & _aColumnMapping)313 			inline void setColumnMapping(const ::std::vector<sal_Int32>& _aColumnMapping)	{ m_aColMapping = _aColumnMapping; }
setSqlAnalyzer(OSQLAnalyzer * _pSQLAnalyzer)314 			inline void setSqlAnalyzer(OSQLAnalyzer* _pSQLAnalyzer)						{ m_pSQLAnalyzer = _pSQLAnalyzer; }
315 
setOrderByColumns(const::std::vector<sal_Int32> & _aColumnOrderBy)316 			inline void setOrderByColumns(const ::std::vector<sal_Int32>& _aColumnOrderBy)	{ m_aOrderbyColumnNumber = _aColumnOrderBy; }
setOrderByAscending(const::std::vector<TAscendingOrder> & _aOrderbyAsc)317             inline void setOrderByAscending(const ::std::vector<TAscendingOrder>& _aOrderbyAsc)    { m_aOrderbyAscending = _aOrderbyAsc; }
setEvaluationKeySet(TIntVector * _pEvaluationKeySet)318 			inline void setEvaluationKeySet(TIntVector* _pEvaluationKeySet)				{ m_pEvaluationKeySet = _pEvaluationKeySet; }
setMetaData(const::com::sun::star::uno::Reference<::com::sun::star::sdbc::XResultSetMetaData> & _xMetaData)319             inline void setMetaData(const ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XResultSetMetaData>& _xMetaData) { m_xMetaData = _xMetaData;}
320 
321 			// clears the resultset so it can be reused by a preparedstatement
322 			void clear();
323 			static void setBoundedColumns(const OValueRefRow& _rRow,
324 									const OValueRefRow& _rSelectRow,
325 									const ::vos::ORef<connectivity::OSQLColumns>& _rxColumns,
326 									const ::com::sun::star::uno::Reference< ::com::sun::star::container::XIndexAccess>& _xNames,
327 									sal_Bool _bSetColumnMapping,
328 									const ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XDatabaseMetaData>& _xMetaData,
329 									::std::vector<sal_Int32>& _rColMapping);
330 
331 			// IResultSetHelper
332 			virtual sal_Bool move(IResultSetHelper::Movement _eCursorPosition, sal_Int32 _nOffset, sal_Bool _bRetrieveData);
333 			virtual sal_Int32 getDriverPos() const;
334 			virtual sal_Bool deletedVisible() const;
335 			virtual sal_Bool isRowDeleted() const;
336 		};
337 		// -------------------------------------------------------------------------
mapColumn(sal_Int32 column)338 		inline sal_Int32 OResultSet::mapColumn(sal_Int32 column)
339 		{
340 			sal_Int32	map = column;
341 
342 			OSL_ENSURE(column > 0, "file::OResultSet::mapColumn: invalid column index!");
343 				// the first column (index 0) is for convenience only. The first real select column is no 1.
344 			if ((column > 0) && (column < (sal_Int32)m_aColMapping.size()))
345 				map = m_aColMapping[column];
346 
347 			return map;
348 		}
349 	}
350 }
351 #endif // _CONNECTIVITY_FILE_ORESULTSET_HXX_
352 
353 
354