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