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