1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
3 * This file is part of the LibreOffice project.
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/.
9 * This file incorporates work covered by the following license notice:
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 .
20 #include "CacheSet.hxx"
21 #include "core_resource.hxx"
22 #include "core_resource.hrc"
23 #include <com/sun/star/sdbcx/CompareBookmark.hpp>
24 #include <com/sun/star/sdbc/XResultSetMetaDataSupplier.hpp>
25 #include <com/sun/star/beans/XPropertySet.hpp>
26 #include <com/sun/star/sdbc/XDatabaseMetaData.hpp>
27 #include <com/sun/star/sdbc/XPreparedStatement.hpp>
28 #include <com/sun/star/sdbc/ColumnValue.hpp>
29 #include <com/sun/star/sdbc/XParameters.hpp>
30 #include "dbastrings.hrc"
31 #include <com/sun/star/sdbcx/XKeysSupplier.hpp>
32 #include <com/sun/star/sdbcx/XIndexesSupplier.hpp>
36 #include <connectivity/dbtools.hxx>
37 #include <com/sun/star/sdbcx/KeyType.hpp>
38 #include <comphelper/extract.hxx>
39 #include <com/sun/star/io/XInputStream.hpp>
40 #include <comphelper/types.hxx>
41 #include <tools/debug.hxx>
42 #include <rtl/ustrbuf.hxx>
44 using namespace comphelper
;
46 using namespace dbaccess
;
47 using namespace dbtools
;
48 using namespace connectivity
;
49 using namespace ::com::sun::star::uno
;
50 using namespace ::com::sun::star::beans
;
51 using namespace ::com::sun::star::sdbc
;
52 using namespace ::com::sun::star::sdbcx
;
53 using namespace ::com::sun::star::container
;
54 using namespace ::com::sun::star::lang
;
55 using namespace ::com::sun::star::io
;
56 using namespace ::osl
;
59 OCacheSet::OCacheSet(sal_Int32 i_nMaxRows
)
60 :m_nMaxRows(i_nMaxRows
)
68 OUString
OCacheSet::getIdentifierQuoteString() const
71 Reference
<XDatabaseMetaData
> xMeta
;
72 if ( m_xConnection
.is() && (xMeta
= m_xConnection
->getMetaData()).is() )
73 sQuote
= xMeta
->getIdentifierQuoteString();
77 void OCacheSet::construct( const Reference
< XResultSet
>& _xDriverSet
,const OUString
&i_sRowSetFilter
)
79 OSL_ENSURE(_xDriverSet
.is(),"Invalid resultSet");
81 m_sRowSetFilter
= i_sRowSetFilter
;
85 m_xDriverSet
= _xDriverSet
;
86 m_xDriverRow
.set(_xDriverSet
,UNO_QUERY
);
87 m_xSetMetaData
= Reference
<XResultSetMetaDataSupplier
>(_xDriverSet
,UNO_QUERY
)->getMetaData();
88 if ( m_xSetMetaData
.is() )
90 const sal_Int32 nCount
= m_xSetMetaData
->getColumnCount();
91 m_aNullable
.realloc(nCount
);
92 m_aSignedFlags
.realloc(nCount
);
93 m_aColumnTypes
.realloc(nCount
);
94 sal_Bool
* pNullableIter
= m_aNullable
.getArray();
95 sal_Bool
* pSignedIter
= m_aSignedFlags
.getArray();
96 sal_Int32
* pColumnIter
= m_aColumnTypes
.getArray();
97 for (sal_Int32 i
=1; i
<= nCount
; ++i
,++pSignedIter
,++pColumnIter
,++pNullableIter
)
99 *pNullableIter
= m_xSetMetaData
->isNullable(i
) != ColumnValue::NO_NULLS
;
100 *pSignedIter
= m_xSetMetaData
->isSigned(i
);
101 *pColumnIter
= m_xSetMetaData
->getColumnType(i
);
104 Reference
< XStatement
> xStmt(m_xDriverSet
->getStatement(),UNO_QUERY
);
106 m_xConnection
= xStmt
->getConnection();
109 Reference
< XPreparedStatement
> xPrepStmt(m_xDriverSet
->getStatement(),UNO_QUERY
);
110 if ( xPrepStmt
.is() )
111 m_xConnection
= xPrepStmt
->getConnection();
116 OCacheSet::~OCacheSet()
122 m_xSetMetaData
= NULL
;
123 m_xConnection
= NULL
;
127 SAL_WARN("dbaccess", "Exception occurred");
131 SAL_WARN("dbaccess", "Unknown Exception occurred");
136 void OCacheSet::fillTableName(const Reference
<XPropertySet
>& _xTable
) throw(SQLException
, RuntimeException
)
138 OSL_ENSURE(_xTable
.is(),"OCacheSet::fillTableName: PropertySet is empty!");
139 if(m_aComposedTableName
.isEmpty() && _xTable
.is() )
141 Reference
<XDatabaseMetaData
> xMeta(m_xConnection
->getMetaData());
142 m_aComposedTableName
= composeTableName(xMeta
143 ,comphelper::getString(_xTable
->getPropertyValue(PROPERTY_CATALOGNAME
))
144 ,comphelper::getString(_xTable
->getPropertyValue(PROPERTY_SCHEMANAME
))
145 ,comphelper::getString(_xTable
->getPropertyValue(PROPERTY_NAME
))
147 ,::dbtools::eInDataManipulation
);
151 void SAL_CALL
OCacheSet::insertRow( const ORowSetRow
& _rInsertRow
,const connectivity::OSQLTable
& _xTable
) throw(SQLException
, RuntimeException
)
153 Reference
<XPropertySet
> xSet(_xTable
,UNO_QUERY
);
156 OUStringBuffer
aSql("INSERT INTO " + m_aComposedTableName
+ " ( ");
158 // set values and column names
159 OUStringBuffer
aValues(" VALUES ( ");
160 static const char aPara
[] = "?,";
161 OUString aQuote
= getIdentifierQuoteString();
162 static const char aComma
[] = ",";
164 ORowVector
< ORowSetValue
>::Vector::const_iterator aIter
= _rInsertRow
->get().begin()+1;
165 connectivity::ORowVector
< ORowSetValue
> ::Vector::iterator aEnd
= _rInsertRow
->get().end();
166 for(; aIter
!= aEnd
;++aIter
)
168 aSql
.append(::dbtools::quoteName( aQuote
,m_xSetMetaData
->getColumnName(i
++)) + aComma
);
169 aValues
.append(aPara
);
172 aSql
[aSql
.getLength() - 1] = ')';
173 aValues
[aValues
.getLength() - 1] = ')';
175 aSql
.append(aValues
.makeStringAndClear());
176 // now create end execute the prepared statement
178 Reference
< XPreparedStatement
> xPrep(m_xConnection
->prepareStatement(aSql
.makeStringAndClear()));
179 Reference
< XParameters
> xParameter(xPrep
,UNO_QUERY
);
181 for(aIter
= _rInsertRow
->get().begin()+1; aIter
!= aEnd
;++aIter
,++i
)
184 xParameter
->setNull(i
,aIter
->getTypeKind());
186 setParameter(i
,xParameter
,*aIter
,m_xSetMetaData
->getColumnType(i
),m_xSetMetaData
->getScale(i
));
189 m_bInserted
= xPrep
->executeUpdate() > 0;
192 // TODO set the bookmark in the insert row
195 void OCacheSet::fillParameters( const ORowSetRow
& _rRow
196 ,const connectivity::OSQLTable
& _xTable
197 ,OUStringBuffer
& _sCondition
198 ,OUStringBuffer
& _sParameter
199 ,::std::list
< sal_Int32
>& _rOrgValues
)
201 // use keys and indexes for exact positioning
203 Reference
<XPropertySet
> xSet(_xTable
,UNO_QUERY
);
204 const Reference
<XNameAccess
> xPrimaryKeyColumns
= getPrimaryKeyColumns_throw(xSet
);
205 // second the indexes
206 Reference
<XIndexesSupplier
> xIndexSup(_xTable
,UNO_QUERY
);
207 Reference
<XIndexAccess
> xIndexes
;
209 xIndexes
.set(xIndexSup
->getIndexes(),UNO_QUERY
);
211 // Reference<XColumnsSupplier>
212 Reference
<XPropertySet
> xIndexColsSup
;
213 Reference
<XNameAccess
> xIndexColumns
;
214 ::std::vector
< Reference
<XNameAccess
> > aAllIndexColumns
;
217 for(sal_Int32 j
=0;j
<xIndexes
->getCount();++j
)
219 xIndexColsSup
.set(xIndexes
->getByIndex(j
),UNO_QUERY
);
220 if( xIndexColsSup
.is()
221 && comphelper::getBOOL(xIndexColsSup
->getPropertyValue(PROPERTY_ISUNIQUE
))
222 && !comphelper::getBOOL(xIndexColsSup
->getPropertyValue(PROPERTY_ISPRIMARYKEYINDEX
))
224 aAllIndexColumns
.push_back(Reference
<XColumnsSupplier
>(xIndexColsSup
,UNO_QUERY
)->getColumns());
228 OUString aColumnName
;
230 static const char aPara
[] = "?,";
231 static const char aAnd
[] = " AND ";
233 OUString aQuote
= getIdentifierQuoteString();
235 sal_Int32 nCheckCount
= 1; // index for the original values
238 OUString
sIsNull(" IS NULL");
239 OUString
sParam(" = ?");
240 ORowVector
< ORowSetValue
>::Vector::const_iterator aIter
= _rRow
->get().begin()+1;
241 ORowVector
< ORowSetValue
>::Vector::const_iterator aEnd
= _rRow
->get().end()+1;
242 for(; aIter
!= aEnd
;++aIter
,++nCheckCount
,++i
)
244 aColumnName
= m_xSetMetaData
->getColumnName(i
);
245 if(xPrimaryKeyColumns
.is() && xPrimaryKeyColumns
->hasByName(aColumnName
))
247 _sCondition
.append(::dbtools::quoteName( aQuote
,aColumnName
));
249 _sCondition
.append(sIsNull
);
251 _sCondition
.append(sParam
);
252 _sCondition
.append(aAnd
);
253 _rOrgValues
.push_back(nCheckCount
);
256 ::std::vector
< Reference
<XNameAccess
> >::const_iterator aIndexEnd
= aAllIndexColumns
.end();
257 for( ::std::vector
< Reference
<XNameAccess
> >::const_iterator aIndexIter
= aAllIndexColumns
.begin();
258 aIndexIter
!= aIndexEnd
;++aIndexIter
)
260 if((*aIndexIter
)->hasByName(aColumnName
))
262 _sCondition
.append(::dbtools::quoteName( aQuote
,aColumnName
));
264 _sCondition
.append(sIsNull
);
266 _sCondition
.append(sParam
);
267 _sCondition
.append(aAnd
);
268 _rOrgValues
.push_back(nCheckCount
);
272 if(aIter
->isModified())
274 _sParameter
.append(::dbtools::quoteName( aQuote
,aColumnName
) + aPara
);
279 void SAL_CALL
OCacheSet::updateRow(const ORowSetRow
& _rInsertRow
,const ORowSetRow
& _rOriginalRow
,const connectivity::OSQLTable
& _xTable
) throw(SQLException
, RuntimeException
)
281 Reference
<XPropertySet
> xSet(_xTable
,UNO_QUERY
);
284 OUStringBuffer
aSql("UPDATE " + m_aComposedTableName
+ " SET ");
285 // list all columns that should be set
287 OUStringBuffer aCondition
;
288 ::std::list
< sal_Int32
> aOrgValues
;
289 fillParameters(_rInsertRow
,_xTable
,aCondition
,aSql
,aOrgValues
);
290 aSql
[aSql
.getLength() - 1] = ' ';
291 if ( !aCondition
.isEmpty() )
293 aCondition
.setLength(aCondition
.getLength()-5);
295 aSql
.append(" WHERE " + aCondition
.makeStringAndClear());
298 ::dbtools::throwSQLException(
299 DBACORE_RESSTRING( RID_STR_NO_UPDATE_MISSING_CONDITION
), SQL_GENERAL_ERROR
, *this );
301 // now create end execute the prepared statement
302 Reference
< XPreparedStatement
> xPrep(m_xConnection
->prepareStatement(aSql
.makeStringAndClear()));
303 Reference
< XParameters
> xParameter(xPrep
,UNO_QUERY
);
305 connectivity::ORowVector
< ORowSetValue
> ::Vector::iterator aEnd
= _rInsertRow
->get().end();
306 for(ORowVector
< ORowSetValue
>::Vector::const_iterator aIter
= _rInsertRow
->get().begin()+1; aIter
!= aEnd
;++aIter
)
308 if(aIter
->isModified())
310 setParameter(i
,xParameter
,*aIter
,m_xSetMetaData
->getColumnType(i
),m_xSetMetaData
->getScale(i
));
314 ::std::list
< sal_Int32
>::const_iterator aOrgValueEnd
= aOrgValues
.end();
315 for(::std::list
< sal_Int32
>::const_iterator aOrgValue
= aOrgValues
.begin(); aOrgValue
!= aOrgValueEnd
;++aOrgValue
,++i
)
317 setParameter(i
,xParameter
,(_rOriginalRow
->get())[*aOrgValue
],m_xSetMetaData
->getColumnType(i
),m_xSetMetaData
->getScale(i
));
320 m_bUpdated
= xPrep
->executeUpdate() > 0;
323 void SAL_CALL
OCacheSet::deleteRow(const ORowSetRow
& _rDeleteRow
,const connectivity::OSQLTable
& _xTable
) throw(SQLException
, RuntimeException
)
325 Reference
<XPropertySet
> xSet(_xTable
,UNO_QUERY
);
328 OUStringBuffer
aSql("DELETE FROM " + m_aComposedTableName
+ " WHERE ");
330 // use keys and indexes for exact positioning
332 const Reference
<XNameAccess
> xPrimaryKeyColumns
= getPrimaryKeyColumns_throw(xSet
);
333 // second the indexes
334 Reference
<XIndexesSupplier
> xIndexSup(_xTable
,UNO_QUERY
);
335 Reference
<XIndexAccess
> xIndexes
;
337 xIndexes
.set(xIndexSup
->getIndexes(),UNO_QUERY
);
339 // Reference<XColumnsSupplier>
340 Reference
<XPropertySet
> xIndexColsSup
;
341 Reference
<XNameAccess
> xIndexColumns
;
342 ::std::vector
< Reference
<XNameAccess
> > aAllIndexColumns
;
345 for(sal_Int32 j
=0;j
<xIndexes
->getCount();++j
)
347 xIndexColsSup
.set(xIndexes
->getByIndex(j
),UNO_QUERY
);
348 if( xIndexColsSup
.is()
349 && comphelper::getBOOL(xIndexColsSup
->getPropertyValue(PROPERTY_ISUNIQUE
))
350 && !comphelper::getBOOL(xIndexColsSup
->getPropertyValue(PROPERTY_ISPRIMARYKEYINDEX
))
352 aAllIndexColumns
.push_back(Reference
<XColumnsSupplier
>(xIndexColsSup
,UNO_QUERY
)->getColumns());
356 OUStringBuffer aColumnName
;
357 ::std::list
< sal_Int32
> aOrgValues
;
358 fillParameters(_rDeleteRow
,_xTable
,aSql
,aColumnName
,aOrgValues
);
360 aSql
.setLength(aSql
.getLength()-5);
362 // now create and execute the prepared statement
363 Reference
< XPreparedStatement
> xPrep(m_xConnection
->prepareStatement(aSql
.makeStringAndClear()));
364 Reference
< XParameters
> xParameter(xPrep
,UNO_QUERY
);
366 ::std::list
< sal_Int32
>::const_iterator aOrgValueEnd
= aOrgValues
.end();
367 for(::std::list
< sal_Int32
>::const_iterator j
= aOrgValues
.begin(); j
!= aOrgValueEnd
;++j
,++i
)
369 setParameter(i
,xParameter
,(_rDeleteRow
->get())[*j
],m_xSetMetaData
->getColumnType(i
),m_xSetMetaData
->getScale(i
));
372 m_bDeleted
= xPrep
->executeUpdate() > 0;
375 void OCacheSet::setParameter(sal_Int32 nPos
376 ,const Reference
< XParameters
>& _xParameter
377 ,const ORowSetValue
& _rValue
381 sal_Int32 nType
= ( _nType
!= DataType::OTHER
) ? _nType
: _rValue
.getTypeKind();
382 ::dbtools::setObjectWithInfo(_xParameter
,nPos
,_rValue
,nType
,_nScale
);
385 void OCacheSet::fillValueRow(ORowSetRow
& _rRow
,sal_Int32 _nPosition
)
387 Any aBookmark
= getBookmark();
388 if(!aBookmark
.hasValue())
389 aBookmark
= makeAny(_nPosition
);
391 connectivity::ORowVector
< ORowSetValue
>::Vector::iterator aIter
= _rRow
->get().begin();
392 connectivity::ORowVector
< ORowSetValue
>::Vector::iterator aEnd
= _rRow
->get().end();
393 (*aIter
) = aBookmark
;
395 for(sal_Int32 i
=1;aIter
!= aEnd
;++aIter
,++i
)
397 aIter
->setSigned(m_aSignedFlags
[i
-1]);
398 aIter
->fill(i
, m_aColumnTypes
[i
-1], this);
402 sal_Bool SAL_CALL
OCacheSet::wasNull( ) throw(SQLException
, RuntimeException
, std::exception
)
404 return m_xDriverRow
->wasNull();
407 OUString SAL_CALL
OCacheSet::getString( sal_Int32 columnIndex
) throw(SQLException
, RuntimeException
, std::exception
)
409 return m_xDriverRow
->getString(columnIndex
);
412 sal_Bool SAL_CALL
OCacheSet::getBoolean( sal_Int32 columnIndex
) throw(SQLException
, RuntimeException
, std::exception
)
414 return m_xDriverRow
->getBoolean(columnIndex
);
417 sal_Int8 SAL_CALL
OCacheSet::getByte( sal_Int32 columnIndex
) throw(SQLException
, RuntimeException
, std::exception
)
419 return m_xDriverRow
->getByte(columnIndex
);
422 sal_Int16 SAL_CALL
OCacheSet::getShort( sal_Int32 columnIndex
) throw(SQLException
, RuntimeException
, std::exception
)
424 return m_xDriverRow
->getShort(columnIndex
);
427 sal_Int32 SAL_CALL
OCacheSet::getInt( sal_Int32 columnIndex
) throw(SQLException
, RuntimeException
, std::exception
)
429 return m_xDriverRow
->getInt(columnIndex
);
432 sal_Int64 SAL_CALL
OCacheSet::getLong( sal_Int32 columnIndex
) throw(SQLException
, RuntimeException
, std::exception
)
434 return m_xDriverRow
->getLong(columnIndex
);
437 float SAL_CALL
OCacheSet::getFloat( sal_Int32 columnIndex
) throw(SQLException
, RuntimeException
, std::exception
)
439 return m_xDriverRow
->getFloat(columnIndex
);
442 double SAL_CALL
OCacheSet::getDouble( sal_Int32 columnIndex
) throw(SQLException
, RuntimeException
, std::exception
)
444 return m_xDriverRow
->getDouble(columnIndex
);
447 Sequence
< sal_Int8
> SAL_CALL
OCacheSet::getBytes( sal_Int32 columnIndex
) throw(SQLException
, RuntimeException
, std::exception
)
449 return m_xDriverRow
->getBytes(columnIndex
);
452 ::com::sun::star::util::Date SAL_CALL
OCacheSet::getDate( sal_Int32 columnIndex
) throw(SQLException
, RuntimeException
, std::exception
)
454 return m_xDriverRow
->getDate(columnIndex
);
457 ::com::sun::star::util::Time SAL_CALL
OCacheSet::getTime( sal_Int32 columnIndex
) throw(SQLException
, RuntimeException
, std::exception
)
459 return m_xDriverRow
->getTime(columnIndex
);
462 ::com::sun::star::util::DateTime SAL_CALL
OCacheSet::getTimestamp( sal_Int32 columnIndex
) throw(SQLException
, RuntimeException
, std::exception
)
464 return m_xDriverRow
->getTimestamp(columnIndex
);
467 Reference
< ::com::sun::star::io::XInputStream
> SAL_CALL
OCacheSet::getBinaryStream( sal_Int32 columnIndex
) throw(SQLException
, RuntimeException
, std::exception
)
469 return m_xDriverRow
->getBinaryStream(columnIndex
);
472 Reference
< ::com::sun::star::io::XInputStream
> SAL_CALL
OCacheSet::getCharacterStream( sal_Int32 columnIndex
) throw(SQLException
, RuntimeException
, std::exception
)
474 return m_xDriverRow
->getCharacterStream(columnIndex
);
477 Any SAL_CALL
OCacheSet::getObject( sal_Int32 columnIndex
, const Reference
< ::com::sun::star::container::XNameAccess
>& typeMap
) throw(SQLException
, RuntimeException
, std::exception
)
479 return m_xDriverRow
->getObject(columnIndex
,typeMap
);
482 Reference
< XRef
> SAL_CALL
OCacheSet::getRef( sal_Int32 columnIndex
) throw(SQLException
, RuntimeException
, std::exception
)
484 return m_xDriverRow
->getRef(columnIndex
);
487 Reference
< XBlob
> SAL_CALL
OCacheSet::getBlob( sal_Int32 columnIndex
) throw(SQLException
, RuntimeException
, std::exception
)
489 return m_xDriverRow
->getBlob(columnIndex
);
492 Reference
< XClob
> SAL_CALL
OCacheSet::getClob( sal_Int32 columnIndex
) throw(SQLException
, RuntimeException
, std::exception
)
494 return m_xDriverRow
->getClob(columnIndex
);
497 Reference
< XArray
> SAL_CALL
OCacheSet::getArray( sal_Int32 columnIndex
) throw(SQLException
, RuntimeException
, std::exception
)
499 return m_xDriverRow
->getArray(columnIndex
);
503 bool SAL_CALL
OCacheSet::next( ) throw(SQLException
, RuntimeException
)
505 m_bInserted
= m_bUpdated
= m_bDeleted
= false;
506 return m_xDriverSet
->next();
509 bool SAL_CALL
OCacheSet::isBeforeFirst( ) throw(SQLException
, RuntimeException
)
511 return m_xDriverSet
->isBeforeFirst();
514 bool SAL_CALL
OCacheSet::isAfterLast( ) throw(SQLException
, RuntimeException
)
516 return m_xDriverSet
->isAfterLast();
519 bool SAL_CALL
OCacheSet::isFirst( ) throw(SQLException
, RuntimeException
)
521 return m_xDriverSet
->isFirst();
524 bool SAL_CALL
OCacheSet::isLast( ) throw(SQLException
, RuntimeException
)
526 return m_xDriverSet
->isLast();
529 void SAL_CALL
OCacheSet::beforeFirst( ) throw(SQLException
, RuntimeException
)
531 m_bInserted
= m_bUpdated
= m_bDeleted
= false;
532 m_xDriverSet
->beforeFirst();
535 void SAL_CALL
OCacheSet::afterLast( ) throw(SQLException
, RuntimeException
)
537 m_bInserted
= m_bUpdated
= m_bDeleted
= false;
538 m_xDriverSet
->afterLast();
541 bool SAL_CALL
OCacheSet::first( ) throw(SQLException
, RuntimeException
)
543 m_bInserted
= m_bUpdated
= m_bDeleted
= false;
544 return m_xDriverSet
->first();
547 bool SAL_CALL
OCacheSet::last( ) throw(SQLException
, RuntimeException
)
549 m_bInserted
= m_bUpdated
= m_bDeleted
= false;
550 return m_xDriverSet
->last();
553 sal_Int32 SAL_CALL
OCacheSet::getRow( ) throw(SQLException
, RuntimeException
)
555 return m_xDriverSet
->getRow();
558 bool SAL_CALL
OCacheSet::absolute( sal_Int32 row
) throw(SQLException
, RuntimeException
)
560 m_bInserted
= m_bUpdated
= m_bDeleted
= false;
561 return m_xDriverSet
->absolute(row
);
564 bool SAL_CALL
OCacheSet::relative( sal_Int32 rows
) throw(SQLException
, RuntimeException
)
566 m_bInserted
= m_bUpdated
= m_bDeleted
= false;
567 return m_xDriverSet
->relative(rows
);
570 bool SAL_CALL
OCacheSet::previous( ) throw(SQLException
, RuntimeException
)
572 m_bInserted
= m_bUpdated
= m_bDeleted
= false;
573 return m_xDriverSet
->previous();
576 bool OCacheSet::last_checked( bool /*i_bFetchRow*/)
581 bool OCacheSet::previous_checked( bool /*i_bFetchRow*/ )
586 bool OCacheSet::absolute_checked( sal_Int32 row
,bool /*i_bFetchRow*/ )
588 return absolute(row
);
591 void SAL_CALL
OCacheSet::refreshRow( ) throw(SQLException
, RuntimeException
)
593 m_xDriverSet
->refreshRow();
596 bool SAL_CALL
OCacheSet::rowUpdated( ) throw(SQLException
, RuntimeException
)
598 return m_xDriverSet
->rowUpdated();
601 bool SAL_CALL
OCacheSet::rowInserted( ) throw(SQLException
, RuntimeException
)
603 return m_xDriverSet
->rowInserted();
606 bool SAL_CALL
OCacheSet::rowDeleted( ) throw(SQLException
, RuntimeException
)
608 return m_xDriverSet
->rowDeleted();
611 Reference
< XInterface
> SAL_CALL
OCacheSet::getStatement( ) throw(SQLException
, RuntimeException
)
613 return m_xDriverSet
->getStatement();
616 bool OCacheSet::isResultSetChanged() const
621 void OCacheSet::mergeColumnValues(sal_Int32 i_nColumnIndex
,ORowSetValueVector::Vector
& /*io_aInsertRow*/,ORowSetValueVector::Vector
& /*io_aRow*/,::std::vector
<sal_Int32
>& o_aChangedColumns
)
623 o_aChangedColumns
.push_back(i_nColumnIndex
);
626 bool OCacheSet::columnValuesUpdated(ORowSetValueVector::Vector
& /*io_aCachedRow*/,const ORowSetValueVector::Vector
& /*io_aRow*/)
631 bool OCacheSet::updateColumnValues(const ORowSetValueVector::Vector
& /*io_aCachedRow*/,ORowSetValueVector::Vector
& /*io_aRow*/,const ::std::vector
<sal_Int32
>& /*i_aChangedColumns*/)
636 void OCacheSet::fillMissingValues(ORowSetValueVector::Vector
& /*io_aRow*/) const
640 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */