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