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