2010-10-27 13:11:31 +01:00
|
|
|
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
|
2012-06-12 22:04:38 +01:00
|
|
|
/*
|
|
|
|
* 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 .
|
|
|
|
*/
|
2000-09-18 15:18:56 +00:00
|
|
|
|
2014-04-18 18:41:08 +02:00
|
|
|
#ifndef INCLUDED_CONNECTIVITY_SOURCE_INC_FILE_FRESULTSET_HXX
|
|
|
|
#define INCLUDED_CONNECTIVITY_SOURCE_INC_FILE_FRESULTSET_HXX
|
2000-09-18 15:18:56 +00:00
|
|
|
|
|
|
|
#include <com/sun/star/sdbc/XResultSet.hpp>
|
|
|
|
#include <com/sun/star/sdbc/XRow.hpp>
|
|
|
|
#include <com/sun/star/sdbc/XResultSetMetaDataSupplier.hpp>
|
|
|
|
#include <com/sun/star/sdbc/XCloseable.hpp>
|
|
|
|
#include <com/sun/star/sdbc/XColumnLocate.hpp>
|
|
|
|
#include <com/sun/star/util/XCancellable.hpp>
|
|
|
|
#include <com/sun/star/sdbc/XWarningsSupplier.hpp>
|
|
|
|
#include <com/sun/star/sdbc/XResultSetUpdate.hpp>
|
|
|
|
#include <com/sun/star/sdbc/XRowUpdate.hpp>
|
2015-07-13 11:21:57 +09:00
|
|
|
#include <cppuhelper/compbase.hxx>
|
2016-07-01 09:46:23 +02:00
|
|
|
#include <cppuhelper/basemutex.hxx>
|
2000-10-11 09:10:28 +00:00
|
|
|
#include <comphelper/proparrhlp.hxx>
|
2000-09-18 15:18:56 +00:00
|
|
|
#include "file/FStatement.hxx"
|
2014-06-04 15:29:58 +02:00
|
|
|
#include <connectivity/CommonTools.hxx>
|
2000-10-05 07:23:48 +00:00
|
|
|
#include <comphelper/propertycontainer.hxx>
|
2000-09-18 15:18:56 +00:00
|
|
|
#include "file/fanalyzer.hxx"
|
|
|
|
#include "file/FTable.hxx"
|
2008-12-30 13:32:01 +00:00
|
|
|
#include "file/filedllapi.hxx"
|
2014-06-04 15:29:58 +02:00
|
|
|
#include <connectivity/StdTypeDefs.hxx>
|
2001-08-29 11:21:08 +00:00
|
|
|
#include "TSortIndex.hxx"
|
2001-10-26 06:45:13 +00:00
|
|
|
#include "TSkipDeletedSet.hxx"
|
2001-11-15 14:20:06 +00:00
|
|
|
#include <com/sun/star/lang/XEventListener.hpp>
|
2000-09-18 15:18:56 +00:00
|
|
|
|
|
|
|
namespace connectivity
|
|
|
|
{
|
|
|
|
namespace file
|
|
|
|
{
|
2016-05-27 12:31:29 +02:00
|
|
|
typedef ::cppu::WeakComponentImplHelper< css::sdbc::XResultSet,
|
|
|
|
css::sdbc::XRow,
|
|
|
|
css::sdbc::XResultSetMetaDataSupplier,
|
|
|
|
css::util::XCancellable,
|
|
|
|
css::sdbc::XWarningsSupplier,
|
|
|
|
css::sdbc::XResultSetUpdate,
|
|
|
|
css::sdbc::XRowUpdate,
|
|
|
|
css::sdbc::XCloseable,
|
|
|
|
css::sdbc::XColumnLocate,
|
|
|
|
css::lang::XServiceInfo,
|
|
|
|
css::lang::XEventListener,
|
|
|
|
css::lang::XUnoTunnel> OResultSet_BASE;
|
2000-09-18 15:18:56 +00:00
|
|
|
|
2008-12-30 13:32:01 +00:00
|
|
|
class OOO_DLLPUBLIC_FILE OResultSet :
|
2016-07-01 09:46:23 +02:00
|
|
|
public cppu::BaseMutex,
|
2001-10-26 06:45:13 +00:00
|
|
|
public ::connectivity::IResultSetHelper,
|
2001-08-29 11:21:08 +00:00
|
|
|
public OResultSet_BASE,
|
|
|
|
public ::comphelper::OPropertyContainer,
|
|
|
|
public ::comphelper::OPropertyArrayUsageHelper<OResultSet>
|
2000-09-18 15:18:56 +00:00
|
|
|
{
|
|
|
|
|
2000-09-29 14:05:41 +00:00
|
|
|
protected:
|
2014-04-29 19:05:05 +00:00
|
|
|
::std::vector<sal_Int32> m_aColMapping; // pos 0 is unused so we don't have to decrement 1 every time
|
2001-05-10 13:31:14 +00:00
|
|
|
|
2001-08-24 05:19:41 +00:00
|
|
|
::std::vector<sal_Int32> m_aOrderbyColumnNumber;
|
2006-06-20 01:01:25 +00:00
|
|
|
::std::vector<TAscendingOrder> m_aOrderbyAscending;
|
2001-08-24 05:19:41 +00:00
|
|
|
|
2003-09-04 07:28:11 +00:00
|
|
|
OValueRefRow m_aSelectRow;
|
|
|
|
OValueRefRow m_aRow;
|
|
|
|
OValueRefRow m_aEvaluateRow; // contains all values of a row
|
|
|
|
OValueRefRow m_aParameterRow;
|
|
|
|
OValueRefRow m_aInsertRow; // needed for insert by cursor
|
2001-05-10 13:31:14 +00:00
|
|
|
ORefAssignValues m_aAssignValues; // needed for insert,update and parameters
|
2000-09-18 15:18:56 +00:00
|
|
|
// to compare with the restrictions
|
2001-10-26 06:45:13 +00:00
|
|
|
OSkipDeletedSet m_aSkipDeletedSet;
|
2000-09-29 14:05:41 +00:00
|
|
|
|
2010-10-15 12:10:06 -05:00
|
|
|
::rtl::Reference<OKeySet> m_pFileSet;
|
2008-12-30 13:32:01 +00:00
|
|
|
OKeySet::Vector::iterator m_aFileSetIter;
|
2000-09-18 15:18:56 +00:00
|
|
|
|
2001-08-24 05:19:41 +00:00
|
|
|
|
2001-08-29 11:21:08 +00:00
|
|
|
OSortIndex* m_pSortIndex;
|
2010-10-15 12:10:06 -05:00
|
|
|
::rtl::Reference<connectivity::OSQLColumns> m_xColumns; // this are the select columns
|
|
|
|
::rtl::Reference<connectivity::OSQLColumns> m_xParamColumns;
|
2016-06-08 11:29:19 +02:00
|
|
|
rtl::Reference<OFileTable> m_pTable;
|
2001-05-10 13:31:14 +00:00
|
|
|
connectivity::OSQLParseNode* m_pParseTree;
|
2000-09-18 15:18:56 +00:00
|
|
|
|
2001-05-10 13:31:14 +00:00
|
|
|
OSQLAnalyzer* m_pSQLAnalyzer;
|
|
|
|
connectivity::OSQLParseTreeIterator& m_aSQLIterator;
|
2000-09-18 15:18:56 +00:00
|
|
|
|
2001-05-10 13:31:14 +00:00
|
|
|
sal_Int32 m_nFetchSize;
|
|
|
|
sal_Int32 m_nResultSetType;
|
|
|
|
sal_Int32 m_nFetchDirection;
|
|
|
|
sal_Int32 m_nResultSetConcurrency;
|
2000-09-18 15:18:56 +00:00
|
|
|
|
2016-05-27 12:31:29 +02:00
|
|
|
css::uno::Reference< css::uno::XInterface> m_xStatement;
|
|
|
|
css::uno::Reference< css::sdbc::XResultSetMetaData> m_xMetaData;
|
|
|
|
css::uno::Reference< css::container::XNameAccess> m_xColNames; // table columns
|
|
|
|
css::uno::Reference< css::container::XIndexAccess> m_xColsIdx; // table columns
|
2001-08-24 05:19:41 +00:00
|
|
|
|
2000-09-18 15:18:56 +00:00
|
|
|
|
2001-05-10 13:31:14 +00:00
|
|
|
sal_Int32 m_nRowPos;
|
|
|
|
sal_Int32 m_nFilePos;
|
|
|
|
sal_Int32 m_nLastVisitedPos;
|
|
|
|
sal_Int32 m_nRowCountResult;
|
2009-04-23 10:42:05 +00:00
|
|
|
sal_Int32 m_nColumnCount;
|
2014-04-16 09:14:24 +02:00
|
|
|
bool m_bWasNull;
|
|
|
|
bool m_bEOF; // after last record
|
|
|
|
bool m_bInserted; // true when moveToInsertRow was called
|
2001-05-10 13:31:14 +00:00
|
|
|
// set to false when cursor moved or cancel
|
2014-04-16 09:14:24 +02:00
|
|
|
bool m_bRowUpdated;
|
|
|
|
bool m_bRowInserted;
|
|
|
|
bool m_bRowDeleted;
|
|
|
|
bool m_bShowDeleted;
|
|
|
|
bool m_bIsCount;
|
2000-09-18 15:18:56 +00:00
|
|
|
|
2015-04-13 10:37:01 +02:00
|
|
|
static void initializeRow(OValueRefRow& _rRow,sal_Int32 _nColumnCount);
|
2000-09-18 15:18:56 +00:00
|
|
|
void construct();
|
2013-05-19 07:34:32 +02:00
|
|
|
//sal_Bool evaluate();
|
2001-08-24 05:19:41 +00:00
|
|
|
|
2014-04-16 09:14:24 +02:00
|
|
|
bool ExecuteRow(IResultSetHelper::Movement eFirstCursorPosition,
|
2011-01-07 18:04:22 +01:00
|
|
|
sal_Int32 nOffset = 1,
|
2014-04-16 09:14:24 +02:00
|
|
|
bool bEvaluate = true,
|
|
|
|
bool bRetrieveData = true);
|
2000-09-18 15:18:56 +00:00
|
|
|
|
2003-09-04 07:28:11 +00:00
|
|
|
OKeyValue* GetOrderbyKeyValue(OValueRefRow& _rRow);
|
2014-04-16 09:14:24 +02:00
|
|
|
bool IsSorted() const { return !m_aOrderbyColumnNumber.empty() && m_aOrderbyColumnNumber[0] >= 0;}
|
2001-08-24 05:19:41 +00:00
|
|
|
|
2001-01-09 14:39:19 +00:00
|
|
|
// return true when the select statement is "select count(*) from table"
|
2014-04-16 09:14:24 +02:00
|
|
|
inline bool isCount() const { return m_bIsCount; }
|
2016-05-27 12:31:29 +02:00
|
|
|
void checkIndex(sal_Int32 columnIndex ) throw(css::sdbc::SQLException);
|
2001-07-30 07:53:02 +00:00
|
|
|
|
2014-07-02 09:24:06 +01:00
|
|
|
const ORowSetValue& getValue(sal_Int32 columnIndex)
|
|
|
|
throw (css::sdbc::SQLException, css::uno::RuntimeException);
|
2016-05-27 12:31:29 +02:00
|
|
|
void updateValue(sal_Int32 columnIndex,const ORowSetValue& x ) throw(css::sdbc::SQLException, css::uno::RuntimeException);
|
2001-08-10 10:04:03 +00:00
|
|
|
// clear insert row
|
|
|
|
void clearInsertRow();
|
2008-06-06 12:25:54 +00:00
|
|
|
void sortRows();
|
2000-09-18 15:18:56 +00:00
|
|
|
protected:
|
|
|
|
|
2000-09-29 14:05:41 +00:00
|
|
|
using OResultSet_BASE::rBHelper;
|
|
|
|
|
2014-04-16 09:14:24 +02:00
|
|
|
bool Move(IResultSetHelper::Movement eCursorPosition, sal_Int32 nOffset, bool bRetrieveData);
|
2016-05-27 12:31:29 +02:00
|
|
|
virtual bool fillIndexValues(const css::uno::Reference< css::sdbcx::XColumnsSupplier> &_xIndex);
|
2000-10-05 13:40:11 +00:00
|
|
|
|
2000-09-18 15:18:56 +00:00
|
|
|
// OPropertyArrayUsageHelper
|
2015-10-12 16:04:04 +02:00
|
|
|
virtual ::cppu::IPropertyArrayHelper* createArrayHelper( ) const override;
|
2000-09-18 15:18:56 +00:00
|
|
|
// OPropertySetHelper
|
2015-10-12 16:04:04 +02:00
|
|
|
virtual ::cppu::IPropertyArrayHelper & SAL_CALL getInfoHelper() override;
|
2000-09-18 15:18:56 +00:00
|
|
|
|
2016-09-13 13:09:01 +02:00
|
|
|
virtual ~OResultSet() override;
|
2000-09-18 15:18:56 +00:00
|
|
|
public:
|
|
|
|
DECLARE_SERVICE_INFO();
|
2011-03-23 23:16:24 +01:00
|
|
|
// a Constructor, that is needed for when Returning the Object is needed:
|
2000-09-18 15:18:56 +00:00
|
|
|
OResultSet( OStatement_Base* pStmt,connectivity::OSQLParseTreeIterator& _aSQLIterator);
|
|
|
|
|
|
|
|
// ::cppu::OComponentHelper
|
2015-10-12 16:04:04 +02:00
|
|
|
virtual void SAL_CALL disposing() override;
|
2000-09-18 15:18:56 +00:00
|
|
|
// XInterface
|
2016-05-27 12:31:29 +02:00
|
|
|
virtual css::uno::Any SAL_CALL queryInterface( const css::uno::Type & rType ) throw(css::uno::RuntimeException, std::exception) override;
|
2015-10-12 16:04:04 +02:00
|
|
|
virtual void SAL_CALL acquire() throw() override;
|
|
|
|
virtual void SAL_CALL release() throw() override;
|
2000-09-18 15:18:56 +00:00
|
|
|
//XTypeProvider
|
2016-05-27 12:31:29 +02:00
|
|
|
virtual css::uno::Sequence< css::uno::Type > SAL_CALL getTypes( ) throw(css::uno::RuntimeException, std::exception) override;
|
2000-09-18 15:18:56 +00:00
|
|
|
// XPropertySet
|
2016-05-27 12:31:29 +02:00
|
|
|
virtual css::uno::Reference< css::beans::XPropertySetInfo > SAL_CALL getPropertySetInfo( ) throw(css::uno::RuntimeException, std::exception) override;
|
2000-09-18 15:18:56 +00:00
|
|
|
// XResultSet
|
2016-05-27 12:31:29 +02:00
|
|
|
virtual sal_Bool SAL_CALL next( ) throw(css::sdbc::SQLException, css::uno::RuntimeException, std::exception) override;
|
|
|
|
virtual sal_Bool SAL_CALL isBeforeFirst( ) throw(css::sdbc::SQLException, css::uno::RuntimeException, std::exception) override;
|
|
|
|
virtual sal_Bool SAL_CALL isAfterLast( ) throw(css::sdbc::SQLException, css::uno::RuntimeException, std::exception) override;
|
|
|
|
virtual sal_Bool SAL_CALL isFirst( ) throw(css::sdbc::SQLException, css::uno::RuntimeException, std::exception) override;
|
|
|
|
virtual sal_Bool SAL_CALL isLast( ) throw(css::sdbc::SQLException, css::uno::RuntimeException, std::exception) override;
|
|
|
|
virtual void SAL_CALL beforeFirst( ) throw(css::sdbc::SQLException, css::uno::RuntimeException, std::exception) override;
|
|
|
|
virtual void SAL_CALL afterLast( ) throw(css::sdbc::SQLException, css::uno::RuntimeException, std::exception) override;
|
|
|
|
virtual sal_Bool SAL_CALL first( ) throw(css::sdbc::SQLException, css::uno::RuntimeException, std::exception) override;
|
|
|
|
virtual sal_Bool SAL_CALL last( ) throw(css::sdbc::SQLException, css::uno::RuntimeException, std::exception) override;
|
|
|
|
virtual sal_Int32 SAL_CALL getRow( ) throw(css::sdbc::SQLException, css::uno::RuntimeException, std::exception) override;
|
|
|
|
virtual sal_Bool SAL_CALL absolute( sal_Int32 row ) throw(css::sdbc::SQLException, css::uno::RuntimeException, std::exception) override;
|
|
|
|
virtual sal_Bool SAL_CALL relative( sal_Int32 rows ) throw(css::sdbc::SQLException, css::uno::RuntimeException, std::exception) override;
|
|
|
|
virtual sal_Bool SAL_CALL previous( ) throw(css::sdbc::SQLException, css::uno::RuntimeException, std::exception) override;
|
|
|
|
virtual void SAL_CALL refreshRow( ) throw(css::sdbc::SQLException, css::uno::RuntimeException, std::exception) override;
|
|
|
|
virtual sal_Bool SAL_CALL rowUpdated( ) throw(css::sdbc::SQLException, css::uno::RuntimeException, std::exception) override;
|
|
|
|
virtual sal_Bool SAL_CALL rowInserted( ) throw(css::sdbc::SQLException, css::uno::RuntimeException, std::exception) override;
|
|
|
|
virtual sal_Bool SAL_CALL rowDeleted( ) throw(css::sdbc::SQLException, css::uno::RuntimeException, std::exception) override;
|
|
|
|
virtual css::uno::Reference< css::uno::XInterface > SAL_CALL getStatement( ) throw(css::sdbc::SQLException, css::uno::RuntimeException, std::exception) override;
|
2000-09-18 15:18:56 +00:00
|
|
|
// XRow
|
2016-05-27 12:31:29 +02:00
|
|
|
virtual sal_Bool SAL_CALL wasNull( ) throw(css::sdbc::SQLException, css::uno::RuntimeException, std::exception) override;
|
|
|
|
virtual OUString SAL_CALL getString( sal_Int32 columnIndex ) throw(css::sdbc::SQLException, css::uno::RuntimeException, std::exception) override;
|
|
|
|
virtual sal_Bool SAL_CALL getBoolean( sal_Int32 columnIndex ) throw(css::sdbc::SQLException, css::uno::RuntimeException, std::exception) override;
|
|
|
|
virtual sal_Int8 SAL_CALL getByte( sal_Int32 columnIndex ) throw(css::sdbc::SQLException, css::uno::RuntimeException, std::exception) override;
|
|
|
|
virtual sal_Int16 SAL_CALL getShort( sal_Int32 columnIndex ) throw(css::sdbc::SQLException, css::uno::RuntimeException, std::exception) override;
|
|
|
|
virtual sal_Int32 SAL_CALL getInt( sal_Int32 columnIndex ) throw(css::sdbc::SQLException, css::uno::RuntimeException, std::exception) override;
|
|
|
|
virtual sal_Int64 SAL_CALL getLong( sal_Int32 columnIndex ) throw(css::sdbc::SQLException, css::uno::RuntimeException, std::exception) override;
|
|
|
|
virtual float SAL_CALL getFloat( sal_Int32 columnIndex ) throw(css::sdbc::SQLException, css::uno::RuntimeException, std::exception) override;
|
|
|
|
virtual double SAL_CALL getDouble( sal_Int32 columnIndex ) throw(css::sdbc::SQLException, css::uno::RuntimeException, std::exception) override;
|
|
|
|
virtual css::uno::Sequence< sal_Int8 > SAL_CALL getBytes( sal_Int32 columnIndex ) throw(css::sdbc::SQLException, css::uno::RuntimeException, std::exception) override;
|
|
|
|
virtual css::util::Date SAL_CALL getDate( sal_Int32 columnIndex ) throw(css::sdbc::SQLException, css::uno::RuntimeException, std::exception) override;
|
|
|
|
virtual css::util::Time SAL_CALL getTime( sal_Int32 columnIndex ) throw(css::sdbc::SQLException, css::uno::RuntimeException, std::exception) override;
|
|
|
|
virtual css::util::DateTime SAL_CALL getTimestamp( sal_Int32 columnIndex ) throw(css::sdbc::SQLException, css::uno::RuntimeException, std::exception) override;
|
|
|
|
virtual css::uno::Reference< css::io::XInputStream > SAL_CALL getBinaryStream( sal_Int32 columnIndex ) throw(css::sdbc::SQLException, css::uno::RuntimeException, std::exception) override;
|
|
|
|
virtual css::uno::Reference< css::io::XInputStream > SAL_CALL getCharacterStream( sal_Int32 columnIndex ) throw(css::sdbc::SQLException, css::uno::RuntimeException, std::exception) override;
|
|
|
|
virtual css::uno::Any SAL_CALL getObject( sal_Int32 columnIndex, const css::uno::Reference< css::container::XNameAccess >& typeMap ) throw(css::sdbc::SQLException, css::uno::RuntimeException, std::exception) override;
|
|
|
|
virtual css::uno::Reference< css::sdbc::XRef > SAL_CALL getRef( sal_Int32 columnIndex ) throw(css::sdbc::SQLException, css::uno::RuntimeException, std::exception) override;
|
|
|
|
virtual css::uno::Reference< css::sdbc::XBlob > SAL_CALL getBlob( sal_Int32 columnIndex ) throw(css::sdbc::SQLException, css::uno::RuntimeException, std::exception) override;
|
|
|
|
virtual css::uno::Reference< css::sdbc::XClob > SAL_CALL getClob( sal_Int32 columnIndex ) throw(css::sdbc::SQLException, css::uno::RuntimeException, std::exception) override;
|
|
|
|
virtual css::uno::Reference< css::sdbc::XArray > SAL_CALL getArray( sal_Int32 columnIndex ) throw(css::sdbc::SQLException, css::uno::RuntimeException, std::exception) override;
|
2000-09-18 15:18:56 +00:00
|
|
|
// XResultSetMetaDataSupplier
|
2016-05-27 12:31:29 +02:00
|
|
|
virtual css::uno::Reference< css::sdbc::XResultSetMetaData > SAL_CALL getMetaData( ) throw(css::sdbc::SQLException, css::uno::RuntimeException, std::exception) override;
|
2000-09-18 15:18:56 +00:00
|
|
|
// XCancellable
|
2016-05-27 12:31:29 +02:00
|
|
|
virtual void SAL_CALL cancel( ) throw(css::uno::RuntimeException, std::exception) override;
|
2000-09-18 15:18:56 +00:00
|
|
|
// XCloseable
|
2016-05-27 12:31:29 +02:00
|
|
|
virtual void SAL_CALL close( ) throw(css::sdbc::SQLException, css::uno::RuntimeException, std::exception) override;
|
2000-09-18 15:18:56 +00:00
|
|
|
// XWarningsSupplier
|
2016-05-27 12:31:29 +02:00
|
|
|
virtual css::uno::Any SAL_CALL getWarnings( ) throw(css::sdbc::SQLException, css::uno::RuntimeException, std::exception) override;
|
|
|
|
virtual void SAL_CALL clearWarnings( ) throw(css::sdbc::SQLException, css::uno::RuntimeException, std::exception) override;
|
2000-09-18 15:18:56 +00:00
|
|
|
// XResultSetUpdate
|
2016-05-27 12:31:29 +02:00
|
|
|
virtual void SAL_CALL insertRow( ) throw(css::sdbc::SQLException, css::uno::RuntimeException, std::exception) override;
|
|
|
|
virtual void SAL_CALL updateRow( ) throw(css::sdbc::SQLException, css::uno::RuntimeException, std::exception) override;
|
|
|
|
virtual void SAL_CALL deleteRow( ) throw(css::sdbc::SQLException, css::uno::RuntimeException, std::exception) override;
|
|
|
|
virtual void SAL_CALL cancelRowUpdates( ) throw(css::sdbc::SQLException, css::uno::RuntimeException, std::exception) override;
|
|
|
|
virtual void SAL_CALL moveToInsertRow( ) throw(css::sdbc::SQLException, css::uno::RuntimeException, std::exception) override;
|
|
|
|
virtual void SAL_CALL moveToCurrentRow( ) throw(css::sdbc::SQLException, css::uno::RuntimeException, std::exception) override;
|
2000-09-18 15:18:56 +00:00
|
|
|
// XRowUpdate
|
2016-05-27 12:31:29 +02:00
|
|
|
virtual void SAL_CALL updateNull( sal_Int32 columnIndex ) throw(css::sdbc::SQLException, css::uno::RuntimeException, std::exception) override;
|
|
|
|
virtual void SAL_CALL updateBoolean( sal_Int32 columnIndex, sal_Bool x ) throw(css::sdbc::SQLException, css::uno::RuntimeException, std::exception) override;
|
|
|
|
virtual void SAL_CALL updateByte( sal_Int32 columnIndex, sal_Int8 x ) throw(css::sdbc::SQLException, css::uno::RuntimeException, std::exception) override;
|
|
|
|
virtual void SAL_CALL updateShort( sal_Int32 columnIndex, sal_Int16 x ) throw(css::sdbc::SQLException, css::uno::RuntimeException, std::exception) override;
|
|
|
|
virtual void SAL_CALL updateInt( sal_Int32 columnIndex, sal_Int32 x ) throw(css::sdbc::SQLException, css::uno::RuntimeException, std::exception) override;
|
|
|
|
virtual void SAL_CALL updateLong( sal_Int32 columnIndex, sal_Int64 x ) throw(css::sdbc::SQLException, css::uno::RuntimeException, std::exception) override;
|
|
|
|
virtual void SAL_CALL updateFloat( sal_Int32 columnIndex, float x ) throw(css::sdbc::SQLException, css::uno::RuntimeException, std::exception) override;
|
|
|
|
virtual void SAL_CALL updateDouble( sal_Int32 columnIndex, double x ) throw(css::sdbc::SQLException, css::uno::RuntimeException, std::exception) override;
|
|
|
|
virtual void SAL_CALL updateString( sal_Int32 columnIndex, const OUString& x ) throw(css::sdbc::SQLException, css::uno::RuntimeException, std::exception) override;
|
|
|
|
virtual void SAL_CALL updateBytes( sal_Int32 columnIndex, const css::uno::Sequence< sal_Int8 >& x ) throw(css::sdbc::SQLException, css::uno::RuntimeException, std::exception) override;
|
|
|
|
virtual void SAL_CALL updateDate( sal_Int32 columnIndex, const css::util::Date& x ) throw(css::sdbc::SQLException, css::uno::RuntimeException, std::exception) override;
|
|
|
|
virtual void SAL_CALL updateTime( sal_Int32 columnIndex, const css::util::Time& x ) throw(css::sdbc::SQLException, css::uno::RuntimeException, std::exception) override;
|
|
|
|
virtual void SAL_CALL updateTimestamp( sal_Int32 columnIndex, const css::util::DateTime& x ) throw(css::sdbc::SQLException, css::uno::RuntimeException, std::exception) override;
|
|
|
|
virtual void SAL_CALL updateBinaryStream( sal_Int32 columnIndex, const css::uno::Reference< css::io::XInputStream >& x, sal_Int32 length ) throw(css::sdbc::SQLException, css::uno::RuntimeException, std::exception) override;
|
|
|
|
virtual void SAL_CALL updateCharacterStream( sal_Int32 columnIndex, const css::uno::Reference< css::io::XInputStream >& x, sal_Int32 length ) throw(css::sdbc::SQLException, css::uno::RuntimeException, std::exception) override;
|
|
|
|
virtual void SAL_CALL updateObject( sal_Int32 columnIndex, const css::uno::Any& x ) throw(css::sdbc::SQLException, css::uno::RuntimeException, std::exception) override;
|
|
|
|
virtual void SAL_CALL updateNumericObject( sal_Int32 columnIndex, const css::uno::Any& x, sal_Int32 scale ) throw(css::sdbc::SQLException, css::uno::RuntimeException, std::exception) override;
|
2000-09-18 15:18:56 +00:00
|
|
|
// XColumnLocate
|
2016-05-27 12:31:29 +02:00
|
|
|
virtual sal_Int32 SAL_CALL findColumn( const OUString& columnName ) throw(css::sdbc::SQLException, css::uno::RuntimeException, std::exception) override;
|
|
|
|
// css::lang::XUnoTunnel
|
|
|
|
virtual sal_Int64 SAL_CALL getSomething( const css::uno::Sequence< sal_Int8 >& aIdentifier ) throw(css::uno::RuntimeException, std::exception) override;
|
|
|
|
static css::uno::Sequence< sal_Int8 > getUnoTunnelImplementationId();
|
2001-11-15 14:20:06 +00:00
|
|
|
//XEventlistener
|
2016-05-27 12:31:29 +02:00
|
|
|
virtual void SAL_CALL disposing( const css::lang::EventObject& Source ) throw (css::uno::RuntimeException, std::exception) override;
|
2000-09-18 15:18:56 +00:00
|
|
|
|
|
|
|
// special methods
|
|
|
|
inline sal_Int32 mapColumn(sal_Int32 column);
|
2015-01-20 12:38:10 +02:00
|
|
|
bool OpenImpl();
|
|
|
|
void doTableSpecials(const OSQLTable& _xTable);
|
2000-09-18 15:18:56 +00:00
|
|
|
|
2007-09-26 13:30:44 +00:00
|
|
|
inline sal_Int32 getRowCountResult() const { return m_nRowCountResult; }
|
|
|
|
inline void setParameterRow(const OValueRefRow& _rParaRow) { m_aParameterRow = _rParaRow; }
|
|
|
|
inline void setEvaluationRow(const OValueRefRow& _aRow) { m_aEvaluateRow = _aRow; }
|
2010-10-15 12:10:06 -05:00
|
|
|
inline void setParameterColumns(const ::rtl::Reference<connectivity::OSQLColumns>& _xParamColumns) { m_xParamColumns = _xParamColumns; }
|
2007-09-26 13:30:44 +00:00
|
|
|
inline void setAssignValues(const ORefAssignValues& _aAssignValues) { m_aAssignValues = _aAssignValues; }
|
|
|
|
inline void setBindingRow(const OValueRefRow& _aRow) { m_aRow = _aRow; }
|
2009-04-23 10:42:05 +00:00
|
|
|
inline void setSelectRow(const OValueRefRow& _rRow)
|
|
|
|
{
|
|
|
|
m_aSelectRow = _rRow;
|
|
|
|
m_nColumnCount = m_aSelectRow->get().size();
|
|
|
|
}
|
2007-09-26 13:30:44 +00:00
|
|
|
inline void setColumnMapping(const ::std::vector<sal_Int32>& _aColumnMapping) { m_aColMapping = _aColumnMapping; }
|
|
|
|
inline void setSqlAnalyzer(OSQLAnalyzer* _pSQLAnalyzer) { m_pSQLAnalyzer = _pSQLAnalyzer; }
|
|
|
|
|
|
|
|
inline void setOrderByColumns(const ::std::vector<sal_Int32>& _aColumnOrderBy) { m_aOrderbyColumnNumber = _aColumnOrderBy; }
|
|
|
|
inline void setOrderByAscending(const ::std::vector<TAscendingOrder>& _aOrderbyAsc) { m_aOrderbyAscending = _aOrderbyAsc; }
|
2016-05-27 12:31:29 +02:00
|
|
|
inline void setMetaData(const css::uno::Reference< css::sdbc::XResultSetMetaData>& _xMetaData) { m_xMetaData = _xMetaData;}
|
2001-08-24 05:19:41 +00:00
|
|
|
|
2003-09-04 07:28:11 +00:00
|
|
|
static void setBoundedColumns(const OValueRefRow& _rRow,
|
|
|
|
const OValueRefRow& _rSelectRow,
|
2010-10-15 12:10:06 -05:00
|
|
|
const ::rtl::Reference<connectivity::OSQLColumns>& _rxColumns,
|
2016-05-27 12:31:29 +02:00
|
|
|
const css::uno::Reference< css::container::XIndexAccess>& _xNames,
|
2014-04-16 09:14:24 +02:00
|
|
|
bool _bSetColumnMapping,
|
2016-05-27 12:31:29 +02:00
|
|
|
const css::uno::Reference< css::sdbc::XDatabaseMetaData>& _xMetaData,
|
2003-09-04 07:28:11 +00:00
|
|
|
::std::vector<sal_Int32>& _rColMapping);
|
2001-10-26 06:45:13 +00:00
|
|
|
|
|
|
|
// IResultSetHelper
|
2015-10-12 16:04:04 +02:00
|
|
|
virtual bool move(IResultSetHelper::Movement _eCursorPosition, sal_Int32 _nOffset, bool _bRetrieveData) override;
|
|
|
|
virtual sal_Int32 getDriverPos() const override;
|
|
|
|
virtual bool isRowDeleted() const override;
|
2000-09-18 15:18:56 +00:00
|
|
|
};
|
2014-02-25 17:59:09 +01:00
|
|
|
|
2001-01-25 09:25:04 +00:00
|
|
|
inline sal_Int32 OResultSet::mapColumn(sal_Int32 column)
|
2000-09-18 15:18:56 +00:00
|
|
|
{
|
2001-01-25 09:25:04 +00:00
|
|
|
sal_Int32 map = column;
|
|
|
|
|
|
|
|
OSL_ENSURE(column > 0, "file::OResultSet::mapColumn: invalid column index!");
|
2013-05-17 09:56:14 +02:00
|
|
|
// the first column (index 0) is for convenience only. The first real select column is number 1.
|
2001-03-01 09:56:43 +00:00
|
|
|
if ((column > 0) && (column < (sal_Int32)m_aColMapping.size()))
|
2001-01-25 09:25:04 +00:00
|
|
|
map = m_aColMapping[column];
|
|
|
|
|
|
|
|
return map;
|
2000-09-18 15:18:56 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
#endif // _CONNECTIVITY_FILE_ORESULTSET_HXX_
|
|
|
|
|
|
|
|
|
2010-10-27 13:11:31 +01:00
|
|
|
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|