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