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