LibreOffice Module dbaccess (master) 1
CacheSet.cxx
Go to the documentation of this file.
1/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2/*
3 * This file is part of the LibreOffice project.
4 *
5 * This Source Code Form is subject to the terms of the Mozilla Public
6 * License, v. 2.0. If a copy of the MPL was not distributed with this
7 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
8 *
9 * This file incorporates work covered by the following license notice:
10 *
11 * Licensed to the Apache Software Foundation (ASF) under one or more
12 * contributor license agreements. See the NOTICE file distributed
13 * with this work for additional information regarding copyright
14 * ownership. The ASF licenses this file to you under the Apache
15 * License, Version 2.0 (the "License"); you may not use this file
16 * except in compliance with the License. You may obtain a copy of
17 * the License at http://www.apache.org/licenses/LICENSE-2.0 .
18 */
19
20#include "CacheSet.hxx"
21#include <core_resource.hxx>
22#include <strings.hrc>
23#include <strings.hxx>
24#include <com/sun/star/container/XIndexAccess.hpp>
25#include <com/sun/star/sdbc/XResultSetMetaDataSupplier.hpp>
26#include <com/sun/star/beans/XPropertySet.hpp>
27#include <com/sun/star/sdbc/XDatabaseMetaData.hpp>
28#include <com/sun/star/sdbc/XPreparedStatement.hpp>
29#include <com/sun/star/sdbc/ColumnValue.hpp>
30#include <com/sun/star/sdbc/XParameters.hpp>
31#include <com/sun/star/sdbcx/XIndexesSupplier.hpp>
32
34#include <com/sun/star/io/XInputStream.hpp>
35#include <comphelper/types.hxx>
36#include <rtl/ustrbuf.hxx>
37#include <sal/log.hxx>
38#include <osl/diagnose.h>
40
41using namespace comphelper;
42
43using namespace dbaccess;
44using namespace dbtools;
45using namespace connectivity;
46using namespace ::com::sun::star::uno;
47using namespace ::com::sun::star::beans;
48using namespace ::com::sun::star::sdbc;
49using namespace ::com::sun::star::sdbcx;
50using namespace ::com::sun::star::container;
51using namespace ::com::sun::star::lang;
52using namespace ::com::sun::star::io;
53using namespace ::osl;
54
55
56OCacheSet::OCacheSet(sal_Int32 i_nMaxRows)
57 :m_nMaxRows(i_nMaxRows)
58 ,m_bInserted(false)
59 ,m_bUpdated(false)
60 ,m_bDeleted(false)
61{
62
63}
64
66{
67 OUString sQuote;
68 if ( m_xConnection.is() )
69 if (auto xMeta = m_xConnection->getMetaData())
70 sQuote = xMeta->getIdentifierQuoteString();
71 return sQuote;
72}
73
74void OCacheSet::construct( const Reference< XResultSet>& _xDriverSet,const OUString &i_sRowSetFilter)
75{
76 OSL_ENSURE(_xDriverSet.is(),"Invalid resultSet");
77
78 m_sRowSetFilter = i_sRowSetFilter;
79
80 if(!_xDriverSet.is())
81 return;
82
83 m_xDriverSet = _xDriverSet;
84 m_xDriverRow.set(_xDriverSet,UNO_QUERY);
85 m_xSetMetaData = Reference<XResultSetMetaDataSupplier>(_xDriverSet,UNO_QUERY_THROW)->getMetaData();
86 if ( m_xSetMetaData.is() )
87 {
88 const sal_Int32 nCount = m_xSetMetaData->getColumnCount();
89 m_aNullable.resize(nCount);
90 m_aSignedFlags.resize(nCount);
91 m_aColumnTypes.resize(nCount);
92 auto pNullableIter = m_aNullable.begin();
93 auto pSignedIter = m_aSignedFlags.begin();
94 auto pColumnIter = m_aColumnTypes.begin();
95 for (sal_Int32 i=1; i <= nCount; ++i,++pSignedIter,++pColumnIter,++pNullableIter)
96 {
97 *pNullableIter = m_xSetMetaData->isNullable(i) != ColumnValue::NO_NULLS;
98 *pSignedIter = m_xSetMetaData->isSigned(i);
99 *pColumnIter = m_xSetMetaData->getColumnType(i);
100 }
101 }
102 Reference< XStatement> xStmt(m_xDriverSet->getStatement(),UNO_QUERY);
103 if(xStmt.is())
104 m_xConnection = xStmt->getConnection();
105 else
106 {
107 Reference< XPreparedStatement> xPrepStmt(m_xDriverSet->getStatement(),UNO_QUERY);
108 if ( xPrepStmt.is() )
109 m_xConnection = xPrepStmt->getConnection();
110 }
111}
112
114{
115 try
116 {
117 m_xDriverSet = nullptr;
118 m_xDriverRow = nullptr;
119 m_xSetMetaData = nullptr;
120 m_xConnection = nullptr;
121 }
122 catch(Exception&)
123 {
124 TOOLS_WARN_EXCEPTION("dbaccess", "");
125 }
126 catch(...)
127 {
128 SAL_WARN("dbaccess", "Unknown Exception occurred");
129 }
130
131}
132
133void OCacheSet::fillTableName(const Reference<XPropertySet>& _xTable)
134{
135 OSL_ENSURE(_xTable.is(),"OCacheSet::fillTableName: PropertySet is empty!");
136 if(m_aComposedTableName.isEmpty() && _xTable.is() )
137 {
138 Reference<XDatabaseMetaData> xMeta(m_xConnection->getMetaData());
140 ,comphelper::getString(_xTable->getPropertyValue(PROPERTY_CATALOGNAME))
141 ,comphelper::getString(_xTable->getPropertyValue(PROPERTY_SCHEMANAME))
142 ,comphelper::getString(_xTable->getPropertyValue(PROPERTY_NAME))
143 ,true
144 ,::dbtools::EComposeRule::InDataManipulation);
145 }
146}
147
148void OCacheSet::insertRow( const ORowSetRow& _rInsertRow,const connectivity::OSQLTable& _xTable )
149{
150 Reference<XPropertySet> xSet(_xTable,UNO_QUERY);
151 fillTableName(xSet);
152
153 OUStringBuffer aSql("INSERT INTO " + m_aComposedTableName + " ( ");
154
155 // set values and column names
156 OUStringBuffer aValues(" VALUES ( ");
157 OUString aQuote = getIdentifierQuoteString();
158 sal_Int32 i = 1;
159 ORowVector< ORowSetValue >::Vector::const_iterator aIter = _rInsertRow->begin()+1;
160 connectivity::ORowVector< ORowSetValue > ::Vector::iterator aEnd = _rInsertRow->end();
161 for(; aIter != aEnd;++aIter)
162 {
163 aSql.append(::dbtools::quoteName( aQuote,m_xSetMetaData->getColumnName(i++)) + ",");
164 aValues.append("?,");
165 }
166
167 aSql[aSql.getLength() - 1] = ')';
168 aValues[aValues.getLength() - 1] = ')';
169
170 aSql.append(aValues);
171 // now create end execute the prepared statement
172 {
173 Reference< XPreparedStatement > xPrep(m_xConnection->prepareStatement(aSql.makeStringAndClear()));
174 Reference< XParameters > xParameter(xPrep,UNO_QUERY);
175 i = 1;
176 for(aIter = _rInsertRow->begin()+1; aIter != aEnd;++aIter,++i)
177 {
178 if(aIter->isNull())
179 xParameter->setNull(i,aIter->getTypeKind());
180 else
181 setParameter(i,xParameter,*aIter,m_xSetMetaData->getColumnType(i),m_xSetMetaData->getScale(i));
182 }
183
184 m_bInserted = xPrep->executeUpdate() > 0;
185 }
186
187 // TODO set the bookmark in the insert row
188}
189
191 ,const connectivity::OSQLTable& _xTable
192 ,OUStringBuffer& _sCondition
193 ,OUStringBuffer& _sParameter
194 ,std::vector< sal_Int32>& _rOrgValues)
195{
196 // use keys and indexes for exact positioning
197 // first the keys
198 Reference<XPropertySet> xSet(_xTable,UNO_QUERY);
199 const Reference<XNameAccess> xPrimaryKeyColumns = getPrimaryKeyColumns_throw(xSet);
200 // second the indexes
201 Reference<XIndexesSupplier> xIndexSup(_xTable,UNO_QUERY);
202 Reference<XIndexAccess> xIndexes;
203 if(xIndexSup.is())
204 xIndexes.set(xIndexSup->getIndexes(),UNO_QUERY);
205
206 Reference<XPropertySet> xIndexColsSup;
207 std::vector< Reference<XNameAccess> > aAllIndexColumns;
208 if(xIndexes.is())
209 {
210 for(sal_Int32 j=0;j<xIndexes->getCount();++j)
211 {
212 xIndexColsSup.set(xIndexes->getByIndex(j),UNO_QUERY);
213 if( xIndexColsSup.is()
214 && comphelper::getBOOL(xIndexColsSup->getPropertyValue(PROPERTY_ISUNIQUE))
215 && !comphelper::getBOOL(xIndexColsSup->getPropertyValue(PROPERTY_ISPRIMARYKEYINDEX))
216 )
217 aAllIndexColumns.push_back(Reference<XColumnsSupplier>(xIndexColsSup,UNO_QUERY_THROW)->getColumns());
218 }
219 }
220
221 OUString aColumnName;
222
223 static const char aAnd[] = " AND ";
224
225 OUString aQuote = getIdentifierQuoteString();
226
227 sal_Int32 nCheckCount = 1; // index for the original values
228 sal_Int32 i = 1;
229
230 OUString sIsNull(" IS NULL");
231 OUString sParam(" = ?");
234 for(; aIter != aEnd;++aIter,++nCheckCount,++i)
235 {
236 aColumnName = m_xSetMetaData->getColumnName(i);
237 if(xPrimaryKeyColumns.is() && xPrimaryKeyColumns->hasByName(aColumnName))
238 {
239 _sCondition.append(::dbtools::quoteName( aQuote,aColumnName));
240 if(aIter->isNull())
241 _sCondition.append(sIsNull);
242 else
243 _sCondition.append(sParam);
244 _sCondition.append(aAnd);
245 _rOrgValues.push_back(nCheckCount);
246
247 }
248 for (auto const& indexColumn : aAllIndexColumns)
249 {
250 if(indexColumn->hasByName(aColumnName))
251 {
252 _sCondition.append(::dbtools::quoteName( aQuote,aColumnName));
253 if(aIter->isNull())
254 _sCondition.append(sIsNull);
255 else
256 _sCondition.append(sParam);
257 _sCondition.append(aAnd);
258 _rOrgValues.push_back(nCheckCount);
259 break;
260 }
261 }
262 if(aIter->isModified())
263 {
264 _sParameter.append(::dbtools::quoteName( aQuote,aColumnName) + "?,");
265 }
266 }
267}
268
269void OCacheSet::updateRow(const ORowSetRow& _rInsertRow ,const ORowSetRow& _rOriginalRow,const connectivity::OSQLTable& _xTable )
270{
271 Reference<XPropertySet> xSet(_xTable,UNO_QUERY);
272 fillTableName(xSet);
273
274 OUStringBuffer aSql("UPDATE " + m_aComposedTableName + " SET ");
275 // list all columns that should be set
276
277 OUStringBuffer aCondition;
278 std::vector< sal_Int32> aOrgValues;
279 fillParameters(_rInsertRow,_xTable,aCondition,aSql,aOrgValues);
280 aSql[aSql.getLength() - 1] = ' ';
281 if ( !aCondition.isEmpty() )
282 {
283 aCondition.setLength(aCondition.getLength()-5);
284
285 aSql.append(" WHERE " + aCondition);
286 }
287 else
288 ::dbtools::throwSQLException(
289 DBA_RES( RID_STR_NO_UPDATE_MISSING_CONDITION ), StandardSQLState::GENERAL_ERROR, *this );
290
291 // now create end execute the prepared statement
292 Reference< XPreparedStatement > xPrep(m_xConnection->prepareStatement(aSql.makeStringAndClear()));
293 Reference< XParameters > xParameter(xPrep,UNO_QUERY);
294 sal_Int32 i = 1;
295 connectivity::ORowVector< ORowSetValue > ::Vector::iterator aEnd = _rInsertRow->end();
296 for(ORowVector< ORowSetValue >::Vector::const_iterator aIter = _rInsertRow->begin()+1; aIter != aEnd;++aIter)
297 {
298 if(aIter->isModified())
299 {
300 setParameter(i,xParameter,*aIter,m_xSetMetaData->getColumnType(i),m_xSetMetaData->getScale(i));
301 ++i;
302 }
303 }
304 for (auto const& orgValue : aOrgValues)
305 {
306 setParameter(i,xParameter,(*_rOriginalRow)[orgValue],m_xSetMetaData->getColumnType(i),m_xSetMetaData->getScale(i));
307 ++i;
308 }
309
310 m_bUpdated = xPrep->executeUpdate() > 0;
311}
312
313void OCacheSet::deleteRow(const ORowSetRow& _rDeleteRow ,const connectivity::OSQLTable& _xTable )
314{
315 Reference<XPropertySet> xSet(_xTable,UNO_QUERY);
316 fillTableName(xSet);
317
318 OUStringBuffer aSql("DELETE FROM " + m_aComposedTableName + " WHERE ");
319
320 // use keys and indexes for exact positioning
321 Reference<XIndexesSupplier> xIndexSup(_xTable,UNO_QUERY);
322 Reference<XIndexAccess> xIndexes;
323 if(xIndexSup.is())
324 xIndexes.set(xIndexSup->getIndexes(),UNO_QUERY);
325
326 // Reference<XColumnsSupplier>
327 Reference<XPropertySet> xIndexColsSup;
328 std::vector< Reference<XNameAccess> > aAllIndexColumns;
329 if(xIndexes.is())
330 {
331 for(sal_Int32 j=0;j<xIndexes->getCount();++j)
332 {
333 xIndexColsSup.set(xIndexes->getByIndex(j),UNO_QUERY);
334 if( xIndexColsSup.is()
335 && comphelper::getBOOL(xIndexColsSup->getPropertyValue(PROPERTY_ISUNIQUE))
336 && !comphelper::getBOOL(xIndexColsSup->getPropertyValue(PROPERTY_ISPRIMARYKEYINDEX))
337 )
338 aAllIndexColumns.push_back(Reference<XColumnsSupplier>(xIndexColsSup,UNO_QUERY_THROW)->getColumns());
339 }
340 }
341
342 OUStringBuffer aColumnName;
343 std::vector< sal_Int32> aOrgValues;
344 fillParameters(_rDeleteRow,_xTable,aSql,aColumnName,aOrgValues);
345
346 aSql.setLength(aSql.getLength()-5);
347
348 // now create and execute the prepared statement
349 Reference< XPreparedStatement > xPrep(m_xConnection->prepareStatement(aSql.makeStringAndClear()));
350 Reference< XParameters > xParameter(xPrep,UNO_QUERY);
351 sal_Int32 i = 1;
352 for (auto const& orgValue : aOrgValues)
353 {
354 setParameter(i,xParameter,(*_rDeleteRow)[orgValue],m_xSetMetaData->getColumnType(i),m_xSetMetaData->getScale(i));
355 ++i;
356 }
357
358 m_bDeleted = xPrep->executeUpdate() > 0;
359}
360
361void OCacheSet::setParameter(sal_Int32 nPos
362 ,const Reference< XParameters >& _xParameter
363 ,const ORowSetValue& _rValue
364 ,sal_Int32 _nType
365 ,sal_Int32 _nScale)
366{
367 sal_Int32 nType = ( _nType != DataType::OTHER ) ? _nType : _rValue.getTypeKind();
368 ::dbtools::setObjectWithInfo(_xParameter,nPos,_rValue,nType,_nScale);
369}
370
371void OCacheSet::fillValueRow(ORowSetRow& _rRow,sal_Int32 _nPosition)
372{
373 Any aBookmark = getBookmark();
374 if(!aBookmark.hasValue())
375 aBookmark <<= _nPosition;
376
379 (*aIter) = aBookmark;
380 ++aIter;
381 for(sal_Int32 i=1;aIter != aEnd;++aIter,++i)
382 {
383 aIter->setSigned(m_aSignedFlags[i-1]);
384 aIter->fill(i, m_aColumnTypes[i-1], this);
385 }
386}
387
389{
390 return m_xDriverRow->wasNull();
391}
392
393OUString SAL_CALL OCacheSet::getString( sal_Int32 columnIndex )
394{
395 return m_xDriverRow->getString(columnIndex);
396}
397
398sal_Bool SAL_CALL OCacheSet::getBoolean( sal_Int32 columnIndex )
399{
400 return m_xDriverRow->getBoolean(columnIndex);
401}
402
403sal_Int8 SAL_CALL OCacheSet::getByte( sal_Int32 columnIndex )
404{
405 return m_xDriverRow->getByte(columnIndex);
406}
407
408sal_Int16 SAL_CALL OCacheSet::getShort( sal_Int32 columnIndex )
409{
410 return m_xDriverRow->getShort(columnIndex);
411}
412
413sal_Int32 SAL_CALL OCacheSet::getInt( sal_Int32 columnIndex )
414{
415 return m_xDriverRow->getInt(columnIndex);
416}
417
418sal_Int64 SAL_CALL OCacheSet::getLong( sal_Int32 columnIndex )
419{
420 return m_xDriverRow->getLong(columnIndex);
421}
422
423float SAL_CALL OCacheSet::getFloat( sal_Int32 columnIndex )
424{
425 return m_xDriverRow->getFloat(columnIndex);
426}
427
428double SAL_CALL OCacheSet::getDouble( sal_Int32 columnIndex )
429{
430 return m_xDriverRow->getDouble(columnIndex);
431}
432
433Sequence< sal_Int8 > SAL_CALL OCacheSet::getBytes( sal_Int32 columnIndex )
434{
435 return m_xDriverRow->getBytes(columnIndex);
436}
437
438css::util::Date SAL_CALL OCacheSet::getDate( sal_Int32 columnIndex )
439{
440 return m_xDriverRow->getDate(columnIndex);
441}
442
443css::util::Time SAL_CALL OCacheSet::getTime( sal_Int32 columnIndex )
444{
445 return m_xDriverRow->getTime(columnIndex);
446}
447
448css::util::DateTime SAL_CALL OCacheSet::getTimestamp( sal_Int32 columnIndex )
449{
450 return m_xDriverRow->getTimestamp(columnIndex);
451}
452
453Reference< css::io::XInputStream > SAL_CALL OCacheSet::getBinaryStream( sal_Int32 columnIndex )
454{
455 return m_xDriverRow->getBinaryStream(columnIndex);
456}
457
458Reference< css::io::XInputStream > SAL_CALL OCacheSet::getCharacterStream( sal_Int32 columnIndex )
459{
460 return m_xDriverRow->getCharacterStream(columnIndex);
461}
462
463Any SAL_CALL OCacheSet::getObject( sal_Int32 columnIndex, const Reference< css::container::XNameAccess >& typeMap )
464{
465 return m_xDriverRow->getObject(columnIndex,typeMap);
466}
467
468Reference< XRef > SAL_CALL OCacheSet::getRef( sal_Int32 columnIndex )
469{
470 return m_xDriverRow->getRef(columnIndex);
471}
472
473Reference< XBlob > SAL_CALL OCacheSet::getBlob( sal_Int32 columnIndex )
474{
475 return m_xDriverRow->getBlob(columnIndex);
476}
477
478Reference< XClob > SAL_CALL OCacheSet::getClob( sal_Int32 columnIndex )
479{
480 return m_xDriverRow->getClob(columnIndex);
481}
482
483Reference< XArray > SAL_CALL OCacheSet::getArray( sal_Int32 columnIndex )
484{
485 return m_xDriverRow->getArray(columnIndex);
486}
487
488// XResultSet
490{
492 return m_xDriverSet->next();
493}
494
496{
498 m_xDriverSet->beforeFirst();
499}
500
502{
504 m_xDriverSet->afterLast();
505}
506
508{
510 return m_xDriverSet->first();
511}
512
514{
516 return m_xDriverSet->last();
517}
518
520{
521 return m_xDriverSet->getRow();
522}
523
524bool OCacheSet::absolute( sal_Int32 row )
525{
527 return m_xDriverSet->absolute(row);
528}
529
531{
533 return m_xDriverSet->previous();
534}
535
537{
538 m_xDriverSet->refreshRow();
539}
540
542{
543 return m_xDriverSet->rowUpdated();
544}
545
547{
548 return m_xDriverSet->rowInserted();
549}
550
552{
553 return m_xDriverSet->rowDeleted();
554}
555
557{
558 return false;
559}
560
561void OCacheSet::mergeColumnValues(sal_Int32 i_nColumnIndex,ORowSetValueVector::Vector& /*io_aInsertRow*/,ORowSetValueVector::Vector& /*io_aRow*/,std::vector<sal_Int32>& o_aChangedColumns)
562{
563 o_aChangedColumns.push_back(i_nColumnIndex);
564}
565
567{
568 return false;
569}
570
571bool OCacheSet::updateColumnValues(const ORowSetValueVector::Vector& /*io_aCachedRow*/,ORowSetValueVector::Vector& /*io_aRow*/,const std::vector<sal_Int32>& /*i_aChangedColumns*/)
572{
573 return true;
574}
575
577{
578}
579
580/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
std::vector< VectorVal > Vector
sal_Int32 getTypeKind() const
std::vector< bool > m_aNullable
Definition: CacheSet.hxx:43
virtual sal_Bool SAL_CALL getBoolean(sal_Int32 columnIndex) override
Definition: CacheSet.cxx:398
virtual css::uno::Any getBookmark()=0
virtual css::util::DateTime SAL_CALL getTimestamp(sal_Int32 columnIndex) override
Definition: CacheSet.cxx:448
virtual css::uno::Reference< css::sdbc::XBlob > SAL_CALL getBlob(sal_Int32 columnIndex) override
Definition: CacheSet.cxx:473
virtual sal_Int8 SAL_CALL getByte(sal_Int32 columnIndex) override
Definition: CacheSet.cxx:403
virtual bool first()
Definition: CacheSet.cxx:507
virtual bool next()
Definition: CacheSet.cxx:489
css::uno::Reference< css::sdbc::XResultSetMetaData > m_xSetMetaData
Definition: CacheSet.hxx:40
css::uno::Reference< css::sdbc::XResultSet > m_xDriverSet
Definition: CacheSet.hxx:38
virtual bool updateColumnValues(const ORowSetValueVector::Vector &io_aCachedRow, ORowSetValueVector::Vector &io_aRow, const std::vector< sal_Int32 > &i_aChangedColumns)
Definition: CacheSet.cxx:571
virtual void mergeColumnValues(sal_Int32 i_nColumnIndex, ORowSetValueVector::Vector &io_aInsertRow, ORowSetValueVector::Vector &io_aRow, std::vector< sal_Int32 > &o_aChangedColumns)
Definition: CacheSet.cxx:561
OUString m_aComposedTableName
Definition: CacheSet.hxx:46
css::uno::Reference< css::sdbc::XConnection > m_xConnection
Definition: CacheSet.hxx:41
virtual OUString SAL_CALL getString(sal_Int32 columnIndex) override
Definition: CacheSet.cxx:393
virtual sal_Int64 SAL_CALL getLong(sal_Int32 columnIndex) override
Definition: CacheSet.cxx:418
virtual css::uno::Reference< css::sdbc::XRef > SAL_CALL getRef(sal_Int32 columnIndex) override
Definition: CacheSet.cxx:468
virtual void afterLast()
Definition: CacheSet.cxx:501
virtual bool rowInserted()
Definition: CacheSet.cxx:546
virtual void fillValueRow(ORowSetRow &_rRow, sal_Int32 _nPosition)
Definition: CacheSet.cxx:371
std::vector< bool > m_aSignedFlags
Definition: CacheSet.hxx:44
virtual void insertRow(const ORowSetRow &_rInsertRow, const connectivity::OSQLTable &_xTable)
Definition: CacheSet.cxx:148
virtual css::uno::Reference< css::io::XInputStream > SAL_CALL getCharacterStream(sal_Int32 columnIndex) override
Definition: CacheSet.cxx:458
virtual void beforeFirst()
Definition: CacheSet.cxx:495
OUString m_sRowSetFilter
Definition: CacheSet.hxx:51
virtual sal_Int32 SAL_CALL getInt(sal_Int32 columnIndex) override
Definition: CacheSet.cxx:413
virtual css::uno::Any SAL_CALL getObject(sal_Int32 columnIndex, const css::uno::Reference< css::container::XNameAccess > &typeMap) override
Definition: CacheSet.cxx:463
css::uno::Reference< css::sdbc::XRow > m_xDriverRow
Definition: CacheSet.hxx:39
virtual css::uno::Sequence< sal_Int8 > SAL_CALL getBytes(sal_Int32 columnIndex) override
Definition: CacheSet.cxx:433
virtual css::util::Date SAL_CALL getDate(sal_Int32 columnIndex) override
Definition: CacheSet.cxx:438
void fillParameters(const ORowSetRow &_rRow, const connectivity::OSQLTable &_xTable, OUStringBuffer &_sCondition, OUStringBuffer &_sParameter, std::vector< sal_Int32 > &_rOrgValues)
Definition: CacheSet.cxx:190
virtual bool rowDeleted()
Definition: CacheSet.cxx:551
std::vector< sal_Int32 > m_aColumnTypes
Definition: CacheSet.hxx:45
virtual void refreshRow()
Definition: CacheSet.cxx:536
virtual bool columnValuesUpdated(ORowSetValueVector::Vector &o_aCachedRow, const ORowSetValueVector::Vector &i_aRow)
Definition: CacheSet.cxx:566
virtual void fillMissingValues(ORowSetValueVector::Vector &io_aRow) const
Definition: CacheSet.cxx:576
virtual css::uno::Reference< css::io::XInputStream > SAL_CALL getBinaryStream(sal_Int32 columnIndex) override
Definition: CacheSet.cxx:453
virtual float SAL_CALL getFloat(sal_Int32 columnIndex) override
Definition: CacheSet.cxx:423
virtual sal_Int32 getRow()
Definition: CacheSet.cxx:519
virtual void deleteRow(const ORowSetRow &_rDeleteRow, const connectivity::OSQLTable &_xTable)=0
Definition: CacheSet.cxx:313
virtual bool rowUpdated()
Definition: CacheSet.cxx:541
virtual sal_Int16 SAL_CALL getShort(sal_Int32 columnIndex) override
Definition: CacheSet.cxx:408
virtual double SAL_CALL getDouble(sal_Int32 columnIndex) override
Definition: CacheSet.cxx:428
virtual bool last()
Definition: CacheSet.cxx:513
virtual css::uno::Reference< css::sdbc::XClob > SAL_CALL getClob(sal_Int32 columnIndex) override
Definition: CacheSet.cxx:478
static void setParameter(sal_Int32 nPos, const css::uno::Reference< css::sdbc::XParameters > &_xParameter, const connectivity::ORowSetValue &_rValue, sal_Int32 _nType, sal_Int32 _nScale)
Definition: CacheSet.cxx:361
virtual sal_Bool SAL_CALL wasNull() override
Definition: CacheSet.cxx:388
virtual bool absolute(sal_Int32 row)
Definition: CacheSet.cxx:524
virtual void construct(const css::uno::Reference< css::sdbc::XResultSet > &_xDriverSet, const OUString &i_sRowSetFilter)
Definition: CacheSet.cxx:74
virtual css::util::Time SAL_CALL getTime(sal_Int32 columnIndex) override
Definition: CacheSet.cxx:443
virtual void updateRow(const ORowSetRow &_rInsertRow, const ORowSetRow &_rOriginalRow, const connectivity::OSQLTable &_xTable)
Definition: CacheSet.cxx:269
OUString getIdentifierQuoteString() const
Definition: CacheSet.cxx:65
virtual bool isResultSetChanged() const
Definition: CacheSet.cxx:556
virtual bool previous()
Definition: CacheSet.cxx:530
virtual ~OCacheSet() override
Definition: CacheSet.cxx:113
virtual css::uno::Reference< css::sdbc::XArray > SAL_CALL getArray(sal_Int32 columnIndex) override
Definition: CacheSet.cxx:483
void fillTableName(const css::uno::Reference< css::beans::XPropertySet > &_xTable)
Definition: CacheSet.cxx:133
#define DBA_RES(id)
int nCount
#define TOOLS_WARN_EXCEPTION(area, stream)
const char sQuote[]
sal_uInt16 nPos
#define SAL_WARN(area, stream)
@ Exception
bool getBOOL(const Any &_rAny)
OUString getString(const Any &_rAny)
css::uno::Reference< css::sdbcx::XColumnsSupplier > OSQLTable
OUString composeTableName(const Reference< XDatabaseMetaData > &_rxMetaData, const OUString &_rCatalog, const OUString &_rSchema, const OUString &_rName, bool _bQuote, EComposeRule _eComposeRule)
Reference< XNameAccess > getPrimaryKeyColumns_throw(const Any &i_aTable)
int i
QPRO_FUNC_TYPE nType
constexpr OUStringLiteral PROPERTY_SCHEMANAME(u"SchemaName")
constexpr OUStringLiteral PROPERTY_CATALOGNAME(u"CatalogName")
constexpr OUStringLiteral PROPERTY_NAME(u"Name")
constexpr OUStringLiteral PROPERTY_ISUNIQUE(u"IsUnique")
constexpr OUStringLiteral PROPERTY_ISPRIMARYKEYINDEX(u"IsPrimaryKeyIndex")
unsigned char sal_Bool
signed char sal_Int8