LibreOffice Module dbaccess (master) 1
RowSet.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 <sal/config.h>
21#include <sal/log.hxx>
22
23#include <map>
24#include <utility>
25
26#include "RowSet.hxx"
27#include <stringconstants.hxx>
28#include <sdbcoretools.hxx>
30#include "CRowSetColumn.hxx"
31#include "CRowSetDataColumn.hxx"
32#include "RowSetCache.hxx"
33#include <strings.hrc>
34#include <strings.hxx>
35#include <core_resource.hxx>
36#include <tablecontainer.hxx>
37
38#include <com/sun/star/beans/PropertyAttribute.hpp>
39#include <com/sun/star/lang/DisposedException.hpp>
40#include <com/sun/star/lang/XMultiServiceFactory.hpp>
41#include <com/sun/star/sdb/CommandType.hpp>
42#include <com/sun/star/sdb/DatabaseContext.hpp>
43#include <com/sun/star/sdb/ErrorCondition.hpp>
44#include <com/sun/star/sdb/RowChangeAction.hpp>
45#include <com/sun/star/sdb/RowSetVetoException.hpp>
46#include <com/sun/star/sdb/XCompletedConnection.hpp>
47#include <com/sun/star/sdb/XParametersSupplier.hpp>
48#include <com/sun/star/sdb/XQueriesSupplier.hpp>
49#include <com/sun/star/sdbc/FetchDirection.hpp>
50#include <com/sun/star/sdbc/ResultSetConcurrency.hpp>
51#include <com/sun/star/sdbc/ResultSetType.hpp>
52#include <com/sun/star/sdbc/XDataSource.hpp>
53#include <com/sun/star/sdbcx/Privilege.hpp>
54#include <com/sun/star/util/XNumberFormatsSupplier.hpp>
55
60#include <comphelper/types.hxx>
61#include <comphelper/uno3.hxx>
71#include <o3tl/safeint.hxx>
74
75using namespace utl;
76using namespace dbaccess;
77using namespace connectivity;
78using namespace comphelper;
79using namespace dbtools;
80using namespace ::com::sun::star;
81using namespace ::com::sun::star::uno;
82using namespace ::com::sun::star::beans;
83using namespace ::com::sun::star::sdbc;
84using namespace ::com::sun::star::sdb;
85using namespace ::com::sun::star::sdbcx;
86using namespace ::com::sun::star::container;
87using namespace ::com::sun::star::lang;
88using namespace ::com::sun::star::task;
89using namespace ::com::sun::star::util;
90using namespace ::cppu;
91using namespace ::osl;
92
93extern "C" SAL_DLLPUBLIC_EXPORT css::uno::XInterface*
94com_sun_star_comp_dba_ORowSet_get_implementation(css::uno::XComponentContext* context,
95 css::uno::Sequence<css::uno::Any> const &)
96{
97 return cppu::acquire(new ORowSet(context));
98}
99
100namespace dbaccess
101{
102ORowSet::ORowSet( const Reference< css::uno::XComponentContext >& _rxContext )
104 ,ORowSetBase( _rxContext, ORowSet_BASE1::rBHelper, &m_aMutex )
105 ,m_aPrematureParamValues(new ORowSetValueVector)
106 ,m_aParameterValueForCache(new ORowSetValueVector)
107 ,m_aRowsetListeners(*m_pMutex)
108 ,m_aApproveListeners(*m_pMutex)
109 ,m_aRowsChangeListener(*m_pMutex)
110 ,m_sErrorString(ResourceManager::loadString(RID_STR_COMMAND_LEADING_TO_ERROR))
111 ,m_nFetchDirection(FetchDirection::FORWARD)
112 ,m_nFetchSize(50)
113 ,m_nMaxFieldSize(0)
114 ,m_nMaxRows(0)
115 ,m_nQueryTimeOut(0)
117 ,m_nTransactionIsolation(0)
118 ,m_nPrivileges(0)
119 ,m_nLastKnownRowCount(0)
120 ,m_nInAppend(0)
121 ,m_bInsertingRow(false)
122 ,m_bLastKnownRowCountFinal(false)
123 ,m_bUseEscapeProcessing(true)
124 ,m_bApplyFilter(false)
125 ,m_bCommandFacetsDirty( true )
126 ,m_bParametersDirty( true )
127 ,m_bModified(false)
128 ,m_bRebuildConnOnExecute(false)
129 ,m_bIsBookmarkable(true)
130 ,m_bNew(false)
131 ,m_bCanUpdateInsertedRows(true)
132 ,m_bOwnConnection(false)
133 ,m_bPropChangeNotifyEnabled(true)
134{
135 m_nResultSetType = ResultSetType::SCROLL_SENSITIVE;
136 m_nResultSetConcurrency = ResultSetConcurrency::UPDATABLE;
137 m_pMySelf = this;
139
140 sal_Int32 const nRBT = PropertyAttribute::READONLY | PropertyAttribute::BOUND | PropertyAttribute::TRANSIENT;
141 sal_Int32 const nRT = PropertyAttribute::READONLY | PropertyAttribute::TRANSIENT;
142 sal_Int32 const nBT = PropertyAttribute::BOUND | PropertyAttribute::TRANSIENT;
143
144 m_aPrematureParamValues->resize( 0 );
145
146 // sdb.RowSet Properties
147 registerMayBeVoidProperty(PROPERTY_ACTIVE_CONNECTION,PROPERTY_ID_ACTIVE_CONNECTION, PropertyAttribute::MAYBEVOID|PropertyAttribute::TRANSIENT|PropertyAttribute::BOUND, &m_aActiveConnection, cppu::UnoType<XConnection>::get());
162
163 // sdbcx.ResultSet Properties
166 // sdbc.ResultSet Properties
171
172 // sdbc.RowSet Properties
175 registerMayBeVoidProperty(PROPERTY_TYPEMAP, PROPERTY_ID_TYPEMAP, PropertyAttribute::MAYBEVOID|PropertyAttribute::TRANSIENT, &m_aTypeMap, cppu::UnoType<XNameAccess>::get());
182
186
187 // ???
189}
190
192{
194 {
195 SAL_WARN("dbaccess", "Please check who doesn't dispose this component!");
196 osl_atomic_increment( &m_refCount );
197 dispose();
198 }
199}
200
201void ORowSet::getPropertyDefaultByHandle( sal_Int32 _nHandle, Any& _rDefault ) const
202{
203 switch( _nHandle )
204 {
206 _rDefault <<= CommandType::COMMAND;
207 break;
209 _rDefault <<= false;
210 break;
212 _rDefault <<= false;
213 break;
215 _rDefault <<= false;
216 break;
218 _rDefault <<= true;
219 break;
221 _rDefault <<= true;
222 break;
224 _rDefault <<= ResultSetType::SCROLL_INSENSITIVE;
225 break;
227 _rDefault <<= ResultSetConcurrency::UPDATABLE;
228 break;
230 _rDefault <<= FetchDirection::FORWARD;
231 break;
233 _rDefault <<= static_cast<sal_Int32>(1);
234 break;
236 _rDefault <<= true;
237 break;
239 _rDefault <<= sal_Int32( 0 );
240 break;
248 _rDefault <<= OUString();
249 break;
250 }
251}
252
253void SAL_CALL ORowSet::setFastPropertyValue_NoBroadcast(sal_Int32 nHandle,const Any& rValue)
254{
255 switch(nHandle)
256 {
258 m_bModified = cppu::any2bool(rValue);
259 break;
261 if( m_nResultSetType == ResultSetType::FORWARD_ONLY)
262 throw Exception("resultsettype is FORWARD_ONLY", nullptr);
263 [[fallthrough]];
264 default:
266 }
267
277 || ( nHandle == PROPERTY_ID_ORDER )
278 || ( nHandle == PROPERTY_ID_URL )
279 || ( nHandle == PROPERTY_ID_USER )
280 )
281 {
283 }
284
285
286 switch(nHandle)
287 {
289 // the new connection
290 {
291 assert(m_aActiveConnection == rValue);
292 Reference< XConnection > xNewConnection(m_aActiveConnection,UNO_QUERY);
293 setActiveConnection(xNewConnection, false);
294 }
295
296 m_bOwnConnection = false;
298 break;
299
301 if(!m_xStatement.is())
302 {
303 Reference< XConnection > xNewConn;
304 Any aNewConn;
305 aNewConn <<= xNewConn;
307 }
308 else
310 break;
312 if(m_pCache)
313 {
314 m_pCache->setFetchSize(m_nFetchSize);
315 fireRowcount();
316 }
317 break;
318 case PROPERTY_ID_URL:
319 // is the connection-to-be-built determined by the url (which is the case if m_aDataSourceName is empty) ?
320 if (m_aDataSourceName.isEmpty())
321 {
322 // are we active at the moment ?
323 if (m_xStatement.is())
324 // yes -> the next execute needs to rebuild our connection because of this new property
326 else
327 { // no -> drop our active connection (if we have one) as it doesn't correspond to this new property value anymore
328 Reference< XConnection > xNewConn;
329 Any aNewConn;
330 aNewConn <<= xNewConn;
332 }
333 }
334 m_bOwnConnection = true;
335 break;
337 m_xTypeMap.set(m_aTypeMap, css::uno::UNO_QUERY);
338 break;
340 m_bPropChangeNotifyEnabled = ::cppu::any2bool(rValue);
341 break;
342 default:
343 break;
344 }
345}
346
347void SAL_CALL ORowSet::getFastPropertyValue(Any& rValue,sal_Int32 nHandle) const
348{
349 if(m_pCache)
350 {
351 switch(nHandle)
352 {
354 rValue <<= m_bModified;
355 break;
357 rValue <<= m_bNew;
358 break;
360 rValue <<= m_pCache->m_nPrivileges;
361 break;
363 rValue <<= m_xActiveConnection;
364 break;
366 rValue <<= m_xTypeMap;
367 break;
368 default:
370 }
371 }
372 else
373 {
374 switch(nHandle)
375 {
377 rValue <<= m_xActiveConnection;
378 break;
380 rValue <<= m_xTypeMap;
381 break;
384 break;
385 default:
387 }
388 }
389}
390
391// css::XTypeProvider
392Sequence< Type > SAL_CALL ORowSet::getTypes()
393{
397 ::comphelper::concatSequences(ORowSet_BASE1::getTypes(),ORowSetBase::getTypes()));
398 return aTypes.getTypes();
399}
400
401Sequence< sal_Int8 > SAL_CALL ORowSet::getImplementationId()
402{
403 return css::uno::Sequence<sal_Int8>();
404}
405
406// css::XInterface
407Any SAL_CALL ORowSet::queryInterface( const Type & rType )
408{
409 return ORowSet_BASE1::queryInterface( rType);
410}
411
412void SAL_CALL ORowSet::acquire() noexcept
413{
415}
416
417void SAL_CALL ORowSet::release() noexcept
418{
420}
421
422// css::XAggregation
423Any SAL_CALL ORowSet::queryAggregation( const Type& rType )
424{
425 Any aRet(ORowSetBase::queryInterface(rType));
426 if (!aRet.hasValue())
428 return aRet;
429}
430
431// css::XServiceInfo
433{
434 return "com.sun.star.comp.dba.ORowSet";
435}
436
437sal_Bool SAL_CALL ORowSet::supportsService( const OUString& _rServiceName )
438{
439 return cppu::supportsService(this, _rServiceName);
440}
441
442Sequence< OUString > SAL_CALL ORowSet::getSupportedServiceNames()
443{
446}
447
448// OComponentHelper
449void SAL_CALL ORowSet::disposing()
450{
451 OPropertyStateContainer::disposing();
452
453 MutexGuard aGuard(m_aMutex);
454 EventObject aDisposeEvent;
455 aDisposeEvent.Source = static_cast< XComponent* >(this);
456 m_aRowsetListeners.disposeAndClear( aDisposeEvent );
457 m_aApproveListeners.disposeAndClear( aDisposeEvent );
458 m_aRowsChangeListener.disposeAndClear( aDisposeEvent );
459
460 freeResources( true );
461
462 // remove myself as dispose listener
463 Reference< XComponent > xComponent(m_xActiveConnection, UNO_QUERY);
464 if (xComponent.is())
465 {
466 Reference<XEventListener> xEvt;
467 query_aggregation(this,xEvt);
468 xComponent->removeEventListener(xEvt);
469 }
470
471 m_aActiveConnection = Any(); // the any contains a reference too
473 ::comphelper::disposeComponent(m_xActiveConnection);
474 m_xActiveConnection = nullptr;
475
476
478}
479
480void ORowSet::freeResources( bool _bComplete )
481{
482 MutexGuard aGuard(m_aMutex);
483
484 // free all clones
485 for (auto const& clone : m_aClones)
486 {
487 Reference< XComponent > xComp(clone.get(), UNO_QUERY);
488 if (xComp.is())
489 xComp->dispose();
490 }
491 m_aClones.clear();
492
494
495 m_aBookmark = Any();
496 m_bBeforeFirst = true;
497 m_bAfterLast = false;
498 m_bNew = false;
499 m_bModified = false;
500 m_bIsInsertRow = false;
503
504 if ( !_bComplete )
505 return;
506
507 // the columns must be disposed before the querycomposer is disposed because
508 // their owner can be the composer
509 TDataColumns().swap(m_aDataColumns);// clear and resize capacity
510 std::vector<bool>().swap(m_aReadOnlyDataColumns);
511
512 m_xColumns = nullptr;
513 if ( m_pColumns )
514 m_pColumns->disposing();
515 // dispose the composer to avoid that everybody knows that the querycomposer is eol
516 try { ::comphelper::disposeComponent( m_xComposer ); }
517 catch(Exception&)
518 {
519 DBG_UNHANDLED_EXCEPTION("dbaccess");
520 m_xComposer = nullptr;
521 }
522
523 // let our warnings container forget the reference to the (possibly disposed) old result set
525
526 m_pCache.reset();
527
529
530 m_xStatement = nullptr;
531 m_xTypeMap = nullptr;
532
533 if ( m_aOldRow.is() )
534 m_aOldRow->clearRow();
535
537
539}
540
541void ORowSet::setActiveConnection( Reference< XConnection > const & _rxNewConn, bool _bFireEvent )
542{
543 if (_rxNewConn.get() == m_xActiveConnection.get())
544 // nothing to do
545 return;
546
547 // remove the event listener for the old connection
548 Reference< XComponent > xComponent(m_xActiveConnection, UNO_QUERY);
549 if (xComponent.is())
550 {
551 Reference<XEventListener> xListener;
552 query_aggregation(this, xListener);
553 xComponent->removeEventListener(xListener);
554 }
555
556 // if we owned the connection, remember it for later disposing
559
560 // for firing the PropertyChangeEvent
562 Any aOldConnection; aOldConnection <<= m_xActiveConnection;
563 Any aNewConnection; aNewConnection <<= _rxNewConn;
564
565 // set the new connection
566 m_xActiveConnection = _rxNewConn;
567 if (m_xActiveConnection.is())
569 else
570 m_aActiveConnection.clear();
571
572 // fire the event
573 if (_bFireEvent)
574 fire(&nHandle, &aNewConnection, &aOldConnection, 1, false);
575
576 // register as event listener for the new connection
577 xComponent.set(m_xActiveConnection,UNO_QUERY);
578 if (xComponent.is())
579 {
580 Reference<XEventListener> xListener;
581 query_aggregation(this, xListener);
582 xComponent->addEventListener(xListener);
583 }
584}
585
586// css::XEventListener
587void SAL_CALL ORowSet::disposing( const css::lang::EventObject& Source )
588{
589 // close rowset because the connection is going to be deleted (someone told me :-)
590 Reference<XConnection> xCon(Source.Source,UNO_QUERY);
591 if(m_xActiveConnection == xCon)
592 {
593 close();
594 {
595 MutexGuard aGuard( m_aMutex );
596 Reference< XConnection > xXConnection;
597 setActiveConnection( xXConnection );
598 }
599 }
600}
601
602// XCloseable
603void SAL_CALL ORowSet::close( )
604{
605 {
606 MutexGuard aGuard( m_aMutex );
607 ::connectivity::checkDisposed(ORowSet_BASE1::rBHelper.bDisposed);
608 }
609 // additional things to set
610 freeResources( true );
611}
612
613// comphelper::OPropertyArrayUsageHelper
615{
616 Sequence< Property > aProps;
617 describeProperties(aProps);
618 return new ::cppu::OPropertyArrayHelper(aProps);
619}
620
621// cppu::OPropertySetHelper
623{
625}
626
627void ORowSet::updateValue(sal_Int32 columnIndex,const ORowSetValue& x)
628{
629 ::connectivity::checkDisposed(ORowSet_BASE1::rBHelper.bDisposed);
630
631 ::osl::MutexGuard aGuard( *m_pMutex );
632 checkUpdateConditions(columnIndex);
634
636 ORowSetNotifier aNotify(this, std::vector(rRow));
637 m_pCache->updateValue(columnIndex,x,rRow,aNotify.getChangedColumns());
638 m_bModified = m_bModified || !aNotify.getChangedColumns().empty();
639 aNotify.firePropertyChange();
640}
641
642// XRowUpdate
643void SAL_CALL ORowSet::updateNull( sal_Int32 columnIndex )
644{
645 ::connectivity::checkDisposed(ORowSet_BASE1::rBHelper.bDisposed);
646
647 ::osl::MutexGuard aGuard( *m_pMutex );
648 checkUpdateConditions(columnIndex);
650
652 ORowSetNotifier aNotify(this, std::vector(rRow));
653 m_pCache->updateNull(columnIndex,rRow,aNotify.getChangedColumns());
654 m_bModified = m_bModified || !aNotify.getChangedColumns().empty();
655 aNotify.firePropertyChange();
656}
657
658void SAL_CALL ORowSet::updateBoolean( sal_Int32 columnIndex, sal_Bool x )
659{
660 updateValue(columnIndex, static_cast<bool>(x));
661}
662
663void SAL_CALL ORowSet::updateByte( sal_Int32 columnIndex, sal_Int8 x )
664{
665 updateValue(columnIndex,x);
666}
667
668void SAL_CALL ORowSet::updateShort( sal_Int32 columnIndex, sal_Int16 x )
669{
670 updateValue(columnIndex,x);
671}
672
673void SAL_CALL ORowSet::updateInt( sal_Int32 columnIndex, sal_Int32 x )
674{
675 updateValue(columnIndex,x);
676}
677
678void SAL_CALL ORowSet::updateLong( sal_Int32 columnIndex, sal_Int64 x )
679{
680 updateValue(columnIndex,x);
681}
682
683void SAL_CALL ORowSet::updateFloat( sal_Int32 columnIndex, float x )
684{
685 updateValue(columnIndex,x);
686}
687
688void SAL_CALL ORowSet::updateDouble( sal_Int32 columnIndex, double x )
689{
690 updateValue(columnIndex,x);
691}
692
693void SAL_CALL ORowSet::updateString( sal_Int32 columnIndex, const OUString& x )
694{
695 updateValue(columnIndex,x);
696}
697
698void SAL_CALL ORowSet::updateBytes( sal_Int32 columnIndex, const Sequence< sal_Int8 >& x )
699{
700 updateValue(columnIndex,x);
701}
702
703void SAL_CALL ORowSet::updateDate( sal_Int32 columnIndex, const css::util::Date& x )
704{
705 updateValue(columnIndex,x);
706}
707
708void SAL_CALL ORowSet::updateTime( sal_Int32 columnIndex, const css::util::Time& x )
709{
710 updateValue(columnIndex,x);
711}
712
713void SAL_CALL ORowSet::updateTimestamp( sal_Int32 columnIndex, const css::util::DateTime& x )
714{
715 updateValue(columnIndex,x);
716}
717
718void SAL_CALL ORowSet::updateBinaryStream( sal_Int32 columnIndex, const Reference< css::io::XInputStream >& x, sal_Int32 length )
719{
720 ::connectivity::checkDisposed(ORowSet_BASE1::rBHelper.bDisposed);
721 ::osl::MutexGuard aGuard( *m_pMutex );
722 checkUpdateConditions(columnIndex);
724
725 {
726 Sequence<sal_Int8> aSeq;
727 if(x.is())
728 x->readBytes(aSeq,length);
729 updateValue(columnIndex,aSeq);
730 }
731}
732
733void SAL_CALL ORowSet::updateCharacterStream( sal_Int32 columnIndex, const Reference< css::io::XInputStream >& x, sal_Int32 length )
734{
735 ::connectivity::checkDisposed(ORowSet_BASE1::rBHelper.bDisposed);
736 ::osl::MutexGuard aGuard( *m_pMutex );
737 checkUpdateConditions(columnIndex);
740 ORowSetNotifier aNotify(this, std::vector(rRow));
741 m_pCache->updateCharacterStream(columnIndex,x,length,rRow,aNotify.getChangedColumns());
742 m_bModified = m_bModified || !aNotify.getChangedColumns().empty();
743 aNotify.firePropertyChange();
744}
745
746void SAL_CALL ORowSet::updateObject( sal_Int32 columnIndex, const Any& x )
747{
748 ::connectivity::checkDisposed(ORowSet_BASE1::rBHelper.bDisposed);
749 ::osl::MutexGuard aGuard( *m_pMutex );
750 checkUpdateConditions(columnIndex);
752
753 Any aNewValue = x;
754
755 if ( m_pColumns )
756 {
757 Reference<XPropertySet> xColumn(m_pColumns->getByIndex(columnIndex-1),UNO_QUERY);
758 sal_Int32 nColType = 0;
759 xColumn->getPropertyValue(PROPERTY_TYPE) >>= nColType;
760 switch( nColType )
761 {
762 case DataType::DATE:
763 case DataType::TIME:
764 case DataType::TIMESTAMP:
765 {
766 double nValue = 0;
767 if ( x >>= nValue )
768 {
769 if ( DataType::TIMESTAMP == nColType )
771 else if ( DataType::DATE == nColType )
773 else
775 }
776 break;
777 }
778 }
779 }
780
781 if (!::dbtools::implUpdateObject(this, columnIndex, aNewValue))
782 { // there is no other updateXXX call which can handle the value in x
784 ORowSetNotifier aNotify(this, std::vector(rRow));
785 m_pCache->updateObject(columnIndex,aNewValue,rRow,aNotify.getChangedColumns());
786 m_bModified = m_bModified || !aNotify.getChangedColumns().empty();
787 aNotify.firePropertyChange();
788 }
789}
790
791void SAL_CALL ORowSet::updateNumericObject( sal_Int32 columnIndex, const Any& x, sal_Int32 /*scale*/ )
792{
793 ::connectivity::checkDisposed(ORowSet_BASE1::rBHelper.bDisposed);
794 ::osl::MutexGuard aGuard( *m_pMutex );
795 checkUpdateConditions(columnIndex);
798 ORowSetNotifier aNotify(this, std::vector(rRow));
799 m_pCache->updateNumericObject(columnIndex,x,rRow,aNotify.getChangedColumns());
800 m_bModified = m_bModified || !aNotify.getChangedColumns().empty();
801 aNotify.firePropertyChange();
802}
803
804namespace
805{
806 class ProtectFlag
807 {
809 public:
810 explicit ProtectFlag(bool& rInsertingRow)
811 : m_rInsertingRow(rInsertingRow)
812 {
813 if (m_rInsertingRow)
814 {
815 throw std::runtime_error("recursion in insertRow");
816 }
817 m_rInsertingRow = true;
818 }
819 ~ProtectFlag()
820 {
821 m_rInsertingRow = false;
822 }
823 };
824}
825
826// XResultSetUpdate
827void SAL_CALL ORowSet::insertRow()
828{
829 ProtectFlag aFlagControl(m_bInsertingRow);
830
831 ::connectivity::checkDisposed(ORowSet_BASE1::rBHelper.bDisposed);
832 // insertRow is not allowed when
833 // standing not on the insert row nor
834 // when the row isn't modified
835 // or the concurrency is read only
836 ::osl::ResettableMutexGuard aGuard( *m_pMutex );
837
838 if(!m_pCache || !m_bNew || !m_bModified || m_nResultSetConcurrency == ResultSetConcurrency::READ_ONLY)
840
841 // remember old value for fire
842 bool bOld = m_bNew;
843
844 ORowSetRow aOldValues;
845 if ( !m_aCurrentRow.isNull() )
846 aOldValues = new ORowSetValueVector( *(*m_aCurrentRow));
847 Sequence<Any> aChangedBookmarks;
848 RowsChangeEvent aEvt(*this,RowChangeAction::INSERT,1,aChangedBookmarks);
850
851 std::vector< Any > aBookmarks;
852 bool bInserted = m_pCache->insertRow(aBookmarks);
853
854 // make sure that our row is set to the new inserted row before clearing the insert flags in the cache
855 m_pCache->resetInsertRow(bInserted);
856
857 // notification order
858 // - column values
859 setCurrentRow( false, true, aOldValues, aGuard ); // we don't move here
860
861 // read-only flag restored
863
864 // - rowChanged
865 notifyAllListenersRowChanged(aGuard,aEvt);
866
867 if ( !aBookmarks.empty() )
868 {
869 RowsChangeEvent aUpEvt(*this,RowChangeAction::UPDATE,aBookmarks.size(),comphelper::containerToSequence(aBookmarks));
870 notifyAllListenersRowChanged(aGuard,aUpEvt);
871 }
872
873 // - IsModified
874 if(!m_bModified)
876 OSL_ENSURE( !m_bModified, "ORowSet::insertRow: just updated, but _still_ modified?" );
877
878 // - IsNew
879 if(m_bNew != bOld)
881
882 // - RowCount/IsRowCountFinal
883 fireRowcount();
884}
885
886void SAL_CALL ORowSet::updateRow( )
887{
888 ::connectivity::checkDisposed(ORowSet_BASE1::rBHelper.bDisposed);
889 // not allowed when standing on insert row
890 ::osl::ResettableMutexGuard aGuard( *m_pMutex );
891 if ( !m_pCache || m_nResultSetConcurrency == ResultSetConcurrency::READ_ONLY || m_bNew || ((m_pCache->m_nPrivileges & Privilege::UPDATE ) != Privilege::UPDATE) )
893
894
895 if(!m_bModified)
896 return;
897
898 ORowSetRow aOldValues;
899 if ( !m_aCurrentRow.isNull() )
900 aOldValues = new ORowSetValueVector( *(*m_aCurrentRow) );
901
902 Sequence<Any> aChangedBookmarks;
903 RowsChangeEvent aEvt(*this,RowChangeAction::UPDATE,1,aChangedBookmarks);
905
906 std::vector< Any > aBookmarks;
907 m_pCache->updateRow(m_aCurrentRow.operator ->(),aBookmarks);
908 if ( !aBookmarks.empty() )
909 aEvt.Bookmarks = comphelper::containerToSequence(aBookmarks);
910 aEvt.Rows += aBookmarks.size();
911 m_aBookmark = m_pCache->getBookmark();
912 m_aCurrentRow = m_pCache->m_aMatrixIter;
913 m_bIsInsertRow = false;
914 if ( m_pCache->m_aMatrixIter != m_pCache->getEnd() && (*m_pCache->m_aMatrixIter).is() )
915 {
916 if ( m_pCache->isResultSetChanged() )
917 {
918 impl_rebuild_throw(aGuard);
919 }
920 else
921 {
923
924 // notification order
925 // - column values
927 }
928 // - rowChanged
929 notifyAllListenersRowChanged(aGuard,aEvt);
930
931 // - IsModified
932 if(!m_bModified)
934 OSL_ENSURE( !m_bModified, "ORowSet::updateRow: just updated, but _still_ modified?" );
935
936 // - RowCount/IsRowCountFinal
937 fireRowcount();
938 }
939 else if ( !m_bAfterLast ) // the update went wrong
940 {
941 ::dbtools::throwSQLException( DBA_RES( RID_STR_UPDATE_FAILED ), StandardSQLState::INVALID_CURSOR_POSITION, *this );
942 }
943}
944
945void SAL_CALL ORowSet::deleteRow( )
946{
947 ::connectivity::checkDisposed(ORowSet_BASE1::rBHelper.bDisposed);
948
949 ::osl::ResettableMutexGuard aGuard( *m_pMutex );
950 checkCache();
951
953 ::dbtools::throwSQLException( DBA_RES( RID_STR_NO_DELETE_BEFORE_AFTER ), StandardSQLState::INVALID_CURSOR_POSITION, *this );
954 if ( m_bNew )
955 ::dbtools::throwSQLException( DBA_RES( RID_STR_NO_DELETE_INSERT_ROW ), StandardSQLState::INVALID_CURSOR_POSITION, *this );
956 if ( m_nResultSetConcurrency == ResultSetConcurrency::READ_ONLY )
957 ::dbtools::throwSQLException( DBA_RES( RID_STR_RESULT_IS_READONLY ), StandardSQLState::FUNCTION_SEQUENCE_ERROR, *this );
958 if ( ( m_pCache->m_nPrivileges & Privilege::DELETE ) != Privilege::DELETE )
959 ::dbtools::throwSQLException( DBA_RES( RID_STR_NO_DELETE_PRIVILEGE ), StandardSQLState::FUNCTION_SEQUENCE_ERROR, *this );
960 if ( rowDeleted() )
961 ::dbtools::throwSQLException( DBA_RES( RID_STR_ROW_ALREADY_DELETED ), StandardSQLState::FUNCTION_SEQUENCE_ERROR, *this );
962
963 // this call position the cache indirect
964 Any aBookmarkToDelete( m_aBookmark );
966 sal_Int32 nDeletePosition = m_pCache->getRow();
967
968 notifyRowSetAndClonesRowDelete( aBookmarkToDelete );
969
970 ORowSetRow aOldValues;
971 if ( m_pCache->m_aMatrixIter != m_pCache->getEnd() && m_pCache->m_aMatrixIter->is() )
972 aOldValues = new ORowSetValueVector( *(*(m_pCache->m_aMatrixIter)) );
973
974 Sequence<Any> aChangedBookmarks;
975 RowsChangeEvent aEvt(*this,RowChangeAction::DELETE,1,aChangedBookmarks);
977
978 m_pCache->deleteRow();
979 notifyRowSetAndClonesRowDeleted( aBookmarkToDelete, nDeletePosition );
980
981 ORowSetNotifier aNotifier( this );
982 // this will call cancelRowModification on the cache if necessary
983
984 // notification order
985 // - rowChanged
986 notifyAllListenersRowChanged(aGuard,aEvt);
987
988 // - IsModified
989 // - IsNew
990 aNotifier.fire( );
991
992 // - RowCount/IsRowCountFinal
993 fireRowcount();
994}
995
996void ORowSet::implCancelRowUpdates( bool _bNotifyModified )
997{
998 ::connectivity::checkDisposed(ORowSet_BASE1::rBHelper.bDisposed);
999
1000 ::osl::MutexGuard aGuard( *m_pMutex );
1002 return; // nothing to do so return
1003
1004 checkCache();
1005 // cancelRowUpdates is not allowed when:
1006 // - standing on the insert row
1007 // - the concurrency is read only
1008 // - the current row is deleted
1009 if ( m_bNew || m_nResultSetConcurrency == ResultSetConcurrency::READ_ONLY )
1011
1013
1014 ORowSetRow aOldValues;
1015 if ( !m_bModified && _bNotifyModified && !m_aCurrentRow.isNull() )
1016 aOldValues = new ORowSetValueVector( *(*m_aCurrentRow) );
1017
1018 m_pCache->cancelRowUpdates();
1019
1020 m_aBookmark = m_pCache->getBookmark();
1021 m_aCurrentRow = m_pCache->m_aMatrixIter;
1022 m_bIsInsertRow = false;
1023
1024 // notification order
1025 // IsModified
1026 if( !m_bModified && _bNotifyModified )
1027 {
1028 // - column values
1031 }
1032}
1033
1035{
1036 implCancelRowUpdates( true );
1037}
1038
1039void SAL_CALL ORowSet::addRowSetListener( const Reference< XRowSetListener >& listener )
1040{
1041 ::connectivity::checkDisposed(ORowSet_BASE1::rBHelper.bDisposed);
1042
1043 ::osl::MutexGuard aGuard( m_aColumnsMutex );
1044 if(listener.is())
1046}
1047
1048void SAL_CALL ORowSet::removeRowSetListener( const Reference< XRowSetListener >& listener )
1049{
1050 ::connectivity::checkDisposed(ORowSet_BASE1::rBHelper.bDisposed);
1051
1052 ::osl::MutexGuard aGuard( m_aColumnsMutex );
1053 if(listener.is())
1055}
1056
1057void ORowSet::notifyAllListeners(::osl::ResettableMutexGuard& _rGuard)
1058{
1059 EventObject aEvt(*m_pMySelf);
1060 _rGuard.clear();
1061 m_aRowsetListeners.notifyEach( &XRowSetListener::rowSetChanged, aEvt );
1062 _rGuard.reset();
1063}
1064
1065void ORowSet::notifyAllListenersCursorMoved(::osl::ResettableMutexGuard& _rGuard)
1066{
1067 EventObject aEvt(*m_pMySelf);
1068 _rGuard.clear();
1069 m_aRowsetListeners.notifyEach( &XRowSetListener::cursorMoved, aEvt );
1070 _rGuard.reset();
1071}
1072
1073void ORowSet::notifyAllListenersRowChanged(::osl::ResettableMutexGuard& _rGuard, const RowsChangeEvent& aEvt)
1074{
1075 _rGuard.clear();
1076 m_aRowsetListeners.notifyEach( &XRowSetListener::rowChanged, static_cast<EventObject>(aEvt) );
1077 m_aRowsChangeListener.notifyEach( &XRowsChangeListener::rowsChanged, aEvt );
1078 _rGuard.reset();
1079}
1080
1081bool ORowSet::notifyAllListenersCursorBeforeMove(::osl::ResettableMutexGuard& _rGuard)
1082{
1083 EventObject aEvt(*m_pMySelf);
1084 std::vector< Reference< css::sdb::XRowSetApproveListener > > aListenerSeq = m_aApproveListeners.getElements();
1085 _rGuard.clear();
1086 bool bCheck = std::all_of(aListenerSeq.rbegin(), aListenerSeq.rend(),
1087 [&aEvt](Reference<css::sdb::XRowSetApproveListener>& rxItem) {
1088 try
1089 {
1090 return static_cast<bool>(rxItem->approveCursorMove(aEvt));
1091 }
1092 catch( RuntimeException& )
1093 {
1094 return true;
1095 }
1096 });
1097 _rGuard.reset();
1098 return bCheck;
1099}
1100
1101void ORowSet::notifyAllListenersRowBeforeChange(::osl::ResettableMutexGuard& _rGuard,const RowChangeEvent &aEvt)
1102{
1103 std::vector< Reference< css::sdb::XRowSetApproveListener > > aListenerSeq = m_aApproveListeners.getElements();
1104 _rGuard.clear();
1105 bool bCheck = std::all_of(aListenerSeq.rbegin(), aListenerSeq.rend(),
1106 [&aEvt](Reference<css::sdb::XRowSetApproveListener>& rxItem) {
1107 try
1108 {
1109 return static_cast<bool>(rxItem->approveRowChange(aEvt));
1110 }
1111 catch( RuntimeException& )
1112 {
1113 return true;
1114 }
1115 });
1116 _rGuard.reset();
1117
1118 if ( !bCheck )
1119 m_aErrors.raiseTypedException( sdb::ErrorCondition::ROW_SET_OPERATION_VETOED, *this, ::cppu::UnoType< RowSetVetoException >::get() );
1120}
1121
1123{
1124 sal_Int32 nCurrentRowCount( impl_getRowCount() );
1125 bool bCurrentRowCountFinal( m_pCache->m_bRowCountFinal );
1126
1127 if ( m_nLastKnownRowCount != nCurrentRowCount )
1128 {
1129 sal_Int32 nHandle = PROPERTY_ID_ROWCOUNT;
1130 Any aNew,aOld;
1131 aNew <<= nCurrentRowCount; aOld <<= m_nLastKnownRowCount;
1132 fire(&nHandle,&aNew,&aOld,1,false);
1133 m_nLastKnownRowCount = nCurrentRowCount;
1134 }
1135 if ( !m_bLastKnownRowCountFinal && ( m_bLastKnownRowCountFinal != bCurrentRowCountFinal ) )
1136 {
1138 Any aNew,aOld;
1139 aNew <<= bCurrentRowCountFinal;
1141 fire(&nHandle,&aNew,&aOld,1,false);
1142 m_bLastKnownRowCountFinal = bCurrentRowCountFinal;
1143 }
1144}
1145
1147{
1148 ::connectivity::checkDisposed(ORowSet_BASE1::rBHelper.bDisposed);
1149
1150 ::osl::ResettableMutexGuard aGuard( *m_pMutex );
1152 if ( ( m_pCache->m_nPrivileges & Privilege::INSERT ) != Privilege::INSERT )
1153 ::dbtools::throwSQLException( DBA_RES( RID_STR_NO_INSERT_PRIVILEGE ), StandardSQLState::GENERAL_ERROR, *this );
1154
1155 if ( !notifyAllListenersCursorBeforeMove( aGuard ) )
1156 return;
1157
1158 // remember old value for fire
1159 ORowSetRow aOldValues;
1160 if ( rowDeleted() )
1161 {
1163 m_pCache->next();
1164 setCurrentRow( true, false, aOldValues, aGuard);
1165 }
1166 else
1168
1169 // check before because the resultset could be empty
1170 if ( !m_bBeforeFirst
1171 && !m_bAfterLast
1172 && m_pCache->m_aMatrixIter != m_pCache->getEnd()
1173 && m_pCache->m_aMatrixIter->is()
1174 )
1175 aOldValues = new ORowSetValueVector( *(*(m_pCache->m_aMatrixIter)) );
1176
1177 const bool bNewState = m_bNew;
1178 const bool bModState = m_bModified;
1179
1180 m_pCache->moveToInsertRow();
1181 m_aCurrentRow = m_pCache->m_aInsertRow;
1182 m_bIsInsertRow = true;
1183
1184 // set read-only flag to false
1186
1187 // notification order
1188 // - column values
1190
1191 // - cursorMoved
1193
1194 // - IsModified
1195 if ( bModState != m_bModified )
1197
1198 // - IsNew
1199 if ( bNewState != m_bNew )
1200 fireProperty( PROPERTY_ID_ISNEW, m_bNew, bNewState );
1201
1202 // - RowCount/IsRowCountFinal
1203 fireRowcount();
1204}
1205
1207{
1209 m_aReadOnlyDataColumns.resize(m_aDataColumns.size(),false);
1210 std::vector<bool, std::allocator<bool> >::iterator aReadIter = m_aReadOnlyDataColumns.begin();
1211 for (auto const& dataColumn : m_aDataColumns)
1212 {
1213 bool bReadOnly = false;
1214 dataColumn->getPropertyValue(PROPERTY_ISREADONLY) >>= bReadOnly;
1215 *aReadIter = bReadOnly;
1216
1217 dataColumn->setPropertyValue(PROPERTY_ISREADONLY,Any(false));
1218 ++aReadIter;
1219 }
1220}
1221
1223{
1224 assert(m_aDataColumns.size() == m_aReadOnlyDataColumns.size() || m_aReadOnlyDataColumns.size() == 0 );
1225 TDataColumns::const_iterator aIter = m_aDataColumns.begin();
1226 for (bool readOnlyDataColumn : m_aReadOnlyDataColumns)
1227 {
1228 (*aIter)->setPropertyValue(PROPERTY_ISREADONLY, Any(readOnlyDataColumn) );
1229 ++aIter;
1230 }
1231 m_aReadOnlyDataColumns.clear();
1232}
1233
1235{
1236 ::connectivity::checkDisposed(ORowSet_BASE1::rBHelper.bDisposed);
1237
1238 ::osl::ResettableMutexGuard aGuard( *m_pMutex );
1240
1241 if ( !m_pCache->m_bNew && !m_bModified )
1242 // nothing to do if we're not on the insertion row, and not modified otherwise
1243 return;
1244
1245 if ( rowDeleted() )
1246 // this would perhaps even justify a RuntimeException...
1247 // if the current row is deleted, then no write access to this row should be possible. So,
1248 // m_bModified should be true. Also, as soon as somebody calls moveToInsertRow,
1249 // our current row should not be deleted anymore. So, we should not have survived the above
1250 // check "if ( !m_pCache->m_bNew && !m_bModified )"
1251 ::dbtools::throwSQLException( DBA_RES( RID_STR_ROW_ALREADY_DELETED ), StandardSQLState::FUNCTION_SEQUENCE_ERROR, *this );
1252
1253 if ( !notifyAllListenersCursorBeforeMove( aGuard ) )
1254 return;
1255
1257
1258 ORowSetNotifier aNotifier( this );
1259
1260 // notification order
1261 // - cursorMoved
1263
1264 // - IsModified
1265 // - IsNew
1266 aNotifier.fire();
1267}
1268
1269// XRow
1271{
1272 ::osl::MutexGuard aGuard( *m_pMutex );
1273 checkCache();
1274
1275 return ( m_pCache && isInsertRow() ) ? (**m_pCache->m_aInsertRow)[m_nLastColumnIndex].isNull() : ORowSetBase::wasNull();
1276}
1277
1278const ORowSetValue& ORowSet::getInsertValue(sal_Int32 columnIndex)
1279{
1280 checkCache();
1281
1282 if ( m_pCache && isInsertRow() )
1283 {
1284 m_nLastColumnIndex = columnIndex;
1285 return (**m_pCache->m_aInsertRow)[m_nLastColumnIndex];
1286 }
1287 return getValue(columnIndex);
1288}
1289
1290OUString SAL_CALL ORowSet::getString( sal_Int32 columnIndex )
1291{
1292 ::osl::MutexGuard aGuard( *m_pMutex );
1293 return getInsertValue(columnIndex).getString();
1294}
1295
1296sal_Bool SAL_CALL ORowSet::getBoolean( sal_Int32 columnIndex )
1297{
1298 ::osl::MutexGuard aGuard( *m_pMutex );
1299 return getInsertValue(columnIndex).getBool();
1300}
1301
1302sal_Int8 SAL_CALL ORowSet::getByte( sal_Int32 columnIndex )
1303{
1304 ::osl::MutexGuard aGuard( *m_pMutex );
1305 return getInsertValue(columnIndex).getInt8();
1306}
1307
1308sal_Int16 SAL_CALL ORowSet::getShort( sal_Int32 columnIndex )
1309{
1310 ::osl::MutexGuard aGuard( *m_pMutex );
1311 return getInsertValue(columnIndex).getInt16();
1312}
1313
1314sal_Int32 SAL_CALL ORowSet::getInt( sal_Int32 columnIndex )
1315{
1316 ::osl::MutexGuard aGuard( *m_pMutex );
1317 return getInsertValue(columnIndex).getInt32();
1318}
1319
1320sal_Int64 SAL_CALL ORowSet::getLong( sal_Int32 columnIndex )
1321{
1322 ::osl::MutexGuard aGuard( *m_pMutex );
1323 return getInsertValue(columnIndex).getLong();
1324}
1325
1326float SAL_CALL ORowSet::getFloat( sal_Int32 columnIndex )
1327{
1328 ::osl::MutexGuard aGuard( *m_pMutex );
1329 return getInsertValue(columnIndex).getFloat();
1330}
1331
1332double SAL_CALL ORowSet::getDouble( sal_Int32 columnIndex )
1333{
1334 ::osl::MutexGuard aGuard( *m_pMutex );
1335 return getInsertValue(columnIndex).getDouble();
1336}
1337
1338Sequence< sal_Int8 > SAL_CALL ORowSet::getBytes( sal_Int32 columnIndex )
1339{
1340 ::osl::MutexGuard aGuard( *m_pMutex );
1341 return getInsertValue(columnIndex).getSequence();
1342}
1343
1344css::util::Date SAL_CALL ORowSet::getDate( sal_Int32 columnIndex )
1345{
1346 ::osl::MutexGuard aGuard( *m_pMutex );
1347 return getInsertValue(columnIndex).getDate();
1348}
1349
1350css::util::Time SAL_CALL ORowSet::getTime( sal_Int32 columnIndex )
1351{
1352 ::osl::MutexGuard aGuard( *m_pMutex );
1353 return getInsertValue(columnIndex).getTime();
1354}
1355
1356css::util::DateTime SAL_CALL ORowSet::getTimestamp( sal_Int32 columnIndex )
1357{
1358 ::osl::MutexGuard aGuard( *m_pMutex );
1359 return getInsertValue(columnIndex).getDateTime();
1360}
1361
1362Reference< css::io::XInputStream > SAL_CALL ORowSet::getBinaryStream( sal_Int32 columnIndex )
1363{
1364 ::osl::MutexGuard aGuard( *m_pMutex );
1365 if ( m_pCache && isInsertRow() )
1366 {
1367 checkCache();
1368 m_nLastColumnIndex = columnIndex;
1369 return new ::comphelper::SequenceInputStream((**m_pCache->m_aInsertRow)[m_nLastColumnIndex].getSequence());
1370 }
1371
1372 return ORowSetBase::getBinaryStream(columnIndex);
1373}
1374
1375Reference< css::io::XInputStream > SAL_CALL ORowSet::getCharacterStream( sal_Int32 columnIndex )
1376{
1377 ::osl::MutexGuard aGuard( *m_pMutex );
1378 if(m_pCache && isInsertRow() )
1379 {
1380 checkCache();
1381 m_nLastColumnIndex = columnIndex;
1382 return new ::comphelper::SequenceInputStream((**m_pCache->m_aInsertRow)[m_nLastColumnIndex].getSequence());
1383 }
1384
1385 return ORowSetBase::getCharacterStream(columnIndex);
1386}
1387
1388Any SAL_CALL ORowSet::getObject( sal_Int32 columnIndex, const Reference< XNameAccess >& /*typeMap*/ )
1389{
1390 ::osl::MutexGuard aGuard( *m_pMutex );
1391 return getInsertValue(columnIndex).makeAny();
1392}
1393
1394Reference< XRef > SAL_CALL ORowSet::getRef( sal_Int32 /*columnIndex*/ )
1395{
1396 return Reference< XRef >();
1397}
1398
1399Reference< XBlob > SAL_CALL ORowSet::getBlob( sal_Int32 columnIndex )
1400{
1401 if ( m_pCache && isInsertRow() )
1402 {
1403 checkCache();
1404 m_nLastColumnIndex = columnIndex;
1405 return new ::connectivity::BlobHelper((**m_pCache->m_aInsertRow)[m_nLastColumnIndex].getSequence());
1406 }
1407 return ORowSetBase::getBlob(columnIndex);
1408}
1409
1410Reference< XClob > SAL_CALL ORowSet::getClob( sal_Int32 columnIndex )
1411{
1412 return Reference< XClob >(getInsertValue(columnIndex).makeAny(),UNO_QUERY);
1413}
1414
1415Reference< XArray > SAL_CALL ORowSet::getArray( sal_Int32 /*columnIndex*/ )
1416{
1417 return Reference< XArray >();
1418}
1419
1420void SAL_CALL ORowSet::executeWithCompletion( const Reference< XInteractionHandler >& _rxHandler )
1421{
1422 if (!_rxHandler.is())
1423 execute();
1424
1425 ::connectivity::checkDisposed(ORowSet_BASE1::rBHelper.bDisposed);
1426
1427 // tell everybody that we will change the result set
1429
1430 ResettableMutexGuard aGuard( m_aMutex );
1431
1432 try
1433 {
1435
1436 // calc the connection to be used
1438 {
1439 // there was a setProperty(ActiveConnection), but a setProperty(DataSource) _after_ that, too
1440 Reference< XConnection > xXConnection;
1441 setActiveConnection( xXConnection );
1442 }
1443 calcConnection( _rxHandler );
1445
1446 Reference< XSingleSelectQueryComposer > xComposer = getCurrentSettingsComposer( this, m_aContext, nullptr );
1447 Reference<XParametersSupplier> xParameters(xComposer, UNO_QUERY);
1448
1449 Reference<XIndexAccess> xParamsAsIndicies = xParameters.is() ? xParameters->getParameters() : Reference<XIndexAccess>();
1450 const sal_Int32 nParamCount = xParamsAsIndicies.is() ? xParamsAsIndicies->getCount() : 0;
1451 if ( m_aParametersSet.size() < o3tl::make_unsigned(nParamCount) )
1452 m_aParametersSet.resize( nParamCount ,false);
1453
1454 ::dbtools::askForParameters( xComposer, this, m_xActiveConnection, _rxHandler,m_aParametersSet );
1455 }
1456 // ensure that only the allowed exceptions leave this block
1457 catch(SQLException&)
1458 {
1459 throw;
1460 }
1461 catch(RuntimeException&)
1462 {
1463 throw;
1464 }
1465 catch(Exception const &)
1466 {
1467 TOOLS_WARN_EXCEPTION("dbaccess", "ORowSet::executeWithCompletion: caught an unexpected exception type while filling in the parameters");
1468 }
1469
1470 // we're done with the parameters, now for the real execution
1471
1472 // do the real execute
1474}
1475
1476Reference< XIndexAccess > SAL_CALL ORowSet::getParameters( )
1477{
1478 ::osl::MutexGuard aGuard( *m_pMutex );
1479 ::connectivity::checkDisposed(ORowSet_BASE1::rBHelper.bDisposed);
1480
1482 // need to rebuild the parameters, since some property which contributes to the
1483 // complete command, and thus the parameters, changed
1485
1486 if ( !m_pParameters && !m_aCommand.isEmpty() )
1487 {
1488 try
1489 {
1490 OUString sNotInterestedIn;
1491 impl_initComposer_throw( sNotInterestedIn );
1492 }
1493 catch( const Exception& )
1494 {
1495 DBG_UNHANDLED_EXCEPTION("dbaccess");
1496 }
1497 }
1498
1499 // our caller could change our parameters at any time
1500 m_bParametersDirty = true;
1501
1502 return m_pParameters;
1503}
1504
1506{
1507 ::osl::MutexGuard aGuard( m_aColumnsMutex );
1508 EventObject aEvt(*this);
1509
1511 while ( aApproveIter.hasMoreElements() )
1512 {
1513 Reference< XRowSetApproveListener > xListener( aApproveIter.next() );
1514 try
1515 {
1516 if ( !xListener->approveRowSetChange( aEvt ) )
1517 throw RowSetVetoException();
1518 }
1519 catch ( const DisposedException& e )
1520 {
1521 if ( e.Context == xListener )
1522 aApproveIter.remove();
1523 }
1524 catch ( const RuntimeException& ) { throw; }
1525 catch ( const RowSetVetoException& ) { throw; }
1526 catch ( const Exception& )
1527 {
1528 DBG_UNHANDLED_EXCEPTION("dbaccess");
1529 }
1530 }
1531}
1532
1533// XRowSet
1534void SAL_CALL ORowSet::execute( )
1535{
1536 ::connectivity::checkDisposed(ORowSet_BASE1::rBHelper.bDisposed);
1537
1538 // tell everybody that we will change the result set
1540
1541 ResettableMutexGuard aGuard( m_aMutex );
1543
1544 // calc the connection to be used
1546 // there was a setProperty(ActiveConnection), but a setProperty(DataSource) _after_ that, too
1547 Reference< XConnection> xXConnection;
1548 setActiveConnection( xXConnection );
1549 }
1550
1551 calcConnection(nullptr);
1553
1554 // do the real execute
1556}
1557
1558void ORowSet::setStatementResultSetType( const Reference< XPropertySet >& _rxStatement, sal_Int32 _nDesiredResultSetType, sal_Int32 _nDesiredResultSetConcurrency )
1559{
1560 OSL_ENSURE( _rxStatement.is(), "ORowSet::setStatementResultSetType: invalid statement - this will crash!" );
1561
1562 sal_Int32 nResultSetType( _nDesiredResultSetType );
1563 sal_Int32 nResultSetConcurrency( _nDesiredResultSetConcurrency );
1564
1565 // there *might* be a data source setting which tells use to be more defensive with those settings
1566 // #i15113#
1567 bool bRespectDriverRST = false;
1568 Any aSetting;
1569 if ( getDataSourceSetting( ::dbaccess::getDataSource( m_xActiveConnection ), "RespectDriverResultSetType", aSetting ) )
1570 {
1571 OSL_VERIFY( aSetting >>= bRespectDriverRST );
1572 }
1573
1574 if ( bRespectDriverRST )
1575 {
1576 // try type/concurrency settings with decreasing usefulness, and rely on what the connection claims
1577 // to support
1578 Reference< XDatabaseMetaData > xMeta( m_xActiveConnection->getMetaData() );
1579
1580 sal_Int32 nCharacteristics[5][2] =
1581 { { ResultSetType::SCROLL_SENSITIVE, ResultSetConcurrency::UPDATABLE },
1582 { ResultSetType::SCROLL_INSENSITIVE, ResultSetConcurrency::UPDATABLE },
1583 { ResultSetType::SCROLL_SENSITIVE, ResultSetConcurrency::READ_ONLY },
1584 { ResultSetType::SCROLL_INSENSITIVE, ResultSetConcurrency::READ_ONLY },
1585 { ResultSetType::FORWARD_ONLY, ResultSetConcurrency::READ_ONLY }
1586 };
1587 sal_Int32 i=0;
1588 if ( m_xActiveConnection->getMetaData()->isReadOnly() )
1589 i = 2; // if the database is read-only we only should use read-only concurrency
1590
1591 for ( ; i<5; ++i )
1592 {
1593 nResultSetType = nCharacteristics[i][0];
1594 nResultSetConcurrency = nCharacteristics[i][1];
1595
1596 // don't try type/concurrency pairs which are more featured than what our caller requested
1597 if ( nResultSetType > _nDesiredResultSetType )
1598 continue;
1599 if ( nResultSetConcurrency > _nDesiredResultSetConcurrency )
1600 continue;
1601
1602 if ( xMeta.is() && xMeta->supportsResultSetConcurrency( nResultSetType, nResultSetConcurrency ) )
1603 break;
1604 }
1605 }
1606
1607 _rxStatement->setPropertyValue( PROPERTY_RESULTSETTYPE, Any( nResultSetType ) );
1608 _rxStatement->setPropertyValue( PROPERTY_RESULTSETCONCURRENCY, Any( nResultSetConcurrency ) );
1609}
1610
1612{
1613 OUString sCommandToExecute;
1615 {
1616 impl_initComposer_throw( sCommandToExecute );
1617 }
1618 else
1619 {
1620 sCommandToExecute = m_bUseEscapeProcessing ? m_xComposer->getQueryWithSubstitution() : m_aActiveCommand;
1621 }
1622
1623 try
1624 {
1625 m_xStatement = m_xActiveConnection->prepareStatement( sCommandToExecute );
1626 if ( !m_xStatement.is() )
1627 {
1628 ::dbtools::throwSQLException( DBA_RES( RID_STR_INTERNAL_ERROR ), StandardSQLState::GENERAL_ERROR, *this );
1629 }
1630
1631 Reference< XPropertySet > xStatementProps( m_xStatement, UNO_QUERY_THROW );
1632 // set the result set type and concurrency
1633 try
1634 {
1635 xStatementProps->setPropertyValue( PROPERTY_USEBOOKMARKS, Any( true ) );
1636 xStatementProps->setPropertyValue( PROPERTY_MAXROWS, Any( m_nMaxRows ) );
1637
1639 }
1640 catch ( const Exception& )
1641 {
1642 // this exception doesn't matter here because when we catch an exception
1643 // then the driver doesn't support this feature
1644 }
1645 }
1646 catch (SQLException& rException)
1647 {
1648 css::sdbc::SQLException* pLastExceptionInChain = SQLExceptionInfo::getLastException(&rException);
1649 assert(pLastExceptionInChain && "will at least be &rException");
1650
1651 // append information about what we were actually going to execute
1652 OUString sInfo(m_sErrorString.replaceFirst("$command$", sCommandToExecute));
1653 css::uno::Any aAppend = SQLExceptionInfo::createException(SQLExceptionInfo::TYPE::SQLContext, sInfo, OUString(), 0);
1654 pLastExceptionInChain->NextException = aAppend;
1655
1656 // propagate
1657 throw;
1658 }
1659}
1660
1662{
1664
1665 m_aParameterValueForCache->resize(1);
1666 Reference< XParameters > xParam( m_xStatement, UNO_QUERY_THROW );
1667 size_t nParamCount( m_pParameters.is() ? m_pParameters->size() : m_aPrematureParamValues->size() );
1668 for ( size_t i=1; i<=nParamCount; ++i )
1669 {
1670 ORowSetValue& rParamValue( getParameterStorage( static_cast<sal_Int32>(i) ) );
1671 ::dbtools::setObjectWithInfo( xParam, i, rParamValue.makeAny(), rParamValue.getTypeKind() );
1672 m_aParameterValueForCache->push_back(rParamValue);
1673 }
1674 m_bParametersDirty = false;
1675
1676 Reference< XResultSet > xResultSet(m_xStatement->executeQuery());
1677
1678 OUString aComposedUpdateTableName;
1679 if ( !m_aUpdateTableName.isEmpty() )
1680 aComposedUpdateTableName = composeTableName( m_xActiveConnection->getMetaData(), m_aUpdateCatalogName, m_aUpdateSchemaName, m_aUpdateTableName, false, ::dbtools::EComposeRule::InDataManipulation );
1681
1682 SAL_INFO("dbaccess", "ORowSet::impl_prepareAndExecute_throw: creating cache" );
1683 m_pCache =
1684 std::make_shared<ORowSetCache>(xResultSet, m_xComposer.get(), m_aContext, aComposedUpdateTableName,
1686 if ( m_nResultSetConcurrency == ResultSetConcurrency::READ_ONLY )
1687 {
1688 m_nPrivileges = Privilege::SELECT;
1689 m_pCache->m_nPrivileges = Privilege::SELECT;
1690 }
1691 m_pCache->setFetchSize(m_nFetchSize);
1692 m_aCurrentRow = m_pCache->createIterator(this);
1693 m_bIsInsertRow = false;
1694 m_aOldRow = m_pCache->registerOldRow();
1695
1696 return xResultSet;
1697}
1698
1699void ORowSet::impl_initializeColumnSettings_nothrow( const Reference< XPropertySet >& _rxTemplateColumn, const Reference< XPropertySet >& _rxRowSetColumn )
1700{
1701 OSL_ENSURE( _rxTemplateColumn.is() && _rxRowSetColumn.is(),
1702 "ORowSet::impl_initializeColumnSettings_nothrow: this will crash!" );
1703
1704 bool bHaveAnyColumnSetting = false;
1705 try
1706 {
1707 Reference< XPropertySetInfo > xInfo( _rxTemplateColumn->getPropertySetInfo(), UNO_SET_THROW );
1708
1709 // a number of properties is plain copied
1710 const OUString aPropertyNames[] = {
1711 OUString(PROPERTY_ALIGN), OUString(PROPERTY_RELATIVEPOSITION), OUString(PROPERTY_WIDTH), OUString(PROPERTY_HIDDEN), OUString(PROPERTY_CONTROLMODEL),
1712 OUString(PROPERTY_HELPTEXT), OUString(PROPERTY_CONTROLDEFAULT)
1713 };
1714 for (const auto & aPropertyName : aPropertyNames)
1715 {
1716 if ( xInfo->hasPropertyByName( aPropertyName ) )
1717 {
1718 _rxRowSetColumn->setPropertyValue( aPropertyName, _rxTemplateColumn->getPropertyValue( aPropertyName ) );
1719 bHaveAnyColumnSetting = true;
1720 }
1721 }
1722
1723 // the format key is slightly more complex
1724 sal_Int32 nFormatKey = 0;
1725 if( xInfo->hasPropertyByName( PROPERTY_NUMBERFORMAT ) )
1726 {
1727 _rxTemplateColumn->getPropertyValue( PROPERTY_NUMBERFORMAT ) >>= nFormatKey;
1728 bHaveAnyColumnSetting = true;
1729 }
1730 if ( !nFormatKey && m_xNumberFormatTypes.is() )
1731 nFormatKey = ::dbtools::getDefaultNumberFormat( _rxTemplateColumn, m_xNumberFormatTypes, SvtSysLocale().GetLanguageTag().getLocale() );
1732 _rxRowSetColumn->setPropertyValue( PROPERTY_NUMBERFORMAT, Any( nFormatKey ) );
1733 }
1734 catch(Exception&)
1735 {
1736 DBG_UNHANDLED_EXCEPTION("dbaccess");
1737 return;
1738 }
1739
1740 if ( bHaveAnyColumnSetting )
1741 return;
1742
1743 // the template column could not provide *any* setting. Okay, probably it's a parser column, which
1744 // does not offer those. However, perhaps the template column refers to a table column, which we
1745 // can use as new template column
1746 try
1747 {
1748 Reference< XPropertySetInfo > xInfo( _rxTemplateColumn->getPropertySetInfo(), UNO_SET_THROW );
1749 if ( !xInfo->hasPropertyByName( PROPERTY_TABLENAME ) )
1750 // no chance
1751 return;
1752
1753 OUString sTableName;
1754 OSL_VERIFY( _rxTemplateColumn->getPropertyValue( PROPERTY_TABLENAME ) >>= sTableName );
1755
1756 Reference< XNameAccess > xTables( impl_getTables_throw(), UNO_SET_THROW );
1757 if ( !xTables->hasByName( sTableName ) )
1758 // no chance
1759 return;
1760
1761 Reference< XColumnsSupplier > xTableColSup( xTables->getByName( sTableName ), UNO_QUERY_THROW );
1762 Reference< XNameAccess > xTableCols( xTableColSup->getColumns(), UNO_SET_THROW );
1763
1764 OUString sTableColumnName;
1765
1766 // get the "Name" or (preferred) "RealName" property of the column
1767 OUString sNamePropertyName( PROPERTY_NAME );
1768 if ( xInfo->hasPropertyByName( PROPERTY_REALNAME ) )
1769 sNamePropertyName = PROPERTY_REALNAME;
1770 OSL_VERIFY( _rxTemplateColumn->getPropertyValue( sNamePropertyName ) >>= sTableColumnName );
1771
1772 if ( !xTableCols->hasByName( sTableColumnName ) )
1773 return;
1774
1775 Reference< XPropertySet > xTableColumn( xTableCols->getByName( sTableColumnName ), UNO_QUERY_THROW );
1776 impl_initializeColumnSettings_nothrow( xTableColumn, _rxRowSetColumn );
1777 }
1778 catch( const Exception& )
1779 {
1780 DBG_UNHANDLED_EXCEPTION("dbaccess");
1781 }
1782}
1783
1784void ORowSet::execute_NoApprove_NoNewConn(ResettableMutexGuard& _rClearForNotification)
1785{
1786 // now we can dispose our old connection
1787 ::comphelper::disposeComponent(m_xOldConnection);
1788 m_xOldConnection = nullptr;
1789
1790 // do we need a new statement
1792 {
1793 m_xStatement = nullptr;
1794 m_xComposer = nullptr;
1795
1796 Reference< XResultSet > xResultSet( impl_prepareAndExecute_throw() );
1797
1798 // let our warnings container forget the reference to the (possibly disposed) old result set
1800 // clear all current warnings
1802 // let the warnings container know about the new "external warnings"
1803 m_aWarnings.setExternalWarnings( Reference< XWarningsSupplier >( xResultSet, UNO_QUERY ) );
1804
1805 // get the locale
1807
1808 // get the numberformatTypes
1809 OSL_ENSURE(m_xActiveConnection.is(),"No ActiveConnection");
1810 Reference< XNumberFormatsSupplier> xNumberFormat = ::dbtools::getNumberFormats(m_xActiveConnection);
1811 if ( xNumberFormat.is() )
1812 m_xNumberFormatTypes.set(xNumberFormat->getNumberFormats(),UNO_QUERY);
1813
1814 ::rtl::Reference< ::connectivity::OSQLColumns> aColumns = new ::connectivity::OSQLColumns();
1815 std::vector< OUString> aNames;
1816 OUString aDescription;
1817
1818 const std::map<sal_Int32,sal_Int32>& rKeyColumns = m_pCache->getKeyColumns();
1819 if(!m_xColumns.is())
1820 {
1821 SAL_INFO("dbaccess", "ORowSet::execute_NoApprove_NoNewConn::creating columns" );
1822 // use the meta data
1823 Reference<XResultSetMetaDataSupplier> xMetaSup(m_xStatement,UNO_QUERY);
1824 try
1825 {
1826 Reference<XResultSetMetaData> xMetaData = xMetaSup->getMetaData();
1827 if ( xMetaData.is() )
1828 {
1829 sal_Int32 nCount = xMetaData->getColumnCount();
1830 m_aDataColumns.reserve(nCount+1);
1831 aColumns->reserve(nCount+1);
1832 std::map< OUString, int > aColumnMap;
1833 for (sal_Int32 i = 0 ; i < nCount; ++i)
1834 {
1835 // retrieve the name of the column
1836 OUString sName = xMetaData->getColumnName(i + 1);
1837 // check for duplicate entries
1838 if(aColumnMap.find(sName) != aColumnMap.end())
1839 {
1840 OUString sAlias(sName);
1841 sal_Int32 searchIndex=1;
1842 while(aColumnMap.find(sAlias) != aColumnMap.end())
1843 {
1844 sAlias = sName + OUString::number(searchIndex++);
1845 }
1846 sName = sAlias;
1847 }
1849 this,
1850 this,
1851 i+1,
1852 m_xActiveConnection->getMetaData(),
1853 aDescription,
1854 OUString(),
1855 [this] (sal_Int32 const column) -> ORowSetValue const& {
1856 return this->getInsertValue(column);
1857 });
1858 aColumnMap.insert(std::make_pair(sName,0));
1859 aColumns->emplace_back(pColumn);
1860 pColumn->setName(sName);
1861 aNames.push_back(sName);
1862 m_aDataColumns.push_back(pColumn.get());
1863
1864 pColumn->setFastPropertyValue_NoBroadcast(PROPERTY_ID_ISREADONLY,Any(rKeyColumns.find(i+1) != rKeyColumns.end()));
1865
1866 try
1867 {
1868 sal_Int32 nFormatKey = 0;
1869 if(m_xNumberFormatTypes.is())
1870 nFormatKey = ::dbtools::getDefaultNumberFormat(pColumn,m_xNumberFormatTypes,aLocale);
1871
1872
1873 pColumn->setFastPropertyValue_NoBroadcast(PROPERTY_ID_NUMBERFORMAT,Any(nFormatKey));
1874 pColumn->setFastPropertyValue_NoBroadcast(PROPERTY_ID_RELATIVEPOSITION,Any(sal_Int32(i+1)));
1875 pColumn->setFastPropertyValue_NoBroadcast(PROPERTY_ID_WIDTH,Any(sal_Int32(227)));
1876 pColumn->setFastPropertyValue_NoBroadcast(PROPERTY_ID_ALIGN,Any(sal_Int32(0)));
1877 pColumn->setFastPropertyValue_NoBroadcast(PROPERTY_ID_HIDDEN, css::uno::Any(false));
1878 }
1879 catch(Exception&)
1880 {
1881 }
1882 }
1883 }
1884 }
1885 catch (SQLException&)
1886 {
1887 }
1888 }
1889 else
1890 {
1891 // create the rowset columns
1892 Reference< XResultSetMetaData > xMeta( getMetaData(), UNO_SET_THROW );
1893 sal_Int32 nCount = xMeta->getColumnCount();
1894 m_aDataColumns.reserve(nCount+1);
1895 aColumns->reserve(nCount+1);
1896 std::set< Reference< XPropertySet > > aAllColumns;
1897
1898 for(sal_Int32 i=1; i <= nCount ;++i)
1899 {
1900 OUString sName = xMeta->getColumnName(i);
1901 OUString sColumnLabel = xMeta->getColumnLabel(i);
1902
1903 // retrieve the column number |i|
1904 Reference<XPropertySet> xColumn;
1905 {
1906 bool bReFetchName = false;
1907 if (m_xColumns->hasByName(sColumnLabel))
1908 m_xColumns->getByName(sColumnLabel) >>= xColumn;
1909 if (!xColumn.is() && m_xColumns->hasByName(sName))
1910 m_xColumns->getByName(sName) >>= xColumn;
1911
1912 // check if column already in the list we need another
1913 if ( aAllColumns.find( xColumn ) != aAllColumns.end() )
1914 {
1915 xColumn = nullptr;
1916 bReFetchName = true;
1917 sColumnLabel.clear();
1918 }
1919 if(!xColumn.is())
1920 {
1921 // no column found so we could look at the position i
1922 Reference<XIndexAccess> xIndexAccess(m_xColumns,UNO_QUERY);
1923 if(xIndexAccess.is() && i <= xIndexAccess->getCount())
1924 {
1925 xIndexAccess->getByIndex(i-1) >>= xColumn;
1926 }
1927 else
1928 {
1929 Sequence< OUString> aSeq = m_xColumns->getElementNames();
1930 if( i <= aSeq.getLength())
1931 {
1932 m_xColumns->getByName(aSeq.getConstArray()[i-1]) >>= xColumn;
1933 }
1934 }
1935 }
1936 if(bReFetchName && xColumn.is())
1937 xColumn->getPropertyValue(PROPERTY_NAME) >>= sName;
1938 aAllColumns.insert( xColumn );
1939 }
1940
1941 // create a RowSetDataColumn
1942 {
1943 Reference<XPropertySetInfo> xInfo = xColumn.is() ? xColumn->getPropertySetInfo() : Reference<XPropertySetInfo>();
1944 if(xInfo.is() && xInfo->hasPropertyByName(PROPERTY_DESCRIPTION))
1945 aDescription = comphelper::getString(xColumn->getPropertyValue(PROPERTY_DESCRIPTION));
1946
1947 OUString sParseLabel;
1948 if ( xColumn.is() )
1949 {
1950 xColumn->getPropertyValue(PROPERTY_LABEL) >>= sParseLabel;
1951 }
1953 this,
1954 this,
1955 i,
1956 m_xActiveConnection->getMetaData(),
1957 aDescription,
1958 sParseLabel,
1959 [this] (sal_Int32 const column) -> ORowSetValue const& {
1960 return this->getInsertValue(column);
1961 });
1962 aColumns->emplace_back(pColumn);
1963
1964 pColumn->setFastPropertyValue_NoBroadcast(PROPERTY_ID_ISREADONLY,Any(rKeyColumns.find(i) != rKeyColumns.end()));
1965
1966 if(sColumnLabel.isEmpty())
1967 {
1968 if(xColumn.is())
1969 xColumn->getPropertyValue(PROPERTY_NAME) >>= sColumnLabel;
1970 else
1971 sColumnLabel = DBA_RES( RID_STR_EXPRESSION1 );
1972 }
1973 pColumn->setName(sColumnLabel);
1974 aNames.push_back(sColumnLabel);
1975 m_aDataColumns.push_back(pColumn.get());
1976
1977 if ( xColumn.is() )
1979 }
1980 }
1981 }
1982 // now create the columns we need
1983 if(m_pColumns)
1984 m_pColumns->assign(aColumns,aNames);
1985 else
1986 {
1987 Reference<XDatabaseMetaData> xMeta = m_xActiveConnection->getMetaData();
1988 m_pColumns.reset( new ORowSetDataColumns(xMeta.is() && xMeta->supportsMixedCaseQuotedIdentifiers(),
1989 aColumns,*this,m_aColumnsMutex,aNames) );
1990 }
1991 }
1992 else // !m_bCommandFacetsDirty
1993 {
1994 Reference< XResultSet > xResultSet;
1996 {
1997 xResultSet = impl_prepareAndExecute_throw();
1998 }
1999 else
2000 {
2001 xResultSet = m_xStatement->executeQuery();
2002 m_pCache->reset(xResultSet);
2003 }
2004 // let our warnings container forget the reference to the (possibly disposed) old result set
2006 // clear all current warnings
2008 // let the warnings container know about the new "external warnings"
2009 m_aWarnings.setExternalWarnings( Reference< XWarningsSupplier >( xResultSet, UNO_QUERY ) );
2010 }
2011 checkCache();
2012 // notify the rowset listeners
2013 notifyAllListeners(_rClearForNotification);
2014}
2015
2016// XRowSetApproveBroadcaster
2017void SAL_CALL ORowSet::addRowSetApproveListener( const Reference< XRowSetApproveListener >& listener )
2018{
2019 ::connectivity::checkDisposed(ORowSet_BASE1::rBHelper.bDisposed);
2020
2021 ::osl::MutexGuard aGuard( m_aColumnsMutex );
2022
2024}
2025
2026void SAL_CALL ORowSet::removeRowSetApproveListener( const Reference< XRowSetApproveListener >& listener )
2027{
2028 ::connectivity::checkDisposed(ORowSet_BASE1::rBHelper.bDisposed);
2029
2030 ::osl::MutexGuard aGuard( m_aColumnsMutex );
2031
2033}
2034
2035// XRowsChangeBroadcaster
2036void SAL_CALL ORowSet::addRowsChangeListener( const Reference< XRowsChangeListener >& listener )
2037{
2038 ::connectivity::checkDisposed(ORowSet_BASE1::rBHelper.bDisposed);
2039
2040 ::osl::MutexGuard aGuard( m_aColumnsMutex );
2041
2043}
2044
2045void SAL_CALL ORowSet::removeRowsChangeListener( const Reference< XRowsChangeListener >& listener )
2046{
2047 ::connectivity::checkDisposed(ORowSet_BASE1::rBHelper.bDisposed);
2048
2049 ::osl::MutexGuard aGuard( m_aColumnsMutex );
2050
2052}
2053
2054// XResultSetAccess
2055Reference< XResultSet > SAL_CALL ORowSet::createResultSet( )
2056{
2057 ::osl::MutexGuard aGuard( m_aColumnsMutex );
2058
2059 if(m_xStatement.is())
2060 {
2062 m_aClones.emplace_back(css::uno::Reference< css::uno::XWeak >(pClone));
2063 return pClone;
2064 }
2065 return Reference< XResultSet >();
2066}
2067
2068// css::util::XCancellable
2069void SAL_CALL ORowSet::cancel( )
2070{
2071 ::connectivity::checkDisposed(ORowSet_BASE1::rBHelper.bDisposed);
2072}
2073
2074// css::sdbcx::XDeleteRows
2075Sequence< sal_Int32 > SAL_CALL ORowSet::deleteRows( const Sequence< Any >& rows )
2076{
2077 ::connectivity::checkDisposed(ORowSet_BASE1::rBHelper.bDisposed);
2078
2079 if(!m_pCache || m_nResultSetConcurrency == ResultSetConcurrency::READ_ONLY)
2081
2082 ::osl::ResettableMutexGuard aGuard( *m_pMutex );
2083
2084 Sequence<Any> aChangedBookmarks;
2085 RowsChangeEvent aEvt(*this,RowChangeAction::DELETE,rows.getLength(),aChangedBookmarks);
2086 // notify the rowset listeners
2088
2089 Sequence< sal_Int32 > aResults( rows.getLength() );
2090 const Any* row = rows.getConstArray();
2091 const Any* rowEnd = rows.getConstArray() + rows.getLength();
2092 sal_Int32* result = aResults.getArray();
2093 for ( ; row != rowEnd; ++row, ++result )
2094 {
2095 *result = 0;
2096 if ( !m_pCache->moveToBookmark( *row ) )
2097 continue;
2098 sal_Int32 nDeletePosition = m_pCache->getRow();
2099
2100 // first notify the clones so that they can save their position
2102
2103 // now delete the row
2104 if ( !m_pCache->deleteRow() )
2105 continue;
2106 *result = 1;
2107 // now notify that we have deleted
2108 notifyRowSetAndClonesRowDeleted( *row, nDeletePosition );
2109 }
2110 aEvt.Rows = aResults.getLength();
2111
2112 // we have to check if we stand on the insert row and if so we have to reset it
2113 ORowSetNotifier aNotifier( this );
2114 // this will call cancelRowModification on the cache if necessary
2115 // notification order
2116 // - rowChanged
2117 notifyAllListenersRowChanged(aGuard,aEvt);
2118
2119 // - IsModified
2120 // - IsNew
2121 aNotifier.fire();
2122
2123 // - RowCount/IsRowCountFinal
2124 fireRowcount();
2125
2126 return aResults;
2127}
2128
2129void ORowSet::notifyRowSetAndClonesRowDelete( const Any& _rBookmark )
2130{
2131 // notify ourself
2132 onDeleteRow( _rBookmark );
2133 // notify the clones
2134 for (auto const& elem : m_aClones)
2135 {
2136 rtl::Reference<ORowSetClone> pClone = dynamic_cast<ORowSetClone*>(elem.get().get());
2137 if(pClone)
2138 pClone->onDeleteRow( _rBookmark );
2139 }
2140}
2141
2142void ORowSet::notifyRowSetAndClonesRowDeleted( const Any& _rBookmark, sal_Int32 _nPos )
2143{
2144 // notify ourself
2145 onDeletedRow( _rBookmark, _nPos );
2146 // notify the clones
2147 for (auto const& clone : m_aClones)
2148 {
2149 rtl::Reference<ORowSetClone> pClone = dynamic_cast<ORowSetClone*>(clone.get().get());
2150 if(pClone)
2151 pClone->onDeletedRow( _rBookmark, _nPos );
2152 }
2153}
2154
2155Reference< XConnection > ORowSet::calcConnection(const Reference< XInteractionHandler >& _rxHandler)
2156{
2157 MutexGuard aGuard(m_aMutex);
2158 if (!m_xActiveConnection.is())
2159 {
2160 Reference< XConnection > xNewConn;
2161 if ( !m_aDataSourceName.isEmpty() )
2162 {
2163 Reference< XDatabaseContext > xDatabaseContext( DatabaseContext::create(m_aContext) );
2164 try
2165 {
2166 Reference< XDataSource > xDataSource( xDatabaseContext->getByName( m_aDataSourceName ), UNO_QUERY_THROW );
2167
2168 // try connecting with the interaction handler
2169 Reference< XCompletedConnection > xComplConn( xDataSource, UNO_QUERY );
2170 if ( _rxHandler.is() && xComplConn.is() )
2171 {
2172 xNewConn = xComplConn->connectWithCompletion( _rxHandler );
2173 }
2174 else
2175 {
2176 xNewConn = xDataSource->getConnection( m_aUser, m_aPassword );
2177 }
2178 }
2179 catch ( const SQLException& )
2180 {
2181 throw;
2182 }
2183 catch ( const Exception& )
2184 {
2185 Any aError = ::cppu::getCaughtException();
2186 OUString sMessage = ResourceManager::loadString( RID_NO_SUCH_DATA_SOURCE,
2187 "$name$", m_aDataSourceName, "$error$", extractExceptionMessage( m_aContext, aError ) );
2188 ::dbtools::throwGenericSQLException( sMessage, *this, aError );
2189 }
2190 }
2191 setActiveConnection(xNewConn);
2192 m_bOwnConnection = true;
2193 }
2194 return m_xActiveConnection;
2195}
2196
2197Reference< XNameAccess > ORowSet::impl_getTables_throw()
2198{
2199 Reference< XNameAccess > xTables;
2200
2201 Reference< XTablesSupplier > xTablesAccess( m_xActiveConnection, UNO_QUERY );
2202 if ( xTablesAccess.is() )
2203 {
2204 xTables.set( xTablesAccess->getTables(), UNO_SET_THROW );
2205 }
2206 else if ( m_xTables )
2207 {
2208 xTables = m_xTables.get();
2209 }
2210 else
2211 {
2212 if ( !m_xActiveConnection.is() )
2213 throw SQLException(DBA_RES(RID_STR_CONNECTION_INVALID),*this,SQLSTATE_GENERAL,1000,Any() );
2214
2215 bool bCase = true;
2216 try
2217 {
2218 Reference<XDatabaseMetaData> xMeta = m_xActiveConnection->getMetaData();
2219 bCase = xMeta.is() && xMeta->supportsMixedCaseQuotedIdentifiers();
2220 }
2221 catch(SQLException&)
2222 {
2223 DBG_UNHANDLED_EXCEPTION("dbaccess");
2224 }
2225
2226 m_xTables.reset(new OTableContainer(*this,m_aMutex,m_xActiveConnection,bCase,nullptr,nullptr,m_nInAppend));
2227 xTables = m_xTables.get();
2228 Sequence<OUString> aTableFilter { "%" };
2229 m_xTables->construct(aTableFilter,Sequence< OUString>());
2230 }
2231
2232 return xTables;
2233}
2234
2236{
2237 if ( !m_xTables )
2238 return;
2239
2240 try
2241 {
2242 m_xTables->dispose();
2243 }
2244 catch( const Exception& )
2245 {
2246 DBG_UNHANDLED_EXCEPTION("dbaccess");
2247 }
2248
2249 m_xTables.reset();
2250}
2251
2252void ORowSet::impl_initComposer_throw( OUString& _out_rCommandToExecute )
2253{
2254 bool bUseEscapeProcessing = impl_buildActiveCommand_throw( );
2255 _out_rCommandToExecute = m_aActiveCommand;
2256 if ( !bUseEscapeProcessing )
2257 return;
2258
2260 m_xComposer = nullptr;
2261
2262 Reference< XMultiServiceFactory > xFactory( m_xActiveConnection, UNO_QUERY );
2263 if ( !m_xComposer.is() && xFactory.is() )
2264 {
2265 try
2266 {
2267 m_xComposer.set( xFactory->createInstance( SERVICE_NAME_SINGLESELECTQUERYCOMPOSER ), UNO_QUERY_THROW );
2268 }
2269 catch (const Exception& ) { m_xComposer = nullptr; }
2270 }
2271 if ( !m_xComposer.is() )
2273
2274 m_xComposer->setCommand( m_aCommand,m_nCommandType );
2275 m_aActiveCommand = m_xComposer->getQuery();
2276
2277 m_xComposer->setFilter( m_bApplyFilter ? m_aFilter : OUString() );
2278 m_xComposer->setHavingClause( m_bApplyFilter ? m_aHavingClause : OUString() );
2279
2280 if ( m_bIgnoreResult )
2281 { // append a "0=1" filter
2282 // don't simply overwrite an existent filter, this would lead to problems if this existent
2283 // filter contains parameters (since a keyset may add parameters itself)
2284 m_xComposer->setElementaryQuery( m_xComposer->getQuery( ) );
2285 m_xComposer->setFilter( "0 = 1" );
2286 }
2287
2288 m_xComposer->setOrder( m_aOrder );
2289 m_xComposer->setGroup( m_aGroupBy );
2290
2291 if ( !m_xColumns.is() )
2292 {
2293 Reference< XColumnsSupplier > xCols( m_xComposer, UNO_QUERY_THROW );
2294 m_xColumns = xCols->getColumns();
2295 }
2296
2298
2299 _out_rCommandToExecute = m_xComposer->getQueryWithSubstitution();
2300
2301 m_bCommandFacetsDirty = false;
2302}
2303
2305{
2306 // create the sql command
2307 // from a table name or get the command out of a query (not a view)
2308 // the last use the command as it is
2309 bool bDoEscapeProcessing = m_bUseEscapeProcessing;
2310
2311 m_aActiveCommand.clear();
2312 OUString sCommand;
2313
2314 if ( m_aCommand.isEmpty() )
2315 return bDoEscapeProcessing;
2316
2317 switch (m_nCommandType)
2318 {
2319 case CommandType::TABLE:
2320 {
2322 if ( bDoEscapeProcessing )
2323 {
2324 Reference< XNameAccess > xTables( impl_getTables_throw() );
2325 if ( xTables->hasByName(m_aCommand) )
2326 {
2327 }
2328 else
2329 {
2330 OUString sMessage( DBA_RES( RID_STR_TABLE_DOES_NOT_EXIST ) );
2331 throwGenericSQLException(sMessage.replaceAll( "$table$", m_aCommand ),*this);
2332 }
2333 }
2334 else
2335 {
2336 sCommand = "SELECT * FROM ";
2337 OUString sCatalog, sSchema, sTable;
2338 ::dbtools::qualifiedNameComponents( m_xActiveConnection->getMetaData(), m_aCommand, sCatalog, sSchema, sTable, ::dbtools::EComposeRule::InDataManipulation );
2339 sCommand += ::dbtools::composeTableNameForSelect( m_xActiveConnection, sCatalog, sSchema, sTable );
2340 }
2341 }
2342 break;
2343
2344 case CommandType::QUERY:
2345 {
2346 Reference< XQueriesSupplier > xQueriesAccess(m_xActiveConnection, UNO_QUERY);
2347 if (!xQueriesAccess.is())
2348 throw SQLException(DBA_RES(RID_STR_NO_XQUERIESSUPPLIER),*this,OUString(),0,Any());
2349 Reference< css::container::XNameAccess > xQueries(xQueriesAccess->getQueries());
2350 if (xQueries->hasByName(m_aCommand))
2351 {
2352 Reference< XPropertySet > xQuery(xQueries->getByName(m_aCommand),UNO_QUERY);
2353 OSL_ENSURE(xQuery.is(),"ORowSet::impl_buildActiveCommand_throw: Query is NULL!");
2354 if ( xQuery.is() )
2355 {
2356 xQuery->getPropertyValue(PROPERTY_COMMAND) >>= sCommand;
2357 xQuery->getPropertyValue(PROPERTY_ESCAPE_PROCESSING) >>= bDoEscapeProcessing;
2358 if ( bDoEscapeProcessing != m_bUseEscapeProcessing )
2359 {
2360 bool bOldValue = m_bUseEscapeProcessing;
2361 m_bUseEscapeProcessing = bDoEscapeProcessing;
2362 fireProperty(PROPERTY_ID_ESCAPE_PROCESSING,bOldValue,bDoEscapeProcessing);
2363 }
2364
2365 OUString aCatalog,aSchema,aTable;
2366 xQuery->getPropertyValue(PROPERTY_UPDATE_CATALOGNAME) >>= aCatalog;
2367 xQuery->getPropertyValue(PROPERTY_UPDATE_SCHEMANAME) >>= aSchema;
2368 xQuery->getPropertyValue(PROPERTY_UPDATE_TABLENAME) >>= aTable;
2369 if(!aTable.isEmpty())
2370 m_aUpdateTableName = composeTableName( m_xActiveConnection->getMetaData(), aCatalog, aSchema, aTable, false, ::dbtools::EComposeRule::InDataManipulation );
2371 }
2372 }
2373 else
2374 {
2375 OUString sMessage( DBA_RES( RID_STR_QUERY_DOES_NOT_EXIST ) );
2376 throwGenericSQLException(sMessage.replaceAll( "$table$", m_aCommand ),*this);
2377 }
2378 }
2379 break;
2380
2381 default:
2382 sCommand = m_aCommand;
2383 break;
2384 }
2385
2386 m_aActiveCommand = sCommand;
2387
2388 if ( m_aActiveCommand.isEmpty() && !bDoEscapeProcessing )
2389 ::dbtools::throwSQLException( DBA_RES( RID_STR_NO_SQL_COMMAND ), StandardSQLState::FUNCTION_SEQUENCE_ERROR, *this );
2390
2391 return bDoEscapeProcessing;
2392}
2393
2395{
2396 OSL_PRECOND( !m_pParameters.is(), "ORowSet::impl_initParametersContainer_nothrow: already initialized the parameters!" );
2397
2399 // copy the premature parameters into the final ones
2400 size_t nParamCount( std::min( m_pParameters->size(), m_aPrematureParamValues->size() ) );
2401 for ( size_t i=0; i<nParamCount; ++i )
2402 {
2403 (*m_pParameters)[i] = (*m_aPrematureParamValues)[i];
2404 }
2405}
2406
2408{
2409 if ( !m_pParameters.is() )
2410 return;
2411
2412 // copy the actual values to our "premature" ones, to preserve them for later use
2413 size_t nParamCount( m_pParameters->size() );
2414 m_aPrematureParamValues->resize( nParamCount );
2415 for ( size_t i=0; i<nParamCount; ++i )
2416 {
2417 (*m_aPrematureParamValues)[i] = (*m_pParameters)[i];
2418 }
2419
2420 m_pParameters->dispose();
2421 m_pParameters = nullptr;
2422}
2423
2425{
2426 ::connectivity::checkDisposed( ORowSet_BASE1::rBHelper.bDisposed );
2427 if ( parameterIndex < 1 )
2429
2430 if ( m_aParametersSet.size() < o3tl::make_unsigned(parameterIndex) )
2431 m_aParametersSet.resize( parameterIndex ,false);
2432 m_aParametersSet[parameterIndex - 1] = true;
2433
2434 if ( m_pParameters.is() )
2435 {
2437 // need to rebuild the parameters, since some property which contributes to the
2438 // complete command, and thus the parameters, changed
2440 if ( m_pParameters.is() )
2441 {
2442 if ( o3tl::make_unsigned(parameterIndex) > m_pParameters->size() )
2444 return (*m_pParameters)[ parameterIndex - 1 ];
2445 }
2446 }
2447
2448 if ( m_aPrematureParamValues->size() < o3tl::make_unsigned(parameterIndex) )
2449 m_aPrematureParamValues->resize( parameterIndex );
2450 return (*m_aPrematureParamValues)[ parameterIndex - 1 ];
2451}
2452
2453// XParameters
2454void SAL_CALL ORowSet::setNull( sal_Int32 parameterIndex, sal_Int32 /*sqlType*/ )
2455{
2456 ::osl::MutexGuard aGuard( m_aColumnsMutex );
2457
2458 getParameterStorage( parameterIndex ).setNull();
2459 m_bParametersDirty = true;
2460}
2461
2462void SAL_CALL ORowSet::setObjectNull( sal_Int32 parameterIndex, sal_Int32 sqlType, const OUString& /*typeName*/ )
2463{
2464 setNull( parameterIndex, sqlType );
2465}
2466
2467void ORowSet::setParameter(sal_Int32 parameterIndex, const ORowSetValue& x)
2468{
2469 ::osl::MutexGuard aGuard( m_aColumnsMutex );
2470
2471 getParameterStorage( parameterIndex ) = x;
2472 m_bParametersDirty = true;
2473}
2474
2475void SAL_CALL ORowSet::setBoolean( sal_Int32 parameterIndex, sal_Bool x )
2476{
2477 setParameter(parameterIndex, static_cast<bool>(x));
2478}
2479
2480void SAL_CALL ORowSet::setByte( sal_Int32 parameterIndex, sal_Int8 x )
2481{
2482 setParameter(parameterIndex,x);
2483}
2484
2485void SAL_CALL ORowSet::setShort( sal_Int32 parameterIndex, sal_Int16 x )
2486{
2487 setParameter(parameterIndex,x);
2488}
2489
2490void SAL_CALL ORowSet::setInt( sal_Int32 parameterIndex, sal_Int32 x )
2491{
2492 setParameter(parameterIndex,x);
2493}
2494
2495void SAL_CALL ORowSet::setLong( sal_Int32 parameterIndex, sal_Int64 x )
2496{
2497 setParameter(parameterIndex,x);
2498}
2499
2500void SAL_CALL ORowSet::setFloat( sal_Int32 parameterIndex, float x )
2501{
2502 setParameter(parameterIndex,x);
2503}
2504
2505void SAL_CALL ORowSet::setDouble( sal_Int32 parameterIndex, double x )
2506{
2507 setParameter(parameterIndex,x);
2508}
2509
2510void SAL_CALL ORowSet::setString( sal_Int32 parameterIndex, const OUString& x )
2511{
2512 setParameter(parameterIndex,x);
2513}
2514
2515void SAL_CALL ORowSet::setBytes( sal_Int32 parameterIndex, const Sequence< sal_Int8 >& x )
2516{
2517 setParameter(parameterIndex,x);
2518}
2519
2520void SAL_CALL ORowSet::setDate( sal_Int32 parameterIndex, const css::util::Date& x )
2521{
2522 setParameter(parameterIndex,x);
2523}
2524
2525void SAL_CALL ORowSet::setTime( sal_Int32 parameterIndex, const css::util::Time& x )
2526{
2527 setParameter(parameterIndex,x);
2528}
2529
2530void SAL_CALL ORowSet::setTimestamp( sal_Int32 parameterIndex, const css::util::DateTime& x )
2531{
2532 setParameter(parameterIndex,x);
2533}
2534
2535void SAL_CALL ORowSet::setBinaryStream( sal_Int32 parameterIndex, const Reference< css::io::XInputStream >& x, sal_Int32 length )
2536{
2537 ::osl::MutexGuard aGuard( m_aColumnsMutex );
2538 ORowSetValue& rParamValue( getParameterStorage( parameterIndex ) );
2539
2540 try
2541 {
2542 Sequence <sal_Int8> aData;
2543 x->readBytes(aData, length);
2544 rParamValue = aData;
2545 m_bParametersDirty = true;
2546 x->closeInput();
2547 }
2548 catch( Exception const & )
2549 {
2550 css::uno::Any anyEx = cppu::getCaughtException();
2551 throw SQLException("ORowSet::setBinaryStream", *this, "S1000", 0,anyEx);
2552 }
2553}
2554
2555void SAL_CALL ORowSet::setCharacterStream( sal_Int32 parameterIndex, const Reference< css::io::XInputStream >& x, sal_Int32 length )
2556{
2557 ::osl::MutexGuard aGuard( m_aColumnsMutex );
2558 ORowSetValue& rParamValue( getParameterStorage( parameterIndex ) );
2559 try
2560 {
2561 Sequence <sal_Int8> aData;
2562 OUString aDataStr;
2563 // the data is given as character data and the length defines the character length
2564 sal_Int32 nSize = x->readBytes(aData, length * sizeof(sal_Unicode));
2565 if (nSize / sizeof(sal_Unicode))
2566 aDataStr = OUString(reinterpret_cast<sal_Unicode const *>(aData.getConstArray()), nSize / sizeof(sal_Unicode));
2567 m_bParametersDirty = true;
2568 rParamValue = aDataStr;
2569 rParamValue.setTypeKind( DataType::LONGVARCHAR );
2570 x->closeInput();
2571 }
2572 catch( Exception const & )
2573 {
2574 css::uno::Any anyEx = cppu::getCaughtException();
2575 throw SQLException("ORowSet::setCharacterStream", *this, "S1000", 0, anyEx);
2576 }
2577}
2578
2579void SAL_CALL ORowSet::setObject( sal_Int32 parameterIndex, const Any& x )
2580{
2581 if ( !::dbtools::implSetObject( this, parameterIndex, x ) )
2582 { // there is no other setXXX call which can handle the value in x
2583 throw SQLException();
2584 }
2585 m_bParametersDirty = true;
2586}
2587
2588void SAL_CALL ORowSet::setObjectWithInfo( sal_Int32 parameterIndex, const Any& x, sal_Int32 targetSqlType, sal_Int32 /*scale*/ )
2589{
2590 ::osl::MutexGuard aGuard( m_aColumnsMutex );
2591 ORowSetValue& rParamValue( getParameterStorage( parameterIndex ) );
2592 setObject( parameterIndex, x );
2593 rParamValue.setTypeKind( targetSqlType );
2594}
2595
2596void SAL_CALL ORowSet::setRef( sal_Int32 /*parameterIndex*/, const Reference< XRef >& /*x*/ )
2597{
2598 ::dbtools::throwFeatureNotImplementedSQLException( "XParameters::setRef", *this );
2599}
2600
2601void SAL_CALL ORowSet::setBlob( sal_Int32 /*parameterIndex*/, const Reference< XBlob >& /*x*/ )
2602{
2603 ::dbtools::throwFeatureNotImplementedSQLException( "XParameters::setBlob", *this );
2604}
2605
2606void SAL_CALL ORowSet::setClob( sal_Int32 /*parameterIndex*/, const Reference< XClob >& /*x*/ )
2607{
2608 ::dbtools::throwFeatureNotImplementedSQLException( "XParameters::setClob", *this );
2609}
2610
2611void SAL_CALL ORowSet::setArray( sal_Int32 /*parameterIndex*/, const Reference< XArray >& /*x*/ )
2612{
2613 ::dbtools::throwFeatureNotImplementedSQLException( "XParameters::setArray", *this );
2614}
2615
2617{
2618 ::connectivity::checkDisposed(ORowSet_BASE1::rBHelper.bDisposed);
2619
2620 ::osl::MutexGuard aGuard( m_aColumnsMutex );
2621
2622 size_t nParamCount( m_pParameters.is() ? m_pParameters->size() : m_aPrematureParamValues->size() );
2623 for ( size_t i=1; i<=nParamCount; ++i )
2624 getParameterStorage( static_cast<sal_Int32>(i) ).setNull();
2625 m_aParametersSet.clear();
2626}
2627
2629{
2630 return m_aWarnings.getWarnings();
2631}
2632
2634{
2636}
2637
2639{
2640 if ( isModification() )
2641 {
2642 // read-only flag restored
2644 m_pCache->cancelRowModification();
2645 }
2646 m_bModified = false;
2647 m_bIsInsertRow = false;
2648}
2649
2651{
2652 return isNew();
2653}
2654
2656{
2657 return m_bModified;
2658}
2659
2661{
2662 return m_bNew;
2663}
2664
2666{
2668}
2669
2671{
2672 if(!m_bIsInsertRow)
2673 {
2674 m_pCache->setUpdateIterator(m_aCurrentRow);
2675 m_aCurrentRow = m_pCache->m_aInsertRow;
2676 m_bIsInsertRow = true;
2677 }
2678}
2679
2680void ORowSet::checkUpdateConditions(sal_Int32 columnIndex)
2681{
2682 checkCache();
2683 if ( m_nResultSetConcurrency == ResultSetConcurrency::READ_ONLY)
2684 ::dbtools::throwSQLException( DBA_RES( RID_STR_RESULT_IS_READONLY ), StandardSQLState::GENERAL_ERROR, *this );
2685
2686 if ( rowDeleted() )
2687 ::dbtools::throwSQLException( DBA_RES( RID_STR_ROW_ALREADY_DELETED ), StandardSQLState::INVALID_CURSOR_POSITION, *this );
2688
2689 if ( m_aCurrentRow.isNull() )
2690 ::dbtools::throwSQLException( DBA_RES( RID_STR_INVALID_CURSOR_STATE ), StandardSQLState::INVALID_CURSOR_STATE, *this );
2691
2692 if ( columnIndex <= 0 || (*m_aCurrentRow)->size() <= o3tl::make_unsigned(columnIndex) )
2693 ::dbtools::throwSQLException( DBA_RES( RID_STR_INVALID_INDEX ), StandardSQLState::INVALID_DESCRIPTOR_INDEX, *this );
2694}
2695
2696void SAL_CALL ORowSet::refreshRow( )
2697{
2698
2699 ORowSetNotifier aNotifier( this );
2700 // this will call cancelRowModification on the cache if necessary
2701
2702 // notification order:
2703 if ( m_bModified && m_pCache )
2704 implCancelRowUpdates( false ); // do _not_ notify the IsModify - will do this ourself below
2705
2706 // - column values
2708
2709 // - IsModified
2710 // - IsNew
2711 aNotifier.fire( );
2712}
2713
2714void ORowSet::impl_rebuild_throw(::osl::ResettableMutexGuard& _rGuard)
2715{
2716 Reference< XResultSet > xResultSet(m_xStatement->executeQuery());
2717 m_pCache->reset(xResultSet);
2718 m_aWarnings.setExternalWarnings( Reference< XWarningsSupplier >( xResultSet, UNO_QUERY ) );
2719 notifyAllListeners(_rGuard);
2720}
2721
2722// ***********************************************************
2723// ORowSetClone
2724// ***********************************************************
2725
2726ORowSetClone::ORowSetClone( const Reference<XComponentContext>& _rContext, ORowSet& rParent, ::osl::Mutex* _pMutex )
2727 :OSubComponent(m_aMutex, rParent)
2728 ,ORowSetBase( _rContext, WeakComponentImplHelper::rBHelper, _pMutex )
2729 ,m_pParent(&rParent)
2730 ,m_nFetchDirection(rParent.m_nFetchDirection)
2731 ,m_nFetchSize(rParent.m_nFetchSize)
2732 ,m_bIsBookmarkable(true)
2733{
2734
2736 m_nResultSetConcurrency = ResultSetConcurrency::READ_ONLY;
2737 m_pMySelf = this;
2738 m_bClone = true;
2740 m_bAfterLast = rParent.m_bAfterLast;
2741 m_pCache = rParent.m_pCache;
2742 m_aBookmark = rParent.m_aBookmark;
2743 m_aCurrentRow = m_pCache->createIterator(this);
2745
2746 m_aOldRow = m_pCache->registerOldRow();
2747
2748 ::rtl::Reference< ::connectivity::OSQLColumns> aColumns = new ::connectivity::OSQLColumns();
2749 std::vector< OUString> aNames;
2750
2751 OUString aDescription;
2753
2754 if ( rParent.m_pColumns )
2755 {
2756 Sequence< OUString> aSeq = rParent.m_pColumns->getElementNames();
2757 const OUString* pIter = aSeq.getConstArray();
2758 const OUString* pEnd = pIter + aSeq.getLength();
2759 aColumns->reserve(aSeq.getLength()+1);
2760 for(sal_Int32 i=1;pIter != pEnd ;++pIter,++i)
2761 {
2762 Reference<XPropertySet> xColumn;
2763 rParent.m_pColumns->getByName(*pIter) >>= xColumn;
2764 if(xColumn->getPropertySetInfo()->hasPropertyByName(PROPERTY_DESCRIPTION))
2765 aDescription = comphelper::getString(xColumn->getPropertyValue(PROPERTY_DESCRIPTION));
2766
2767 OUString sParseLabel;
2768 xColumn->getPropertyValue(PROPERTY_LABEL) >>= sParseLabel;
2770 this,
2771 i,
2772 rParent.m_xActiveConnection->getMetaData(),
2773 aDescription,
2774 sParseLabel,
2775 [this] (sal_Int32 const column) -> ORowSetValue const& {
2776 return this->getValue(column);
2777 });
2778 aColumns->emplace_back(pColumn);
2779 pColumn->setName(*pIter);
2780 aNames.push_back(*pIter);
2781 m_aDataColumns.push_back(pColumn.get());
2782
2783 pColumn->setFastPropertyValue_NoBroadcast(PROPERTY_ID_ALIGN,xColumn->getPropertyValue(PROPERTY_ALIGN));
2784 sal_Int32 nFormatKey = 0;
2785 xColumn->getPropertyValue(PROPERTY_NUMBERFORMAT) >>= nFormatKey;
2786 if(!nFormatKey && xColumn.is() && m_xNumberFormatTypes.is())
2787 nFormatKey = ::dbtools::getDefaultNumberFormat(xColumn,m_xNumberFormatTypes,aLocale);
2788 pColumn->setFastPropertyValue_NoBroadcast(PROPERTY_ID_NUMBERFORMAT,Any(nFormatKey));
2789 pColumn->setFastPropertyValue_NoBroadcast(PROPERTY_ID_RELATIVEPOSITION,xColumn->getPropertyValue(PROPERTY_RELATIVEPOSITION));
2790 pColumn->setFastPropertyValue_NoBroadcast(PROPERTY_ID_WIDTH,xColumn->getPropertyValue(PROPERTY_WIDTH));
2791 pColumn->setFastPropertyValue_NoBroadcast(PROPERTY_ID_HIDDEN,xColumn->getPropertyValue(PROPERTY_HIDDEN));
2792 pColumn->setFastPropertyValue_NoBroadcast(PROPERTY_ID_CONTROLMODEL,xColumn->getPropertyValue(PROPERTY_CONTROLMODEL));
2793 pColumn->setFastPropertyValue_NoBroadcast(PROPERTY_ID_HELPTEXT,xColumn->getPropertyValue(PROPERTY_HELPTEXT));
2794 pColumn->setFastPropertyValue_NoBroadcast(PROPERTY_ID_CONTROLDEFAULT,xColumn->getPropertyValue(PROPERTY_CONTROLDEFAULT));
2795
2796 }
2797 }
2798 Reference<XDatabaseMetaData> xMeta = rParent.m_xActiveConnection->getMetaData();
2799 m_pColumns.reset( new ORowSetDataColumns(xMeta.is() && xMeta->supportsMixedCaseQuotedIdentifiers(),
2800 aColumns,*this,m_aMutex,aNames) );
2801
2802 sal_Int32 const nRT = PropertyAttribute::READONLY | PropertyAttribute::TRANSIENT;
2803
2804 // sdb.RowSet Properties
2811}
2812
2814{
2815}
2816
2817// css::XTypeProvider
2818Sequence< Type > ORowSetClone::getTypes()
2819{
2820 return ::comphelper::concatSequences(OSubComponent::getTypes(),ORowSetBase::getTypes());
2821}
2822
2823// css::XInterface
2825{
2826 Any aRet = ORowSetBase::queryInterface(rType);
2827 if(!aRet.hasValue())
2828 aRet = OSubComponent::queryInterface(rType);
2829 return aRet;
2830}
2831
2833{
2834 OSubComponent::acquire();
2835}
2836
2838{
2840}
2841
2842// XServiceInfo
2844{
2845 return "com.sun.star.sdb.ORowSetClone";
2846}
2847
2848sal_Bool ORowSetClone::supportsService( const OUString& _rServiceName )
2849{
2850 return cppu::supportsService(this, _rServiceName);
2851}
2852
2854{
2856}
2857
2858// OComponentHelper
2860{
2861 MutexGuard aGuard( m_aMutex );
2863
2864 m_pParent = nullptr;
2865 m_pMutex = &m_aMutex; // this must be done here because someone could hold a ref to us and try to do something
2866 OSubComponent::disposing();
2867}
2868
2869// XCloseable
2871{
2872 {
2873 MutexGuard aGuard( m_aMutex );
2874 if (WeakComponentImplHelper::rBHelper.bDisposed)
2875 return;
2876 }
2877 dispose();
2878}
2879
2880// comphelper::OPropertyArrayUsageHelper
2882{
2883 Sequence< Property > aProps;
2884 describeProperties(aProps);
2885 return new ::cppu::OPropertyArrayHelper(aProps);
2886}
2887
2888// cppu::OPropertySetHelper
2890{
2892}
2893
2894void SAL_CALL ORowSetClone::setFastPropertyValue_NoBroadcast(sal_Int32 nHandle,const Any& rValue)
2895{
2897 {
2898 if ( m_pParent )
2900 }
2901
2903}
2904
2906{
2907}
2908
2910{
2911 return false;
2912}
2913
2915{
2916 return false;
2917}
2918
2920{
2921 return false;
2922}
2923
2925{
2926 throwFunctionNotSupportedSQLException( "RowSetClone::XRowSet::execute", *this );
2927}
2928
2929void SAL_CALL ORowSetClone::addRowSetListener( const Reference< XRowSetListener >& )
2930{
2931 throwFunctionNotSupportedRuntimeException( "RowSetClone::XRowSet", *this );
2932}
2933
2934void SAL_CALL ORowSetClone::removeRowSetListener( const Reference< XRowSetListener >& )
2935{
2936 throwFunctionNotSupportedRuntimeException( "RowSetClone::XRowSet", *this );
2937}
2938
2939} // dbaccess
2940
2941/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
OptionalString sSchema
OptionalString sCatalog
OptionalString sName
SAL_DLLPUBLIC_EXPORT css::uno::XInterface * com_sun_star_comp_dba_ORowSet_get_implementation(css::uno::XComponentContext *context, css::uno::Sequence< css::uno::Any > const &)
Definition: RowSet.cxx:94
bool & m_rInsertingRow
Definition: RowSet.cxx:808
const css::lang::Locale & getLocale(bool bResolveSystem=true) const
virtual void SAL_CALL release() noexcept override
Definition: apitools.cxx:46
const LanguageTag & GetLanguageTag() const
sal_Int32 addInterface(const css::uno::Reference< ListenerT > &rxIFace)
std::vector< css::uno::Reference< ListenerT > > getElements() const
void disposeAndClear(const css::lang::EventObject &rEvt)
sal_Int32 removeInterface(const css::uno::Reference< ListenerT > &rxIFace)
void notifyEach(void(SAL_CALL ListenerT::*NotificationMethod)(const EventT &), const EventT &Event)
css::uno::Reference< ListenerT > const & next()
::cppu::IPropertyArrayHelper * getArrayHelper()
void describeProperties(css::uno::Sequence< css::beans::Property > &_rProps) const
void registerProperty(const OUString &_rName, sal_Int32 _nHandle, sal_Int32 _nAttributes, void *_pPointerToMember, const css::uno::Type &_rMemberType)
void registerMayBeVoidProperty(const OUString &_rName, sal_Int32 _nHandle, sal_Int32 _nAttributes, css::uno::Any *_pPointerToMember, const css::uno::Type &_rExpectedType)
virtual void SAL_CALL setFastPropertyValue(sal_Int32 nHandle, const css::uno::Any &rValue) override final
virtual void SAL_CALL setFastPropertyValue_NoBroadcast(sal_Int32 nHandle, const css::uno::Any &rValue) override
std::vector< VectorVal > Vector
css::util::Time getTime() const
sal_Int32 getInt32() const
OUString getString() const
css::uno::Any makeAny() const
sal_Int32 getTypeKind() const
sal_Int8 getInt8() const
sal_Int16 getInt16() const
void setTypeKind(sal_Int32 _eType)
css::util::Date getDate() const
css::util::DateTime getDateTime() const
sal_Int64 getLong() const
css::uno::Sequence< sal_Int8 > getSequence() const
void raiseTypedException(const ErrorCondition _eCondition, const css::uno::Reference< css::uno::XInterface > &_rxContext, const css::uno::Type &_rExceptionType) const
mutable::osl::Mutex m_aMutex
virtual css::uno::Any SAL_CALL queryAggregation(css::uno::Type const &rType) SAL_OVERRIDE
virtual void SAL_CALL release() SAL_NOEXCEPT SAL_OVERRIDE
virtual void SAL_CALL acquire() SAL_NOEXCEPT SAL_OVERRIDE
virtual css::uno::Sequence< css::uno::Type > SAL_CALL getTypes() SAL_OVERRIDE
virtual css::uno::Any SAL_CALL queryInterface(css::uno::Type const &rType) SAL_OVERRIDE
ORowSetCacheIterator m_aCurrentRow
Definition: RowSetBase.hxx:79
bool isInsertRow() const
Definition: RowSetBase.hxx:332
sal_Int32 m_nLastColumnIndex
Definition: RowSetBase.hxx:95
virtual void SAL_CALL getFastPropertyValue(css::uno::Any &rValue, sal_Int32 nHandle) const override
Definition: RowSetBase.cxx:126
const connectivity::ORowSetValue & getValue(sal_Int32 columnIndex)
Definition: RowSetBase.cxx:187
TORowSetOldRowHelperRef m_aOldRow
Definition: RowSetBase.hxx:80
virtual sal_Bool SAL_CALL rowDeleted() override
std::unique_ptr< ORowSetDataColumns > m_pColumns
Definition: RowSetBase.hxx:86
::cppu::OBroadcastHelper & m_rBHelper
Definition: RowSetBase.hxx:87
TDataColumns m_aDataColumns
Definition: RowSetBase.hxx:81
void fireProperty(sal_Int32 _nProperty, bool _bNew, bool _bOld)
virtual css::uno::Reference< css::sdbc::XBlob > SAL_CALL getBlob(sal_Int32 columnIndex) override
Definition: RowSetBase.cxx:378
virtual css::uno::Reference< css::io::XInputStream > SAL_CALL getBinaryStream(sal_Int32 columnIndex) override
Definition: RowSetBase.cxx:322
void onDeleteRow(const css::uno::Any &_rBookmark)
virtual css::uno::Reference< css::sdbc::XResultSetMetaData > SAL_CALL getMetaData() override
Definition: RowSetBase.cxx:527
::cppu::OWeakObject * m_pMySelf
Definition: RowSetBase.hxx:84
css::uno::Reference< css::uno::XComponentContext > m_aContext
Definition: RowSetBase.hxx:92
css::uno::Reference< css::util::XNumberFormatTypes > m_xNumberFormatTypes
Definition: RowSetBase.hxx:89
::osl::Mutex m_aColumnsMutex
Definition: RowSetBase.hxx:76
sal_Int32 impl_getRowCount() const
returns the current row count
css::uno::Any m_aBookmark
Definition: RowSetBase.hxx:78
@ Current
denotes no cursor move at all, but move cache to current row (if it is not there already)
@ Forward
denotes a cursor move forward
@ CurrentRefresh
denotes no cursor move at all, but force the cache to move to current row (and refresh the row)
void onDeletedRow(const css::uno::Any &_rBookmark, sal_Int32 _nPos)
void setCurrentRow(bool _bMoved, bool _bDoNotify, const ORowSetRow &_rOldValues, ::osl::ResettableMutexGuard &_rGuard)
virtual css::uno::Reference< css::io::XInputStream > SAL_CALL getCharacterStream(sal_Int32 columnIndex) override
Definition: RowSetBase.cxx:359
void positionCache(CursorMoveDirection _ePrepareForDirection)
positions the cache in preparation of a cursor move
virtual css::uno::Sequence< css::uno::Type > SAL_CALL getTypes() override
Definition: RowSetBase.cxx:112
virtual css::uno::Any SAL_CALL queryInterface(const css::uno::Type &rType) override
Definition: RowSetBase.cxx:118
virtual void SAL_CALL disposing()
Definition: RowSetBase.cxx:147
void firePropertyChange(const ORowSetRow &_rOldRow)
virtual sal_Bool SAL_CALL wasNull() override
Definition: RowSetBase.cxx:179
std::shared_ptr< ORowSetCache > m_pCache
Definition: RowSetBase.hxx:85
sal_Int32 m_nResultSetType
Definition: RowSetBase.hxx:97
std::vector< ORowSetDataColumn * > TDataColumns
Definition: RowSetBase.hxx:72
sal_Int32 m_nResultSetConcurrency
Definition: RowSetBase.hxx:98
::osl::Mutex * m_pMutex
Definition: RowSetBase.hxx:73
virtual void SAL_CALL refreshRow() override
virtual void doCancelModification() override
Definition: RowSet.cxx:2905
virtual void SAL_CALL execute() override
Definition: RowSet.cxx:2924
virtual void SAL_CALL acquire() noexcept override
Definition: RowSet.cxx:2832
virtual void SAL_CALL removeRowSetListener(const css::uno::Reference< css::sdbc::XRowSetListener > &listener) override
Definition: RowSet.cxx:2934
virtual void SAL_CALL disposing() override
Definition: RowSet.cxx:2859
virtual bool isNew() override
Definition: RowSet.cxx:2919
virtual ~ORowSetClone() override
Definition: RowSet.cxx:2813
virtual bool isModified() override
Definition: RowSet.cxx:2914
virtual sal_Bool SAL_CALL supportsService(const OUString &ServiceName) override
Definition: RowSet.cxx:2848
virtual void SAL_CALL close() override
Definition: RowSet.cxx:2870
ORowSetClone(const css::uno::Reference< css::uno::XComponentContext > &_rContext, ORowSet &rParent, ::osl::Mutex *_pMutex)
Definition: RowSet.cxx:2726
sal_Int32 m_nFetchSize
Definition: RowSet.hxx:454
virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() override
Definition: RowSet.cxx:2853
virtual OUString SAL_CALL getImplementationName() override
Definition: RowSet.cxx:2843
virtual ::cppu::IPropertyArrayHelper &SAL_CALL getInfoHelper() override
Definition: RowSet.cxx:2889
virtual void SAL_CALL release() noexcept override
Definition: RowSet.cxx:2837
virtual void SAL_CALL setFastPropertyValue_NoBroadcast(sal_Int32 nHandle, const css::uno::Any &rValue) override
Definition: RowSet.cxx:2894
sal_Int32 m_nFetchDirection
Definition: RowSet.hxx:453
virtual css::uno::Sequence< css::uno::Type > SAL_CALL getTypes() override
Definition: RowSet.cxx:2818
virtual void SAL_CALL addRowSetListener(const css::uno::Reference< css::sdbc::XRowSetListener > &listener) override
Definition: RowSet.cxx:2929
virtual ::cppu::IPropertyArrayHelper * createArrayHelper() const override
Definition: RowSet.cxx:2881
virtual css::uno::Any SAL_CALL queryInterface(const css::uno::Type &rType) override
Definition: RowSet.cxx:2824
virtual bool isModification() override
Definition: RowSet.cxx:2909
eases the handling of the doCancelModification and notifyCancelInsert methods
Definition: RowSetBase.hxx:349
void firePropertyChange()
notifies value change events and notifies IsModified
void fire()
notifies the insertion
std::vector< sal_Int32 > & getChangedColumns()
use this one to store the index of the changed column values
bool impl_buildActiveCommand_throw()
builds m_aActiveCommand from our settings
Definition: RowSet.cxx:2304
virtual void SAL_CALL updateNumericObject(sal_Int32 columnIndex, const css::uno::Any &x, sal_Int32 scale) override
Definition: RowSet.cxx:791
sal_Int32 m_nMaxFieldSize
Definition: RowSet.hxx:123
virtual void SAL_CALL execute() override
Definition: RowSet.cxx:1534
void notifyAllListeners(::osl::ResettableMutexGuard &_rGuard)
Definition: RowSet.cxx:1057
css::uno::Reference< css::sdbc::XConnection > m_xActiveConnection
Definition: RowSet.hxx:77
virtual void SAL_CALL updateShort(sal_Int32 columnIndex, sal_Int16 x) override
Definition: RowSet.cxx:668
virtual void SAL_CALL disposing() override
Definition: RowSet.cxx:449
virtual void SAL_CALL removeRowsChangeListener(const css::uno::Reference< css::sdb::XRowsChangeListener > &listener) override
Definition: RowSet.cxx:2045
css::uno::Reference< css::container::XNameAccess > m_xTypeMap
Definition: RowSet.hxx:79
virtual void SAL_CALL updateDouble(sal_Int32 columnIndex, double x) override
Definition: RowSet.cxx:688
void notifyAllListenersRowBeforeChange(::osl::ResettableMutexGuard &_rGuard, const css::sdb::RowChangeEvent &rEvt)
Definition: RowSet.cxx:1101
bool m_bIsBookmarkable
Definition: RowSet.hxx:139
virtual void SAL_CALL setCharacterStream(sal_Int32 parameterIndex, const css::uno::Reference< css::io::XInputStream > &x, sal_Int32 length) override
Definition: RowSet.cxx:2555
virtual void SAL_CALL cancel() override
Definition: RowSet.cxx:2069
virtual void doCancelModification() override
Definition: RowSet.cxx:2638
virtual void SAL_CALL setTime(sal_Int32 parameterIndex, const css::util::Time &x) override
Definition: RowSet.cxx:2525
void implCancelRowUpdates(bool _bNotifyModified)
Definition: RowSet.cxx:996
virtual bool isModification() override
Definition: RowSet.cxx:2650
virtual css::uno::Reference< css::sdbc::XBlob > SAL_CALL getBlob(sal_Int32 columnIndex) override
Definition: RowSet.cxx:1399
void checkUpdateConditions(sal_Int32 columnIndex)
Definition: RowSet.cxx:2680
::comphelper::OInterfaceContainerHelper3< css::sdb::XRowSetApproveListener > m_aApproveListeners
Definition: RowSet.hxx:98
virtual void SAL_CALL setDate(sal_Int32 parameterIndex, const css::util::Date &x) override
Definition: RowSet.cxx:2520
virtual sal_Int16 SAL_CALL getShort(sal_Int32 columnIndex) override
Definition: RowSet.cxx:1308
virtual css::uno::Any SAL_CALL queryInterface(const css::uno::Type &rType) override
Definition: RowSet.cxx:407
css::uno::Any m_aActiveConnection
Definition: RowSet.hxx:78
bool m_bUseEscapeProcessing
Definition: RowSet.hxx:133
void checkUpdateIterator()
Definition: RowSet.cxx:2670
css::uno::Reference< css::container::XNameAccess > m_xColumns
Definition: RowSet.hxx:83
virtual sal_Int8 SAL_CALL getByte(sal_Int32 columnIndex) override
Definition: RowSet.cxx:1302
virtual void SAL_CALL setTimestamp(sal_Int32 parameterIndex, const css::util::DateTime &x) override
Definition: RowSet.cxx:2530
bool m_bCommandFacetsDirty
Definition: RowSet.hxx:135
virtual void SAL_CALL addRowsChangeListener(const css::uno::Reference< css::sdb::XRowsChangeListener > &listener) override
Definition: RowSet.cxx:2036
void impl_restoreDataColumnsWriteable_throw()
Definition: RowSet.cxx:1222
sal_Int32 m_nPrivileges
Definition: RowSet.hxx:128
virtual css::uno::Any SAL_CALL queryAggregation(const css::uno::Type &aType) override
Definition: RowSet.cxx:423
virtual void getPropertyDefaultByHandle(sal_Int32 _nHandle, css::uno::Any &_rDefault) const override
Definition: RowSet.cxx:201
void impl_ensureStatement_throw()
Definition: RowSet.cxx:1611
css::uno::Reference< css::sdbc::XPreparedStatement > m_xStatement
Definition: RowSet.hxx:81
virtual void SAL_CALL clearWarnings() override
Definition: RowSet.cxx:2633
virtual void SAL_CALL addRowSetApproveListener(const css::uno::Reference< css::sdb::XRowSetApproveListener > &listener) override
Definition: RowSet.cxx:2017
virtual void SAL_CALL removeRowSetListener(const css::uno::Reference< css::sdbc::XRowSetListener > &listener) override
Definition: RowSet.cxx:1048
virtual bool notifyAllListenersCursorBeforeMove(::osl::ResettableMutexGuard &_rGuard) override
Definition: RowSet.cxx:1081
rtl::Reference< ORowSetValueVector > m_aPrematureParamValues
our parameters values, used when we do not yet have a parameters container (since we have not been ex...
Definition: RowSet.hxx:92
virtual void SAL_CALL moveToCurrentRow() override
Definition: RowSet.cxx:1234
OUString m_aFilter
Definition: RowSet.hxx:111
virtual void notifyAllListenersCursorMoved(::osl::ResettableMutexGuard &_rGuard) override
Definition: RowSet.cxx:1065
virtual bool isPropertyChangeNotificationEnabled() const override
Definition: RowSet.cxx:2665
bool m_bLastKnownRowCountFinal
Definition: RowSet.hxx:132
virtual void SAL_CALL updateNull(sal_Int32 columnIndex) override
Definition: RowSet.cxx:643
virtual void SAL_CALL updateTimestamp(sal_Int32 columnIndex, const css::util::DateTime &x) override
Definition: RowSet.cxx:713
sal_Int32 m_nFetchSize
Definition: RowSet.hxx:122
OUString m_aUser
Definition: RowSet.hxx:109
std::vector< bool > m_aParametersSet
Definition: RowSet.hxx:94
virtual css::uno::Any SAL_CALL getObject(sal_Int32 columnIndex, const css::uno::Reference< css::container::XNameAccess > &typeMap) override
Definition: RowSet.cxx:1388
virtual ::cppu::IPropertyArrayHelper &SAL_CALL getInfoHelper() override
Definition: RowSet.cxx:622
void notifyRowSetAndClonesRowDelete(const css::uno::Any &_rBookmark)
informs the clones (and ourself) that we are going to delete a record with a given bookmark
Definition: RowSet.cxx:2129
virtual sal_Bool SAL_CALL supportsService(const OUString &ServiceName) override
Definition: RowSet.cxx:437
bool m_bParametersDirty
Definition: RowSet.hxx:136
virtual void SAL_CALL updateCharacterStream(sal_Int32 columnIndex, const css::uno::Reference< css::io::XInputStream > &x, sal_Int32 length) override
Definition: RowSet.cxx:733
virtual void SAL_CALL setDouble(sal_Int32 parameterIndex, double x) override
Definition: RowSet.cxx:2505
virtual css::uno::Any SAL_CALL getWarnings() override
Definition: RowSet.cxx:2628
sal_Int32 m_nCommandType
Definition: RowSet.hxx:126
virtual void SAL_CALL setObject(sal_Int32 parameterIndex, const css::uno::Any &x) override
Definition: RowSet.cxx:2579
virtual void SAL_CALL setString(sal_Int32 parameterIndex, const OUString &x) override
Definition: RowSet.cxx:2510
virtual css::uno::Sequence< sal_Int8 > SAL_CALL getImplementationId() override
Definition: RowSet.cxx:401
virtual void SAL_CALL updateInt(sal_Int32 columnIndex, sal_Int32 x) override
Definition: RowSet.cxx:673
void notifyRowSetAndClonesRowDeleted(const css::uno::Any &_rBookmark, sal_Int32 _nPos)
inform the clones (and ourself) that we have deleted a record with a given bookmark
Definition: RowSet.cxx:2142
virtual void SAL_CALL setNull(sal_Int32 parameterIndex, sal_Int32 sqlType) override
Definition: RowSet.cxx:2454
css::uno::Any m_aTypeMap
Definition: RowSet.hxx:80
css::uno::Reference< css::sdbc::XConnection > m_xOldConnection
Definition: RowSet.hxx:76
virtual void SAL_CALL updateString(sal_Int32 columnIndex, const OUString &x) override
Definition: RowSet.cxx:693
virtual css::uno::Reference< css::sdbc::XClob > SAL_CALL getClob(sal_Int32 columnIndex) override
Definition: RowSet.cxx:1410
rtl::Reference< ORowSetValueVector > m_aParameterValueForCache
Definition: RowSet.hxx:93
virtual void fireRowcount() override
Definition: RowSet.cxx:1122
connectivity::OWeakRefArray m_aClones
Definition: RowSet.hxx:85
virtual void SAL_CALL setByte(sal_Int32 parameterIndex, sal_Int8 x) override
Definition: RowSet.cxx:2480
virtual float SAL_CALL getFloat(sal_Int32 columnIndex) override
Definition: RowSet.cxx:1326
virtual void SAL_CALL setRef(sal_Int32 parameterIndex, const css::uno::Reference< css::sdbc::XRef > &x) override
Definition: RowSet.cxx:2596
void notifyAllListenersRowChanged(::osl::ResettableMutexGuard &_rGuard, const css::sdb::RowsChangeEvent &rEvt)
Definition: RowSet.cxx:1073
OUString m_aCommand
Definition: RowSet.hxx:106
virtual sal_Bool SAL_CALL getBoolean(sal_Int32 columnIndex) override
Definition: RowSet.cxx:1296
virtual void SAL_CALL cancelRowUpdates() override
Definition: RowSet.cxx:1034
void setStatementResultSetType(const css::uno::Reference< css::beans::XPropertySet > &_rxStatement, sal_Int32 _nDesiredResultSetType, sal_Int32 _nDesiredResultSetConcurrency)
sets the given result set type/concurrency at the given statement, while respecting possibly related ...
Definition: RowSet.cxx:1558
virtual void SAL_CALL updateBoolean(sal_Int32 columnIndex, sal_Bool x) override
Definition: RowSet.cxx:658
virtual void SAL_CALL setFastPropertyValue_NoBroadcast(sal_Int32 nHandle, const css::uno::Any &rValue) override
Definition: RowSet.cxx:253
void setActiveConnection(css::uno::Reference< css::sdbc::XConnection > const &_rxNewConn, bool _bFireEvent=true)
set m_xActiveConnection, fire a PropertyChangeEvent if necessary, do the event listener handling etc
Definition: RowSet.cxx:541
virtual css::uno::Reference< css::io::XInputStream > SAL_CALL getBinaryStream(sal_Int32 columnIndex) override
Definition: RowSet.cxx:1362
std::vector< bool > m_aReadOnlyDataColumns
Definition: RowSet.hxx:95
virtual void SAL_CALL setBlob(sal_Int32 parameterIndex, const css::uno::Reference< css::sdbc::XBlob > &x) override
Definition: RowSet.cxx:2601
virtual bool isNew() override
Definition: RowSet.cxx:2660
OUString m_aGroupBy
Definition: RowSet.hxx:113
std::atomic< std::size_t > m_nInAppend
Definition: RowSet.hxx:130
virtual void SAL_CALL executeWithCompletion(const css::uno::Reference< css::task::XInteractionHandler > &handler) override
Definition: RowSet.cxx:1420
const connectivity::ORowSetValue & getInsertValue(sal_Int32 columnIndex)
Definition: RowSet.cxx:1278
virtual css::util::DateTime SAL_CALL getTimestamp(sal_Int32 columnIndex) override
Definition: RowSet.cxx:1356
void freeResources(bool _bComplete)
Definition: RowSet.cxx:480
virtual css::uno::Sequence< sal_Int32 > SAL_CALL deleteRows(const css::uno::Sequence< css::uno::Any > &rows) override
Definition: RowSet.cxx:2075
void impl_setDataColumnsWriteable_throw()
Definition: RowSet.cxx:1206
virtual void SAL_CALL setLong(sal_Int32 parameterIndex, sal_Int64 x) override
Definition: RowSet.cxx:2495
virtual void SAL_CALL setShort(sal_Int32 parameterIndex, sal_Int16 x) override
Definition: RowSet.cxx:2485
virtual void SAL_CALL close() override
Definition: RowSet.cxx:603
void impl_disposeParametersContainer_nothrow()
disposes our parameters container
Definition: RowSet.cxx:2407
virtual void SAL_CALL updateDate(sal_Int32 columnIndex, const css::util::Date &x) override
Definition: RowSet.cxx:703
virtual css::util::Time SAL_CALL getTime(sal_Int32 columnIndex) override
Definition: RowSet.cxx:1350
virtual css::uno::Reference< css::sdbc::XResultSet > SAL_CALL createResultSet() override
Definition: RowSet.cxx:2055
::dbtools::param::ParametersContainerRef m_pParameters
our parameters as XPropertySet instances and ORowSetValue instances
Definition: RowSet.hxx:88
void execute_NoApprove_NoNewConn(::osl::ResettableMutexGuard &_rClearForNotification)
implement the <method>execute</method>, without calling the approve listeners and without building a ...
Definition: RowSet.cxx:1784
virtual sal_Int32 SAL_CALL getInt(sal_Int32 columnIndex) override
Definition: RowSet.cxx:1314
bool m_bCanUpdateInsertedRows
Definition: RowSet.hxx:141
OUString m_aOrder
Definition: RowSet.hxx:114
ORowSet(const css::uno::Reference< css::uno::XComponentContext > &)
Definition: RowSet.cxx:102
virtual void SAL_CALL updateRow() override
Definition: RowSet.cxx:886
sal_Int32 m_nTransactionIsolation
Definition: RowSet.hxx:127
virtual void SAL_CALL updateObject(sal_Int32 columnIndex, const css::uno::Any &x) override
Definition: RowSet.cxx:746
void setParameter(sal_Int32 parameterIndex, const connectivity::ORowSetValue &x)
Definition: RowSet.cxx:2467
OUString m_sErrorString
Definition: RowSet.hxx:119
virtual void SAL_CALL refreshRow() override
Definition: RowSet.cxx:2696
::dbtools::WarningsContainer m_aWarnings
Definition: RowSet.hxx:101
virtual void SAL_CALL getFastPropertyValue(css::uno::Any &rValue, sal_Int32 nHandle) const override
Definition: RowSet.cxx:347
virtual void SAL_CALL deleteRow() override
Definition: RowSet.cxx:945
virtual void SAL_CALL addRowSetListener(const css::uno::Reference< css::sdbc::XRowSetListener > &listener) override
Definition: RowSet.cxx:1039
virtual void SAL_CALL updateBinaryStream(sal_Int32 columnIndex, const css::uno::Reference< css::io::XInputStream > &x, sal_Int32 length) override
Definition: RowSet.cxx:718
::comphelper::OInterfaceContainerHelper3< css::sdb::XRowsChangeListener > m_aRowsChangeListener
Definition: RowSet.hxx:99
sal_Int32 m_nMaxRows
Definition: RowSet.hxx:124
OUString m_aPassword
Definition: RowSet.hxx:110
::connectivity::ORowSetValue & getParameterStorage(sal_Int32 parameterIndex)
Definition: RowSet.cxx:2424
css::uno::Reference< css::sdbc::XResultSet > impl_prepareAndExecute_throw()
prepares and executes our command
Definition: RowSet.cxx:1661
css::uno::Reference< css::sdbc::XConnection > calcConnection(const css::uno::Reference< css::task::XInteractionHandler > &_rxHandler)
Definition: RowSet.cxx:2155
sal_Int32 m_nFetchDirection
Definition: RowSet.hxx:121
virtual void SAL_CALL setBytes(sal_Int32 parameterIndex, const css::uno::Sequence< sal_Int8 > &x) override
Definition: RowSet.cxx:2515
virtual ::cppu::IPropertyArrayHelper * createArrayHelper() const override
Definition: RowSet.cxx:614
virtual void SAL_CALL setInt(sal_Int32 parameterIndex, sal_Int32 x) override
Definition: RowSet.cxx:2490
virtual OUString SAL_CALL getImplementationName() override
Definition: RowSet.cxx:432
sal_Int32 m_nLastKnownRowCount
Definition: RowSet.hxx:129
OUString m_aUpdateTableName
Definition: RowSet.hxx:118
virtual css::uno::Reference< css::sdbc::XArray > SAL_CALL getArray(sal_Int32 columnIndex) override
Definition: RowSet.cxx:1415
void approveExecution()
call the RowSetApproveListeners
Definition: RowSet.cxx:1505
virtual css::uno::Sequence< css::uno::Type > SAL_CALL getTypes() override
Definition: RowSet.cxx:392
bool m_bPropChangeNotifyEnabled
Definition: RowSet.hxx:143
virtual void SAL_CALL acquire() noexcept override
Definition: RowSet.cxx:412
virtual css::uno::Reference< css::sdbc::XRef > SAL_CALL getRef(sal_Int32 columnIndex) override
Definition: RowSet.cxx:1394
virtual void SAL_CALL setObjectWithInfo(sal_Int32 parameterIndex, const css::uno::Any &x, sal_Int32 targetSqlType, sal_Int32 scale) override
Definition: RowSet.cxx:2588
OUString m_aUpdateCatalogName
Definition: RowSet.hxx:116
virtual void SAL_CALL removeRowSetApproveListener(const css::uno::Reference< css::sdb::XRowSetApproveListener > &listener) override
Definition: RowSet.cxx:2026
OUString m_aURL
Definition: RowSet.hxx:108
virtual void SAL_CALL setClob(sal_Int32 parameterIndex, const css::uno::Reference< css::sdbc::XClob > &x) override
Definition: RowSet.cxx:2606
virtual void SAL_CALL updateBytes(sal_Int32 columnIndex, const css::uno::Sequence< sal_Int8 > &x) override
Definition: RowSet.cxx:698
std::unique_ptr< OTableContainer > m_xTables
Definition: RowSet.hxx:104
virtual void SAL_CALL clearParameters() override
Definition: RowSet.cxx:2616
::comphelper::OInterfaceContainerHelper3< css::sdbc::XRowSetListener > m_aRowsetListeners
Definition: RowSet.hxx:97
virtual css::util::Date SAL_CALL getDate(sal_Int32 columnIndex) override
Definition: RowSet.cxx:1344
void impl_resetTables_nothrow()
cleans up m_pTables, and resets it to <NULL>
Definition: RowSet.cxx:2235
virtual css::uno::Reference< css::io::XInputStream > SAL_CALL getCharacterStream(sal_Int32 columnIndex) override
Definition: RowSet.cxx:1375
virtual sal_Bool SAL_CALL wasNull() override
Definition: RowSet.cxx:1270
void impl_rebuild_throw(::osl::ResettableMutexGuard &_rGuard)
Definition: RowSet.cxx:2714
virtual OUString SAL_CALL getString(sal_Int32 columnIndex) override
Definition: RowSet.cxx:1290
virtual void SAL_CALL setArray(sal_Int32 parameterIndex, const css::uno::Reference< css::sdbc::XArray > &x) override
Definition: RowSet.cxx:2611
friend class ORowSetClone
Definition: RowSet.hxx:74
css::uno::Reference< css::container::XNameAccess > impl_getTables_throw()
returns the table container of our active connection
Definition: RowSet.cxx:2197
OUString m_aActiveCommand
Definition: RowSet.hxx:115
bool m_bOwnConnection
Definition: RowSet.hxx:142
void impl_initComposer_throw(OUString &_out_rCommandToExecute)
initializes our query composer, and everything which has to do with it
Definition: RowSet.cxx:2252
OUString m_aHavingClause
Definition: RowSet.hxx:112
void impl_initParametersContainer_nothrow()
initializes our parameters container (m_pParameters) according to the parameter columns as obtained f...
Definition: RowSet.cxx:2394
virtual double SAL_CALL getDouble(sal_Int32 columnIndex) override
Definition: RowSet.cxx:1332
virtual void SAL_CALL updateFloat(sal_Int32 columnIndex, float x) override
Definition: RowSet.cxx:683
void impl_initializeColumnSettings_nothrow(const css::uno::Reference< css::beans::XPropertySet > &_rxTemplateColumn, const css::uno::Reference< css::beans::XPropertySet > &_rxRowSetColumn)
initializes a given RowSet column with the ColumnSettings (width, format, hidden, etc....
Definition: RowSet.cxx:1699
OUString m_aUpdateSchemaName
Definition: RowSet.hxx:117
virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() override
Definition: RowSet.cxx:442
virtual void SAL_CALL moveToInsertRow() override
Definition: RowSet.cxx:1146
sal_Int32 m_nQueryTimeOut
Definition: RowSet.hxx:125
virtual ~ORowSet() override
Definition: RowSet.cxx:191
virtual bool isModified() override
Definition: RowSet.cxx:2655
virtual void SAL_CALL setBoolean(sal_Int32 parameterIndex, sal_Bool x) override
Definition: RowSet.cxx:2475
virtual void SAL_CALL setFloat(sal_Int32 parameterIndex, float x) override
Definition: RowSet.cxx:2500
void updateValue(sal_Int32 columnIndex, const connectivity::ORowSetValue &x)
Definition: RowSet.cxx:627
virtual sal_Int64 SAL_CALL getLong(sal_Int32 columnIndex) override
Definition: RowSet.cxx:1320
virtual void SAL_CALL insertRow() override
Definition: RowSet.cxx:827
virtual void SAL_CALL setObjectNull(sal_Int32 parameterIndex, sal_Int32 sqlType, const OUString &typeName) override
Definition: RowSet.cxx:2462
css::uno::Reference< css::sdb::XSingleSelectQueryComposer > m_xComposer
Definition: RowSet.hxx:82
bool m_bRebuildConnOnExecute
Definition: RowSet.hxx:138
virtual void SAL_CALL updateByte(sal_Int32 columnIndex, sal_Int8 x) override
Definition: RowSet.cxx:663
OUString m_aDataSourceName
Definition: RowSet.hxx:107
virtual void SAL_CALL setBinaryStream(sal_Int32 parameterIndex, const css::uno::Reference< css::io::XInputStream > &x, sal_Int32 length) override
Definition: RowSet.cxx:2535
bool m_bInsertingRow
Definition: RowSet.hxx:131
virtual css::uno::Reference< css::container::XIndexAccess > SAL_CALL getParameters() override
Definition: RowSet.cxx:1476
virtual void SAL_CALL updateTime(sal_Int32 columnIndex, const css::util::Time &x) override
Definition: RowSet.cxx:708
virtual void SAL_CALL updateLong(sal_Int32 columnIndex, sal_Int64 x) override
Definition: RowSet.cxx:678
virtual void SAL_CALL release() noexcept override
Definition: RowSet.cxx:417
virtual css::uno::Sequence< sal_Int8 > SAL_CALL getBytes(sal_Int32 columnIndex) override
Definition: RowSet.cxx:1338
static OUString loadString(TranslateId pResId)
loads the string with the specified resource id
static css::sdbc::SQLException * getLastException(css::sdbc::SQLException *pLastException)
static css::uno::Any createException(TYPE eType, const OUString &rErrorMessage, const OUString &rSQLState, const sal_Int32 nErrorCode)
void setExternalWarnings(const css::uno::Reference< css::sdbc::XWarningsSupplier > &_rxExternalWarnings)
css::uno::Any getWarnings() const
T * clone(T *const other)
sal_Int32 m_nCommandType
#define DBA_RES(id)
int nCount
#define TOOLS_WARN_EXCEPTION(area, stream)
#define DBG_UNHANDLED_EXCEPTION(...)
ULONG m_refCount
::connectivity::SQLError m_aErrors
float x
Reference< XSingleServiceFactory > xFactory
sal_Int16 nValue
Reference< XColumn > xColumn
bool bReadOnly
std::mutex m_aMutex
Sequence< sal_Int8 > aSeq
#define SAL_WARN(area, stream)
#define SAL_INFO(area, stream)
constexpr OUStringLiteral aData
@ Exception
const LanguageTag & getLocale()
bool query_aggregation(const css::uno::Reference< css::uno::XAggregation > &_rxAggregate, css::uno::Reference< iface > &_rxOut)
css::uno::Sequence< DstElementType > containerToSequence(const SrcType &i_Container)
OUString getString(const Any &_rAny)
Type
bool any2bool(const css::uno::Any &rAny)
bool CPPUHELPER_DLLPUBLIC supportsService(css::lang::XServiceInfo *implementation, rtl::OUString const &name)
Any SAL_CALL getCaughtException()
css::uno::Reference< css::uno::XInterface > getDataSource(const css::uno::Reference< css::uno::XInterface > &_rxDependentObject)
connectivity::ORowVector< connectivity::ORowSetValue > ORowSetValueVector
Definition: RowSetRow.hxx:29
OUString extractExceptionMessage(const css::uno::Reference< css::uno::XComponentContext > &_rContext, const css::uno::Any &_rError)
retrieves a to-be-displayed string for a given caught exception;
OOO_DLLPUBLIC_DBTOOLS css::util::Date toDate(double dVal, const css::util::Date &_rNullDate=getStandardDate())
OOO_DLLPUBLIC_DBTOOLS css::util::Time toTime(double dVal, short nDigits=9)
OOO_DLLPUBLIC_DBTOOLS css::util::DateTime toDateTime(double dVal, const css::util::Date &_rNullDate=getStandardDate())
bool getDataSourceSetting(const Reference< XInterface > &_xChild, const OUString &_sAsciiSettingsName, Any &_rSettingsValue)
OUString composeTableName(const Reference< XDatabaseMetaData > &_rxMetaData, const OUString &_rCatalog, const OUString &_rSchema, const OUString &_rName, bool _bQuote, EComposeRule _eComposeRule)
void throwFunctionSequenceException(const Reference< XInterface > &Context, const Any &Next)
void throwInvalidIndexException(const css::uno::Reference< css::uno::XInterface > &Context, const css::uno::Any &Next=css::uno::Any())
Reference< XSingleSelectQueryComposer > getCurrentSettingsComposer(const Reference< XPropertySet > &_rxRowSetProps, const Reference< XComponentContext > &_rxContext, const Reference< XWindow > &_rxParent)
void throwFunctionNotSupportedRuntimeException(const OUString &_rFunctionName, const css::uno::Reference< css::uno::XInterface > &_rxContext)
void throwFunctionNotSupportedSQLException(const OUString &_rFunctionName, const css::uno::Reference< css::uno::XInterface > &_rxContext)
void throwGenericSQLException(const OUString &_rMsg, const css::uno::Reference< css::uno::XInterface > &_rxSource)
OUString loadString(TranslateId aResId)
int i
constexpr std::enable_if_t< std::is_signed_v< T >, std::make_unsigned_t< T > > make_unsigned(T value)
void dispose()
css::uno::Any SAL_CALL makeAny(const SharedUNOComponent< INTERFACE, COMPONENT > &value)
sal_Int32 nHandle
OUString sMessage
Definition: sqlmessage.cxx:159
#define PROPERTY_ID_ISMODIFIED
#define PROPERTY_ID_ACTIVE_CONNECTION
#define PROPERTY_ID_ISBOOKMARKABLE
#define PROPERTY_ID_RESULTSETTYPE
#define PROPERTY_ID_USER
#define PROPERTY_ID_ISROWCOUNTFINAL
#define PROPERTY_ID_HAVING_CLAUSE
#define PROPERTY_ID_ISREADONLY
#define PROPERTY_ID_QUERYTIMEOUT
#define PROPERTY_ID_ESCAPE_PROCESSING
#define PROPERTY_ID_CONTROLMODEL
#define PROPERTY_ID_DATASOURCENAME
#define PROPERTY_ID_PRIVILEGES
#define PROPERTY_ID_UPDATE_CATALOGNAME
#define PROPERTY_ID_UPDATE_SCHEMANAME
#define PROPERTY_ID_PROPCHANGE_NOTIFY
#define PROPERTY_ID_PASSWORD
#define PROPERTY_ID_RELATIVEPOSITION
#define PROPERTY_ID_FILTER
#define PROPERTY_ID_IGNORERESULT
#define PROPERTY_ID_RESULTSETCONCURRENCY
#define PROPERTY_ID_MAXFIELDSIZE
#define PROPERTY_ID_HELPTEXT
#define PROPERTY_ID_COMMAND
#define PROPERTY_ID_SINGLESELECTQUERYCOMPOSER
#define PROPERTY_ID_TRANSACTIONISOLATION
#define PROPERTY_ID_ACTIVECOMMAND
#define PROPERTY_ID_WIDTH
#define PROPERTY_ID_FETCHSIZE
#define PROPERTY_ID_HIDDEN
#define PROPERTY_ID_ALIGN
#define PROPERTY_ID_CONTROLDEFAULT
#define PROPERTY_ID_ORDER
#define PROPERTY_ID_UPDATE_TABLENAME
#define PROPERTY_ID_GROUP_BY
#define PROPERTY_ID_ISNEW
#define PROPERTY_ID_ROWCOUNT
#define PROPERTY_ID_NUMBERFORMAT
#define PROPERTY_ID_CANUPDATEINSERTEDROWS
#define PROPERTY_ID_TYPEMAP
#define PROPERTY_ID_MAXROWS
#define PROPERTY_ID_URL
#define PROPERTY_ID_FETCHDIRECTION
#define PROPERTY_ID_APPLYFILTER
#define PROPERTY_ID_COMMAND_TYPE
constexpr OUStringLiteral PROPERTY_IGNORERESULT(u"IgnoreResult")
constexpr OUStringLiteral PROPERTY_WIDTH(u"Width")
constexpr OUStringLiteral PROPERTY_COMMAND(u"Command")
constexpr OUStringLiteral PROPERTY_FETCHDIRECTION(u"FetchDirection")
constexpr OUStringLiteral SERVICE_SDBC_RESULTSET
Definition: strings.hxx:164
constexpr OUStringLiteral PROPERTY_USER(u"User")
constexpr OUStringLiteral PROPERTY_URL(u"URL")
constexpr OUStringLiteral PROPERTY_HAVING_CLAUSE(u"HavingClause")
constexpr OUStringLiteral PROPERTY_UPDATE_TABLENAME(u"UpdateTableName")
constexpr OUStringLiteral PROPERTY_RESULTSETCONCURRENCY(u"ResultSetConcurrency")
constexpr OUStringLiteral PROPERTY_CONTROLDEFAULT(u"ControlDefault")
constexpr OUStringLiteral PROPERTY_SINGLESELECTQUERYCOMPOSER(u"SingleSelectQueryComposer")
constexpr OUStringLiteral PROPERTY_RESULTSETTYPE(u"ResultSetType")
constexpr OUStringLiteral PROPERTY_RELATIVEPOSITION(u"RelativePosition")
constexpr OUStringLiteral PROPERTY_NUMBERFORMAT(u"FormatKey")
constexpr OUStringLiteral PROPERTY_ISREADONLY(u"IsReadOnly")
constexpr OUStringLiteral PROPERTY_LABEL(u"Label")
constexpr OUStringLiteral PROPERTY_QUERYTIMEOUT(u"QueryTimeOut")
constexpr OUStringLiteral PROPERTY_ISMODIFIED(u"IsModified")
constexpr OUStringLiteral PROPERTY_UPDATE_SCHEMANAME(u"UpdateSchemaName")
constexpr OUStringLiteral PROPERTY_DESCRIPTION(u"Description")
constexpr OUStringLiteral PROPERTY_ISBOOKMARKABLE(u"IsBookmarkable")
constexpr OUStringLiteral SERVICE_SDB_ROWSET
Definition: strings.hxx:183
constexpr OUStringLiteral PROPERTY_APPLYFILTER(u"ApplyFilter")
constexpr OUStringLiteral PROPERTY_CHANGE_NOTIFICATION_ENABLED(u"PropertyChangeNotificationEnabled")
constexpr OUStringLiteral PROPERTY_REALNAME(u"RealName")
constexpr OUStringLiteral SERVICE_NAME_SINGLESELECTQUERYCOMPOSER
Definition: strings.hxx:201
constexpr OUStringLiteral PROPERTY_GROUP_BY(u"GroupBy")
constexpr OUStringLiteral PROPERTY_PASSWORD(u"Password")
constexpr OUStringLiteral PROPERTY_MAXFIELDSIZE(u"MaxFieldSize")
constexpr OUStringLiteral PROPERTY_TYPEMAP(u"TypeMap")
constexpr OUStringLiteral PROPERTY_FILTER(u"Filter")
constexpr OUStringLiteral PROPERTY_ACTIVE_CONNECTION(u"ActiveConnection")
constexpr OUStringLiteral SERVICE_SDBC_ROWSET
Definition: strings.hxx:165
constexpr OUStringLiteral PROPERTY_MAXROWS(u"MaxRows")
constexpr OUStringLiteral PROPERTY_TABLENAME(u"TableName")
constexpr OUStringLiteral PROPERTY_ESCAPE_PROCESSING(u"EscapeProcessing")
constexpr OUStringLiteral SQLSTATE_GENERAL
Definition: strings.hxx:267
constexpr OUStringLiteral SERVICE_SDBCX_RESULTSET
Definition: strings.hxx:173
constexpr OUStringLiteral SERVICE_SDB_RESULTSET
Definition: strings.hxx:182
constexpr OUStringLiteral PROPERTY_TRANSACTIONISOLATION(u"TransactionIsolation")
constexpr OUStringLiteral PROPERTY_HELPTEXT(u"HelpText")
constexpr OUStringLiteral PROPERTY_TYPE(u"Type")
constexpr OUStringLiteral PROPERTY_USEBOOKMARKS(u"UseBookmarks")
constexpr OUStringLiteral PROPERTY_NAME(u"Name")
constexpr OUStringLiteral PROPERTY_UPDATE_CATALOGNAME(u"UpdateCatalogName")
constexpr OUStringLiteral PROPERTY_CONTROLMODEL(u"ControlModel")
constexpr OUStringLiteral PROPERTY_DATASOURCENAME(u"DataSourceName")
constexpr OUStringLiteral PROPERTY_ACTIVECOMMAND(u"ActiveCommand")
constexpr OUStringLiteral PROPERTY_FETCHSIZE(u"FetchSize")
constexpr OUStringLiteral PROPERTY_HIDDEN(u"Hidden")
constexpr OUStringLiteral PROPERTY_ALIGN(u"Align")
constexpr OUStringLiteral PROPERTY_PRIVILEGES(u"Privileges")
constexpr OUStringLiteral PROPERTY_COMMAND_TYPE(u"CommandType")
constexpr OUStringLiteral PROPERTY_CANUPDATEINSERTEDROWS(u"CanUpdateInsertedRows")
constexpr OUStringLiteral PROPERTY_ORDER(u"Order")
constexpr OUStringLiteral PROPERTY_ISNEW(u"IsNew")
unsigned char sal_Bool
sal_uInt16 sal_Unicode
signed char sal_Int8
Any result
const SvXMLTokenMapEntry aTypes[]
sal_Int32 _nPos
std::mutex * m_pMutex