LibreOffice Module ucbhelper (master)  1
resultset.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 
21 /**************************************************************************
22  TODO
23  **************************************************************************
24 
25  *************************************************************************/
26 #include <memory>
29 #include <com/sun/star/beans/PropertyAttribute.hpp>
30 #include <com/sun/star/sdbc/SQLException.hpp>
31 #include <ucbhelper/resultset.hxx>
33 #include <ucbhelper/macros.hxx>
34 
35 using namespace com::sun::star;
36 
37 
38 namespace ucbhelper_impl
39 {
40 
41 namespace {
42 
43 struct PropertyInfo
44 {
45  const char* pName;
46  sal_Int32 nHandle;
47  sal_Int16 nAttributes;
48  const uno::Type& (*pGetCppuType)();
49 };
50 
51 }
52 
54 {
56 }
57 
59 {
60  return cppu::UnoType<bool>::get();
61 }
62 
63 const PropertyInfo aPropertyTable[] =
64 {
65  { "IsRowCountFinal",
66  1000,
67  beans::PropertyAttribute::BOUND | beans::PropertyAttribute::READONLY,
69  },
70  { "RowCount",
71  1001,
72  beans::PropertyAttribute::BOUND | beans::PropertyAttribute::READONLY,
74  },
75  { nullptr,
76  0,
77  0,
78  nullptr
79  }
80 };
81 
82 #define RESULTSET_PROPERTY_COUNT 2
83 
84 
85 
86 namespace {
87 
88 class PropertySetInfo :
89  public cppu::OWeakObject,
90  public lang::XTypeProvider,
91  public beans::XPropertySetInfo
92 {
93  std::unique_ptr<uno::Sequence< beans::Property >> m_pProps;
94 
95 private:
96  bool queryProperty(
97  const OUString& aName, beans::Property& rProp ) const;
98 
99 public:
100  PropertySetInfo(
101  const PropertyInfo* pProps,
102  sal_Int32 nProps );
103 
104  // XInterface
105  virtual css::uno::Any SAL_CALL queryInterface( const css::uno::Type & rType ) override;
106  virtual void SAL_CALL acquire()
107  throw() override;
108  virtual void SAL_CALL release()
109  throw() override;
110 
111  // XTypeProvider
112  virtual css::uno::Sequence< sal_Int8 > SAL_CALL getImplementationId() override;
113  virtual css::uno::Sequence< css::uno::Type > SAL_CALL getTypes() override;
114 
115  // XPropertySetInfo
116  virtual uno::Sequence< beans::Property > SAL_CALL getProperties() override;
117  virtual beans::Property SAL_CALL getPropertyByName(
118  const OUString& aName ) override;
119  virtual sal_Bool SAL_CALL hasPropertyByName( const OUString& Name ) override;
120 };
121 
122 }
123 
124 typedef cppu::OMultiTypeInterfaceContainerHelperVar<OUString>
126 
127 namespace {
128 
130 {
131 public:
132  explicit PropertyChangeListeners( osl::Mutex& rMtx )
134 };
135 
136 }
137 
138 } // namespace ucbhelper_impl
139 
140 using namespace ucbhelper_impl;
141 
142 namespace ucbhelper
143 {
144 
145 
146 // struct ResultSet_Impl.
147 
148 
150 {
151  uno::Reference< uno::XComponentContext > m_xContext;
152  uno::Reference< css::ucb::XCommandEnvironment > m_xEnv;
153  uno::Reference< beans::XPropertySetInfo > m_xPropSetInfo;
154  uno::Reference< sdbc::XResultSetMetaData > m_xMetaData;
155  uno::Sequence< beans::Property > m_aProperties;
157  osl::Mutex m_aMutex;
158  std::unique_ptr<cppu::OInterfaceContainerHelper> m_pDisposeEventListeners;
159  std::unique_ptr<PropertyChangeListeners> m_pPropertyChangeListeners;
160  sal_Int32 m_nPos;
163 
164  inline ResultSet_Impl(
165  const uno::Reference< uno::XComponentContext >& rxContext,
166  const uno::Sequence< beans::Property >& rProperties,
167  const rtl::Reference< ResultSetDataSupplier >& rDataSupplier,
168  const uno::Reference< css::ucb::XCommandEnvironment >& rxEnv );
169 };
170 
171 inline ResultSet_Impl::ResultSet_Impl(
172  const uno::Reference< uno::XComponentContext >& rxContext,
173  const uno::Sequence< beans::Property >& rProperties,
174  const rtl::Reference< ResultSetDataSupplier >& rDataSupplier,
175  const uno::Reference< css::ucb::XCommandEnvironment >& rxEnv )
176 : m_xContext( rxContext ),
177  m_xEnv( rxEnv ),
178  m_aProperties( rProperties ),
179  m_xDataSupplier( rDataSupplier ),
180  m_nPos( 0 ), // Position is one-based. Zero means: before first element.
181  m_bWasNull( false ),
182  m_bAfterLast( false )
183 {
184 }
185 
186 
187 // ResultSet Implementation.
188 
189 
191  const uno::Reference< uno::XComponentContext >& rxContext,
192  const uno::Sequence< beans::Property >& rProperties,
193  const rtl::Reference< ResultSetDataSupplier >& rDataSupplier )
194 : m_pImpl( new ResultSet_Impl(
195  rxContext,
196  rProperties,
197  rDataSupplier,
198  uno::Reference< css::ucb::XCommandEnvironment >() ) )
199 {
200  rDataSupplier->m_pResultSet = this;
201 }
202 
203 
205  const uno::Reference< uno::XComponentContext >& rxContext,
206  const uno::Sequence< beans::Property >& rProperties,
207  const rtl::Reference< ResultSetDataSupplier >& rDataSupplier,
208  const uno::Reference< css::ucb::XCommandEnvironment >& rxEnv )
209 : m_pImpl( new ResultSet_Impl( rxContext, rProperties, rDataSupplier, rxEnv ) )
210 {
211  rDataSupplier->m_pResultSet = this;
212 }
213 
214 
215 // virtual
217 {
218 }
219 
220 
221 // XServiceInfo methods.
222 
224 {
225  return "ResultSet";
226 }
227 
228 sal_Bool SAL_CALL ResultSet::supportsService( const OUString& ServiceName )
229 {
230  return cppu::supportsService( this, ServiceName );
231 }
232 
233 css::uno::Sequence< OUString > SAL_CALL ResultSet::getSupportedServiceNames()
234 {
235  return { RESULTSET_SERVICE_NAME };
236 }
237 
238 
239 // XComponent methods.
240 
241 
242 // virtual
243 void SAL_CALL ResultSet::dispose()
244 {
245  osl::MutexGuard aGuard( m_pImpl->m_aMutex );
246 
247  if ( m_pImpl->m_pDisposeEventListeners &&
248  m_pImpl->m_pDisposeEventListeners->getLength() )
249  {
250  lang::EventObject aEvt;
251  aEvt.Source = static_cast< lang::XComponent * >( this );
252  m_pImpl->m_pDisposeEventListeners->disposeAndClear( aEvt );
253  }
254 
255  if ( m_pImpl->m_pPropertyChangeListeners )
256  {
257  lang::EventObject aEvt;
258  aEvt.Source = static_cast< beans::XPropertySet * >( this );
259  m_pImpl->m_pPropertyChangeListeners->disposeAndClear( aEvt );
260  }
261 
262  m_pImpl->m_xDataSupplier->close();
263 }
264 
265 
266 // virtual
268  const uno::Reference< lang::XEventListener >& Listener )
269 {
270  osl::MutexGuard aGuard( m_pImpl->m_aMutex );
271 
272  if ( !m_pImpl->m_pDisposeEventListeners )
273  m_pImpl->m_pDisposeEventListeners.reset(
274  new cppu::OInterfaceContainerHelper( m_pImpl->m_aMutex ));
275 
276  m_pImpl->m_pDisposeEventListeners->addInterface( Listener );
277 }
278 
279 
280 // virtual
282  const uno::Reference< lang::XEventListener >& Listener )
283 {
284  osl::MutexGuard aGuard( m_pImpl->m_aMutex );
285 
286  if ( m_pImpl->m_pDisposeEventListeners )
287  m_pImpl->m_pDisposeEventListeners->removeInterface( Listener );
288 }
289 
290 
291 // XResultSetMetaDataSupplier methods.
292 
293 
294 // virtual
295 uno::Reference< sdbc::XResultSetMetaData > SAL_CALL ResultSet::getMetaData()
296 {
297  osl::MutexGuard aGuard( m_pImpl->m_aMutex );
298 
299  if ( !m_pImpl->m_xMetaData.is() )
300  m_pImpl->m_xMetaData = new ResultSetMetaData( m_pImpl->m_xContext,
301  m_pImpl->m_aProperties );
302 
303  return m_pImpl->m_xMetaData;
304 }
305 
306 
307 // XResultSet methods.
308 
309 
310 // virtual
312 {
313  // Note: Cursor is initially positioned before the first row.
314  // First call to 'next()' moves it to first row.
315 
316  osl::MutexGuard aGuard( m_pImpl->m_aMutex );
317 
318  if ( m_pImpl->m_bAfterLast )
319  {
320  m_pImpl->m_xDataSupplier->validate();
321  return false;
322  }
323 
324  // getResult works zero-based!
325  if ( !m_pImpl->m_xDataSupplier->getResult( m_pImpl->m_nPos ) )
326  {
327  m_pImpl->m_bAfterLast = true;
328  m_pImpl->m_xDataSupplier->validate();
329  return false;
330  }
331 
332  m_pImpl->m_nPos++;
333  m_pImpl->m_xDataSupplier->validate();
334  return true;
335 }
336 
337 
338 // virtual
340 {
341  if ( m_pImpl->m_bAfterLast )
342  {
343  m_pImpl->m_xDataSupplier->validate();
344  return false;
345  }
346 
347  // getResult works zero-based!
348  if ( !m_pImpl->m_xDataSupplier->getResult( 0 ) )
349  {
350  m_pImpl->m_xDataSupplier->validate();
351  return false;
352  }
353 
354  m_pImpl->m_xDataSupplier->validate();
355  return ( m_pImpl->m_nPos == 0 );
356 }
357 
358 
359 // virtual
361 {
362  m_pImpl->m_xDataSupplier->validate();
363  return m_pImpl->m_bAfterLast;
364 }
365 
366 
367 // virtual
369 {
370  if ( m_pImpl->m_bAfterLast )
371  {
372  m_pImpl->m_xDataSupplier->validate();
373  return false;
374  }
375 
376  m_pImpl->m_xDataSupplier->validate();
377  return ( m_pImpl->m_nPos == 1 );
378 }
379 
380 
381 // virtual
383 {
384  if ( m_pImpl->m_bAfterLast )
385  {
386  m_pImpl->m_xDataSupplier->validate();
387  return false;
388  }
389 
390  sal_Int32 nCount = m_pImpl->m_xDataSupplier->totalCount();
391  if ( !nCount )
392  {
393  m_pImpl->m_xDataSupplier->validate();
394  return false;
395  }
396 
397  m_pImpl->m_xDataSupplier->validate();
398  return ( m_pImpl->m_nPos == nCount );
399 }
400 
401 
402 // virtual
403 void SAL_CALL ResultSet::beforeFirst()
404 {
405  osl::MutexGuard aGuard( m_pImpl->m_aMutex );
406  m_pImpl->m_bAfterLast = false;
407  m_pImpl->m_nPos = 0;
408  m_pImpl->m_xDataSupplier->validate();
409 }
410 
411 
412 // virtual
413 void SAL_CALL ResultSet::afterLast()
414 {
415  osl::MutexGuard aGuard( m_pImpl->m_aMutex );
416  m_pImpl->m_bAfterLast = true;
417  m_pImpl->m_xDataSupplier->validate();
418 }
419 
420 
421 // virtual
423 {
424  // getResult works zero-based!
425  if ( m_pImpl->m_xDataSupplier->getResult( 0 ) )
426  {
427  osl::MutexGuard aGuard( m_pImpl->m_aMutex );
428  m_pImpl->m_bAfterLast = false;
429  m_pImpl->m_nPos = 1;
430  m_pImpl->m_xDataSupplier->validate();
431  return true;
432  }
433 
434  m_pImpl->m_xDataSupplier->validate();
435  return false;
436 }
437 
438 
439 // virtual
441 {
442  sal_Int32 nCount = m_pImpl->m_xDataSupplier->totalCount();
443  if ( nCount )
444  {
445  osl::MutexGuard aGuard( m_pImpl->m_aMutex );
446  m_pImpl->m_bAfterLast = false;
447  m_pImpl->m_nPos = nCount;
448  m_pImpl->m_xDataSupplier->validate();
449  return true;
450  }
451 
452  m_pImpl->m_xDataSupplier->validate();
453  return false;
454 }
455 
456 
457 // virtual
458 sal_Int32 SAL_CALL ResultSet::getRow()
459 {
460  if ( m_pImpl->m_bAfterLast )
461  {
462  m_pImpl->m_xDataSupplier->validate();
463  return 0;
464  }
465 
466  m_pImpl->m_xDataSupplier->validate();
467  return m_pImpl->m_nPos;
468 }
469 
470 
471 // virtual
472 sal_Bool SAL_CALL ResultSet::absolute( sal_Int32 row )
473 {
474 /*
475  If the row number is positive, the cursor moves to the given row number
476  with respect to the beginning of the result set. The first row is row 1,
477  the second is row 2, and so on.
478 
479  If the given row number is negative, the cursor moves to an absolute row
480  position with respect to the end of the result set. For example, calling
481  absolute( -1 ) positions the cursor on the last row, absolute( -2 )
482  indicates the next-to-last row, and so on.
483 
484  An attempt to position the cursor beyond the first/last row in the result
485  set leaves the cursor before/after the first/last row, respectively.
486 
487  Calling absolute( 1 ) is the same as calling first().
488 
489  Calling absolute( -1 ) is the same as calling last().
490 */
491  if ( row < 0 )
492  {
493  sal_Int32 nCount = m_pImpl->m_xDataSupplier->totalCount();
494 
495  if ( ( row * -1 ) > nCount )
496  {
497  osl::MutexGuard aGuard( m_pImpl->m_aMutex );
498  m_pImpl->m_bAfterLast = false;
499  m_pImpl->m_nPos = 0;
500  m_pImpl->m_xDataSupplier->validate();
501  return false;
502  }
503  else // |row| <= nCount
504  {
505  osl::MutexGuard aGuard( m_pImpl->m_aMutex );
506  m_pImpl->m_bAfterLast = false;
507  m_pImpl->m_nPos = ( nCount + row + 1 );
508  m_pImpl->m_xDataSupplier->validate();
509  return true;
510  }
511  }
512  else if ( row == 0 )
513  {
514  // @throws SQLException
515  // ... if row is 0 ...
516  throw sdbc::SQLException();
517  }
518  else // row > 0
519  {
520  sal_Int32 nCount = m_pImpl->m_xDataSupplier->totalCount();
521 
522  if ( row <= nCount )
523  {
524  osl::MutexGuard aGuard( m_pImpl->m_aMutex );
525  m_pImpl->m_bAfterLast = false;
526  m_pImpl->m_nPos = row;
527  m_pImpl->m_xDataSupplier->validate();
528  return true;
529  }
530  else // row > nCount
531  {
532  osl::MutexGuard aGuard( m_pImpl->m_aMutex );
533  m_pImpl->m_bAfterLast = true;
534  m_pImpl->m_xDataSupplier->validate();
535  return false;
536  }
537  }
538 
539  // unreachable...
540 }
541 
542 
543 // virtual
544 sal_Bool SAL_CALL ResultSet::relative( sal_Int32 rows )
545 {
546 /*
547  Attempting to move beyond the first/last row in the result set
548  positions the cursor before/after the first/last row.
549 
550  Calling relative( 0 ) is valid, but does not change the cursor position.
551 
552  Calling relative( 1 ) is different from calling next() because it makes
553  sense to call next() when there is no current row, for example, when
554  the cursor is positioned before the first row or after the last row of
555  the result set.
556 */
557  if ( m_pImpl->m_bAfterLast || ( m_pImpl->m_nPos == 0 ) )
558  {
559  // "No current row".
560  throw sdbc::SQLException();
561  }
562 
563  if ( rows < 0 )
564  {
565  if ( ( m_pImpl->m_nPos + rows ) > 0 )
566  {
567  osl::MutexGuard aGuard( m_pImpl->m_aMutex );
568  m_pImpl->m_bAfterLast = false;
569  m_pImpl->m_nPos = ( m_pImpl->m_nPos + rows );
570  m_pImpl->m_xDataSupplier->validate();
571  return true;
572  }
573  else
574  {
575  osl::MutexGuard aGuard( m_pImpl->m_aMutex );
576  m_pImpl->m_bAfterLast = false;
577  m_pImpl->m_nPos = 0;
578  m_pImpl->m_xDataSupplier->validate();
579  return false;
580  }
581  }
582  else if ( rows == 0 )
583  {
584  // nop.
585  m_pImpl->m_xDataSupplier->validate();
586  return true;
587  }
588  else // rows > 0
589  {
590  sal_Int32 nCount = m_pImpl->m_xDataSupplier->totalCount();
591  if ( ( m_pImpl->m_nPos + rows ) <= nCount )
592  {
593  osl::MutexGuard aGuard( m_pImpl->m_aMutex );
594  m_pImpl->m_bAfterLast = false;
595  m_pImpl->m_nPos = ( m_pImpl->m_nPos + rows );
596  m_pImpl->m_xDataSupplier->validate();
597  return true;
598  }
599  else
600  {
601  osl::MutexGuard aGuard( m_pImpl->m_aMutex );
602  m_pImpl->m_bAfterLast = true;
603  m_pImpl->m_xDataSupplier->validate();
604  return false;
605  }
606  }
607 
608  // unreachable...
609 }
610 
611 
612 // virtual
614 {
615 /*
616  previous() is not the same as relative( -1 ) because it makes sense
617  to call previous() when there is no current row.
618 */
619  osl::MutexGuard aGuard( m_pImpl->m_aMutex );
620 
621  if ( m_pImpl->m_bAfterLast )
622  {
623  m_pImpl->m_bAfterLast = false;
624  sal_Int32 nCount = m_pImpl->m_xDataSupplier->totalCount();
625  m_pImpl->m_nPos = nCount;
626  }
627  else if ( m_pImpl->m_nPos )
628  m_pImpl->m_nPos--;
629 
630  if ( m_pImpl->m_nPos )
631  {
632  m_pImpl->m_xDataSupplier->validate();
633  return true;
634  }
635 
636  m_pImpl->m_xDataSupplier->validate();
637  return false;
638 }
639 
640 
641 // virtual
642 void SAL_CALL ResultSet::refreshRow()
643 {
644  osl::MutexGuard aGuard( m_pImpl->m_aMutex );
645  if ( m_pImpl->m_bAfterLast || ( m_pImpl->m_nPos == 0 ) )
646  return;
647 
648  m_pImpl->m_xDataSupplier->releasePropertyValues( m_pImpl->m_nPos );
649  m_pImpl->m_xDataSupplier->validate();
650 }
651 
652 
653 // virtual
655 {
656  m_pImpl->m_xDataSupplier->validate();
657  return false;
658 }
659 
660 
661 // virtual
663 {
664  m_pImpl->m_xDataSupplier->validate();
665  return false;
666 }
667 
668 
669 // virtual
671 {
672  m_pImpl->m_xDataSupplier->validate();
673  return false;
674 }
675 
676 
677 // virtual
678 uno::Reference< uno::XInterface > SAL_CALL ResultSet::getStatement()
679 {
680 /*
681  returns the Statement that produced this ResultSet object. If the
682  result set was generated some other way, ... this method returns null.
683 */
684  m_pImpl->m_xDataSupplier->validate();
685  return uno::Reference< uno::XInterface >();
686 }
687 
688 
689 // XRow methods.
690 
691 
692 // virtual
694 {
695  // This method can not be implemented correctly!!! Imagine different
696  // threads doing a getXYZ - wasNull calling sequence on the same
697  // implementation object...
698 
699  if ( m_pImpl->m_nPos && !m_pImpl->m_bAfterLast )
700  {
701  uno::Reference< sdbc::XRow > xValues
702  = m_pImpl->m_xDataSupplier->queryPropertyValues(
703  m_pImpl->m_nPos - 1 );
704  if ( xValues.is() )
705  {
706  m_pImpl->m_xDataSupplier->validate();
707  return xValues->wasNull();
708  }
709  }
710 
711  m_pImpl->m_xDataSupplier->validate();
712  return m_pImpl->m_bWasNull;
713 }
714 
715 
716 // virtual
717 OUString SAL_CALL ResultSet::getString( sal_Int32 columnIndex )
718 {
719  if ( m_pImpl->m_nPos && !m_pImpl->m_bAfterLast )
720  {
721  uno::Reference< sdbc::XRow > xValues
722  = m_pImpl->m_xDataSupplier->queryPropertyValues(
723  m_pImpl->m_nPos - 1 );
724  if ( xValues.is() )
725  {
726  m_pImpl->m_bWasNull = false;
727  m_pImpl->m_xDataSupplier->validate();
728  return xValues->getString( columnIndex );
729  }
730  }
731 
732  m_pImpl->m_bWasNull = true;
733  m_pImpl->m_xDataSupplier->validate();
734  return OUString();
735 }
736 
737 
738 // virtual
739 sal_Bool SAL_CALL ResultSet::getBoolean( sal_Int32 columnIndex )
740 {
741  if ( m_pImpl->m_nPos && !m_pImpl->m_bAfterLast )
742  {
743  uno::Reference< sdbc::XRow > xValues
744  = m_pImpl->m_xDataSupplier->queryPropertyValues(
745  m_pImpl->m_nPos - 1 );
746  if ( xValues.is() )
747  {
748  m_pImpl->m_bWasNull = false;
749  m_pImpl->m_xDataSupplier->validate();
750  return xValues->getBoolean( columnIndex );
751  }
752  }
753 
754  m_pImpl->m_bWasNull = true;
755  m_pImpl->m_xDataSupplier->validate();
756  return false;
757 }
758 
759 
760 // virtual
761 sal_Int8 SAL_CALL ResultSet::getByte( sal_Int32 columnIndex )
762 {
763  if ( m_pImpl->m_nPos && !m_pImpl->m_bAfterLast )
764  {
765  uno::Reference< sdbc::XRow > xValues
766  = m_pImpl->m_xDataSupplier->queryPropertyValues(
767  m_pImpl->m_nPos - 1 );
768  if ( xValues.is() )
769  {
770  m_pImpl->m_bWasNull = false;
771  m_pImpl->m_xDataSupplier->validate();
772  return xValues->getByte( columnIndex );
773  }
774  }
775 
776  m_pImpl->m_bWasNull = true;
777  m_pImpl->m_xDataSupplier->validate();
778  return 0;
779 }
780 
781 
782 // virtual
783 sal_Int16 SAL_CALL ResultSet::getShort( sal_Int32 columnIndex )
784 {
785  if ( m_pImpl->m_nPos && !m_pImpl->m_bAfterLast )
786  {
787  uno::Reference< sdbc::XRow > xValues
788  = m_pImpl->m_xDataSupplier->queryPropertyValues(
789  m_pImpl->m_nPos - 1 );
790  if ( xValues.is() )
791  {
792  m_pImpl->m_bWasNull = false;
793  m_pImpl->m_xDataSupplier->validate();
794  return xValues->getShort( columnIndex );
795  }
796  }
797 
798  m_pImpl->m_bWasNull = true;
799  m_pImpl->m_xDataSupplier->validate();
800  return 0;
801 }
802 
803 
804 // virtual
805 sal_Int32 SAL_CALL ResultSet::getInt( sal_Int32 columnIndex )
806 {
807  if ( m_pImpl->m_nPos && !m_pImpl->m_bAfterLast )
808  {
809  uno::Reference< sdbc::XRow > xValues
810  = m_pImpl->m_xDataSupplier->queryPropertyValues(
811  m_pImpl->m_nPos - 1 );
812  if ( xValues.is() )
813  {
814  m_pImpl->m_bWasNull = false;
815  m_pImpl->m_xDataSupplier->validate();
816  return xValues->getInt( columnIndex );
817  }
818  }
819 
820  m_pImpl->m_bWasNull = true;
821  m_pImpl->m_xDataSupplier->validate();
822  return 0;
823 }
824 
825 
826 // virtual
827 sal_Int64 SAL_CALL ResultSet::getLong( sal_Int32 columnIndex )
828 {
829  if ( m_pImpl->m_nPos && !m_pImpl->m_bAfterLast )
830  {
831  uno::Reference< sdbc::XRow > xValues
832  = m_pImpl->m_xDataSupplier->queryPropertyValues(
833  m_pImpl->m_nPos - 1 );
834  if ( xValues.is() )
835  {
836  m_pImpl->m_bWasNull = false;
837  m_pImpl->m_xDataSupplier->validate();
838  return xValues->getLong( columnIndex );
839  }
840  }
841 
842  m_pImpl->m_bWasNull = true;
843  m_pImpl->m_xDataSupplier->validate();
844  return 0;
845 }
846 
847 
848 // virtual
849 float SAL_CALL ResultSet::getFloat( sal_Int32 columnIndex )
850 {
851  if ( m_pImpl->m_nPos && !m_pImpl->m_bAfterLast )
852  {
853  uno::Reference< sdbc::XRow > xValues
854  = m_pImpl->m_xDataSupplier->queryPropertyValues(
855  m_pImpl->m_nPos - 1 );
856  if ( xValues.is() )
857  {
858  m_pImpl->m_bWasNull = false;
859  m_pImpl->m_xDataSupplier->validate();
860  return xValues->getFloat( columnIndex );
861  }
862  }
863 
864  m_pImpl->m_bWasNull = true;
865  m_pImpl->m_xDataSupplier->validate();
866  return 0;
867 }
868 
869 
870 // virtual
871 double SAL_CALL ResultSet::getDouble( sal_Int32 columnIndex )
872 {
873  if ( m_pImpl->m_nPos && !m_pImpl->m_bAfterLast )
874  {
875  uno::Reference< sdbc::XRow > xValues
876  = m_pImpl->m_xDataSupplier->queryPropertyValues(
877  m_pImpl->m_nPos - 1 );
878  if ( xValues.is() )
879  {
880  m_pImpl->m_bWasNull = false;
881  m_pImpl->m_xDataSupplier->validate();
882  return xValues->getDouble( columnIndex );
883  }
884  }
885 
886  m_pImpl->m_bWasNull = true;
887  m_pImpl->m_xDataSupplier->validate();
888  return 0;
889 }
890 
891 
892 // virtual
893 uno::Sequence< sal_Int8 > SAL_CALL
894 ResultSet::getBytes( sal_Int32 columnIndex )
895 {
896  if ( m_pImpl->m_nPos && !m_pImpl->m_bAfterLast )
897  {
898  uno::Reference< sdbc::XRow > xValues
899  = m_pImpl->m_xDataSupplier->queryPropertyValues(
900  m_pImpl->m_nPos - 1 );
901  if ( xValues.is() )
902  {
903  m_pImpl->m_bWasNull = false;
904  m_pImpl->m_xDataSupplier->validate();
905  return xValues->getBytes( columnIndex );
906  }
907  }
908 
909  m_pImpl->m_bWasNull = true;
910  m_pImpl->m_xDataSupplier->validate();
911  return uno::Sequence< sal_Int8 >();
912 }
913 
914 
915 // virtual
916 util::Date SAL_CALL ResultSet::getDate( sal_Int32 columnIndex )
917 {
918  if ( m_pImpl->m_nPos && !m_pImpl->m_bAfterLast )
919  {
920  uno::Reference< sdbc::XRow > xValues
921  = m_pImpl->m_xDataSupplier->queryPropertyValues(
922  m_pImpl->m_nPos - 1 );
923  if ( xValues.is() )
924  {
925  m_pImpl->m_bWasNull = false;
926  m_pImpl->m_xDataSupplier->validate();
927  return xValues->getDate( columnIndex );
928  }
929  }
930 
931  m_pImpl->m_bWasNull = true;
932  m_pImpl->m_xDataSupplier->validate();
933  return util::Date();
934 }
935 
936 
937 // virtual
938 util::Time SAL_CALL ResultSet::getTime( sal_Int32 columnIndex )
939 {
940  if ( m_pImpl->m_nPos && !m_pImpl->m_bAfterLast )
941  {
942  uno::Reference< sdbc::XRow > xValues
943  = m_pImpl->m_xDataSupplier->queryPropertyValues(
944  m_pImpl->m_nPos - 1 );
945  if ( xValues.is() )
946  {
947  m_pImpl->m_bWasNull = false;
948  m_pImpl->m_xDataSupplier->validate();
949  return xValues->getTime( columnIndex );
950  }
951  }
952 
953  m_pImpl->m_bWasNull = true;
954  m_pImpl->m_xDataSupplier->validate();
955  return util::Time();
956 }
957 
958 
959 // virtual
960 util::DateTime SAL_CALL
961 ResultSet::getTimestamp( sal_Int32 columnIndex )
962 {
963  if ( m_pImpl->m_nPos && !m_pImpl->m_bAfterLast )
964  {
965  uno::Reference< sdbc::XRow > xValues
966  = m_pImpl->m_xDataSupplier->queryPropertyValues(
967  m_pImpl->m_nPos - 1 );
968  if ( xValues.is() )
969  {
970  m_pImpl->m_bWasNull = false;
971  m_pImpl->m_xDataSupplier->validate();
972  return xValues->getTimestamp( columnIndex );
973  }
974  }
975 
976  m_pImpl->m_bWasNull = true;
977  m_pImpl->m_xDataSupplier->validate();
978  return util::DateTime();
979 }
980 
981 
982 // virtual
983 uno::Reference< io::XInputStream > SAL_CALL
984 ResultSet::getBinaryStream( sal_Int32 columnIndex )
985 {
986  if ( m_pImpl->m_nPos && !m_pImpl->m_bAfterLast )
987  {
988  uno::Reference< sdbc::XRow > xValues
989  = m_pImpl->m_xDataSupplier->queryPropertyValues(
990  m_pImpl->m_nPos - 1 );
991  if ( xValues.is() )
992  {
993  m_pImpl->m_bWasNull = false;
994  m_pImpl->m_xDataSupplier->validate();
995  return xValues->getBinaryStream( columnIndex );
996  }
997  }
998 
999  m_pImpl->m_bWasNull = true;
1000  m_pImpl->m_xDataSupplier->validate();
1001  return uno::Reference< io::XInputStream >();
1002 }
1003 
1004 
1005 // virtual
1006 uno::Reference< io::XInputStream > SAL_CALL
1007 ResultSet::getCharacterStream( sal_Int32 columnIndex )
1008 {
1009  if ( m_pImpl->m_nPos && !m_pImpl->m_bAfterLast )
1010  {
1011  uno::Reference< sdbc::XRow > xValues
1012  = m_pImpl->m_xDataSupplier->queryPropertyValues(
1013  m_pImpl->m_nPos - 1 );
1014  if ( xValues.is() )
1015  {
1016  m_pImpl->m_bWasNull = false;
1017  m_pImpl->m_xDataSupplier->validate();
1018  return xValues->getCharacterStream( columnIndex );
1019  }
1020  }
1021 
1022  m_pImpl->m_bWasNull = true;
1023  m_pImpl->m_xDataSupplier->validate();
1024  return uno::Reference< io::XInputStream >();
1025 }
1026 
1027 
1028 // virtual
1030  sal_Int32 columnIndex,
1031  const uno::Reference< container::XNameAccess >& typeMap )
1032 {
1033  if ( m_pImpl->m_nPos && !m_pImpl->m_bAfterLast )
1034  {
1035  uno::Reference< sdbc::XRow > xValues
1036  = m_pImpl->m_xDataSupplier->queryPropertyValues(
1037  m_pImpl->m_nPos - 1 );
1038  if ( xValues.is() )
1039  {
1040  m_pImpl->m_bWasNull = false;
1041  m_pImpl->m_xDataSupplier->validate();
1042  return xValues->getObject( columnIndex, typeMap );
1043  }
1044  }
1045 
1046  m_pImpl->m_bWasNull = true;
1047  m_pImpl->m_xDataSupplier->validate();
1048  return uno::Any();
1049 }
1050 
1051 
1052 // virtual
1053 uno::Reference< sdbc::XRef > SAL_CALL
1054 ResultSet::getRef( sal_Int32 columnIndex )
1055 {
1056  if ( m_pImpl->m_nPos && !m_pImpl->m_bAfterLast )
1057  {
1058  uno::Reference< sdbc::XRow > xValues
1059  = m_pImpl->m_xDataSupplier->queryPropertyValues(
1060  m_pImpl->m_nPos - 1 );
1061  if ( xValues.is() )
1062  {
1063  m_pImpl->m_bWasNull = false;
1064  m_pImpl->m_xDataSupplier->validate();
1065  return xValues->getRef( columnIndex );
1066  }
1067  }
1068 
1069  m_pImpl->m_bWasNull = true;
1070  m_pImpl->m_xDataSupplier->validate();
1071  return uno::Reference< sdbc::XRef >();
1072 }
1073 
1074 
1075 // virtual
1076 uno::Reference< sdbc::XBlob > SAL_CALL
1077 ResultSet::getBlob( sal_Int32 columnIndex )
1078 {
1079  if ( m_pImpl->m_nPos && !m_pImpl->m_bAfterLast )
1080  {
1081  uno::Reference< sdbc::XRow > xValues
1082  = m_pImpl->m_xDataSupplier->queryPropertyValues(
1083  m_pImpl->m_nPos - 1 );
1084  if ( xValues.is() )
1085  {
1086  m_pImpl->m_bWasNull = false;
1087  m_pImpl->m_xDataSupplier->validate();
1088  return xValues->getBlob( columnIndex );
1089  }
1090  }
1091 
1092  m_pImpl->m_bWasNull = true;
1093  m_pImpl->m_xDataSupplier->validate();
1094  return uno::Reference< sdbc::XBlob >();
1095 }
1096 
1097 
1098 // virtual
1099 uno::Reference< sdbc::XClob > SAL_CALL
1100 ResultSet::getClob( sal_Int32 columnIndex )
1101 {
1102  if ( m_pImpl->m_nPos && !m_pImpl->m_bAfterLast )
1103  {
1104  uno::Reference< sdbc::XRow > xValues
1105  = m_pImpl->m_xDataSupplier->queryPropertyValues(
1106  m_pImpl->m_nPos - 1 );
1107  if ( xValues.is() )
1108  {
1109  m_pImpl->m_bWasNull = false;
1110  m_pImpl->m_xDataSupplier->validate();
1111  return xValues->getClob( columnIndex );
1112  }
1113  }
1114 
1115  m_pImpl->m_bWasNull = true;
1116  m_pImpl->m_xDataSupplier->validate();
1117  return uno::Reference< sdbc::XClob >();
1118 }
1119 
1120 
1121 // virtual
1122 uno::Reference< sdbc::XArray > SAL_CALL
1123 ResultSet::getArray( sal_Int32 columnIndex )
1124 {
1125  if ( m_pImpl->m_nPos && !m_pImpl->m_bAfterLast )
1126  {
1127  uno::Reference< sdbc::XRow > xValues
1128  = m_pImpl->m_xDataSupplier->queryPropertyValues(
1129  m_pImpl->m_nPos - 1 );
1130  if ( xValues.is() )
1131  {
1132  m_pImpl->m_bWasNull = false;
1133  m_pImpl->m_xDataSupplier->validate();
1134  return xValues->getArray( columnIndex );
1135  }
1136  }
1137 
1138  m_pImpl->m_bWasNull = true;
1139  m_pImpl->m_xDataSupplier->validate();
1140  return uno::Reference< sdbc::XArray >();
1141 }
1142 
1143 
1144 // XCloseable methods.
1145 
1146 
1147 // virtual
1148 void SAL_CALL ResultSet::close()
1149 {
1150  m_pImpl->m_xDataSupplier->close();
1151  m_pImpl->m_xDataSupplier->validate();
1152 }
1153 
1154 
1155 // XContentAccess methods.
1156 
1157 
1158 // virtual
1160 {
1161  if ( m_pImpl->m_nPos && !m_pImpl->m_bAfterLast )
1162  return m_pImpl->m_xDataSupplier->queryContentIdentifierString(
1163  m_pImpl->m_nPos - 1 );
1164 
1165  return OUString();
1166 }
1167 
1168 
1169 // virtual
1170 uno::Reference< css::ucb::XContentIdentifier > SAL_CALL
1172 {
1173  if ( m_pImpl->m_nPos && !m_pImpl->m_bAfterLast )
1174  return m_pImpl->m_xDataSupplier->queryContentIdentifier(
1175  m_pImpl->m_nPos - 1 );
1176 
1177  return uno::Reference< css::ucb::XContentIdentifier >();
1178 }
1179 
1180 
1181 // virtual
1182 uno::Reference< css::ucb::XContent > SAL_CALL
1184 {
1185  if ( m_pImpl->m_nPos && !m_pImpl->m_bAfterLast )
1186  return m_pImpl->m_xDataSupplier->queryContent( m_pImpl->m_nPos - 1 );
1187 
1188  return uno::Reference< css::ucb::XContent >();
1189 }
1190 
1191 
1192 // XPropertySet methods.
1193 
1194 
1195 // virtual
1196 uno::Reference< beans::XPropertySetInfo > SAL_CALL
1198 {
1199  osl::MutexGuard aGuard( m_pImpl->m_aMutex );
1200 
1201  if ( !m_pImpl->m_xPropSetInfo.is() )
1202  m_pImpl->m_xPropSetInfo
1203  = new PropertySetInfo( aPropertyTable,
1205  return m_pImpl->m_xPropSetInfo;
1206 }
1207 
1208 
1209 // virtual
1210 void SAL_CALL ResultSet::setPropertyValue( const OUString& aPropertyName,
1211  const uno::Any& )
1212 {
1213  if ( aPropertyName == "RowCount" )
1214  {
1215  // property is read-only.
1216  throw lang::IllegalArgumentException();
1217  }
1218  else if ( aPropertyName == "IsRowCountFinal" )
1219  {
1220  // property is read-only.
1221  throw lang::IllegalArgumentException();
1222  }
1223  else
1224  {
1225  throw beans::UnknownPropertyException(aPropertyName);
1226  }
1227 }
1228 
1229 
1230 // virtual
1232  const OUString& PropertyName )
1233 {
1234  uno::Any aValue;
1235 
1236  if ( PropertyName == "RowCount" )
1237  {
1238  aValue <<= m_pImpl->m_xDataSupplier->currentCount();
1239  }
1240  else if ( PropertyName == "IsRowCountFinal" )
1241  {
1242  aValue <<= m_pImpl->m_xDataSupplier->isCountFinal();
1243  }
1244  else
1245  {
1246  throw beans::UnknownPropertyException(PropertyName);
1247  }
1248 
1249  return aValue;
1250 }
1251 
1252 
1253 // virtual
1255  const OUString& aPropertyName,
1256  const uno::Reference< beans::XPropertyChangeListener >& xListener )
1257 {
1258  // Note: An empty property name means a listener for "all" properties.
1259 
1260  osl::MutexGuard aGuard( m_pImpl->m_aMutex );
1261 
1262  if ( !aPropertyName.isEmpty() &&
1263  aPropertyName != "RowCount" &&
1264  aPropertyName != "IsRowCountFinal" )
1265  throw beans::UnknownPropertyException(aPropertyName);
1266 
1267  if ( !m_pImpl->m_pPropertyChangeListeners )
1268  m_pImpl->m_pPropertyChangeListeners.reset(
1269  new PropertyChangeListeners( m_pImpl->m_aMutex ));
1270 
1271  m_pImpl->m_pPropertyChangeListeners->addInterface(
1272  aPropertyName, xListener );
1273 }
1274 
1275 
1276 // virtual
1278  const OUString& aPropertyName,
1279  const uno::Reference< beans::XPropertyChangeListener >& xListener )
1280 {
1281  osl::MutexGuard aGuard( m_pImpl->m_aMutex );
1282 
1283  if ( !aPropertyName.isEmpty() &&
1284  aPropertyName != "RowCount" &&
1285  aPropertyName != "IsRowCountFinal" )
1286  throw beans::UnknownPropertyException(aPropertyName);
1287 
1288  if ( m_pImpl->m_pPropertyChangeListeners )
1289  m_pImpl->m_pPropertyChangeListeners->removeInterface(
1290  aPropertyName, xListener );
1291 
1292 }
1293 
1294 
1295 // virtual
1297  const OUString&,
1298  const uno::Reference< beans::XVetoableChangeListener >& )
1299 {
1300  // No constrained props, at the moment.
1301 }
1302 
1303 
1304 // virtual
1306  const OUString&,
1307  const uno::Reference< beans::XVetoableChangeListener >& )
1308 {
1309  // No constrained props, at the moment.
1310 }
1311 
1312 
1313 // Non-interface methods.
1314 
1315 
1316 void ResultSet::propertyChanged( const beans::PropertyChangeEvent& rEvt ) const
1317 {
1318  if ( !m_pImpl->m_pPropertyChangeListeners )
1319  return;
1320 
1321  // Notify listeners interested especially in the changed property.
1322  cppu::OInterfaceContainerHelper* pPropsContainer
1323  = m_pImpl->m_pPropertyChangeListeners->getContainer(
1324  rEvt.PropertyName );
1325  if ( pPropsContainer )
1326  {
1327  pPropsContainer->notifyEach(&beans::XPropertyChangeListener::propertyChange, rEvt);
1328  }
1329 
1330  // Notify listeners interested in all properties.
1331  pPropsContainer
1332  = m_pImpl->m_pPropertyChangeListeners->getContainer( OUString() );
1333  if ( pPropsContainer )
1334  {
1335  cppu::OInterfaceIteratorHelper aIter( *pPropsContainer );
1336  while ( aIter.hasMoreElements() )
1337  {
1338  uno::Reference< beans::XPropertyChangeListener > xListener(
1339  aIter.next(), uno::UNO_QUERY );
1340  if ( xListener.is() )
1341  xListener->propertyChange( rEvt );
1342  }
1343  }
1344 }
1345 
1346 
1347 void ResultSet::rowCountChanged( sal_uInt32 nOld, sal_uInt32 nNew )
1348 {
1349  OSL_ENSURE( nOld < nNew, "ResultSet::rowCountChanged - nOld >= nNew!" );
1350 
1351  if ( !m_pImpl->m_pPropertyChangeListeners )
1352  return;
1353 
1354  propertyChanged(
1355  beans::PropertyChangeEvent(
1356  static_cast< cppu::OWeakObject * >( this ),
1357  "RowCount",
1358  false,
1359  1001,
1360  uno::makeAny( nOld ), // old value
1361  uno::makeAny( nNew ) ) ); // new value
1362 }
1363 
1364 
1365 void ResultSet::rowCountFinal()
1366 {
1367  if ( !m_pImpl->m_pPropertyChangeListeners )
1368  return;
1369 
1370  propertyChanged(
1371  beans::PropertyChangeEvent(
1372  static_cast< cppu::OWeakObject * >( this ),
1373  "IsRowCountFinal",
1374  false,
1375  1000,
1376  uno:: makeAny( false ), // old value
1377  uno::makeAny( true ) ) ); // new value
1378 }
1379 
1380 
1381 const uno::Sequence< beans::Property >& ResultSet::getProperties() const
1382 {
1383  return m_pImpl->m_aProperties;
1384 }
1385 
1386 
1387 const uno::Reference< css::ucb::XCommandEnvironment >&
1388 ResultSet::getEnvironment() const
1389 {
1390  return m_pImpl->m_xEnv;
1391 }
1392 
1393 } // namespace ucbhelper
1394 
1395 namespace ucbhelper_impl {
1396 
1397 
1398 // PropertySetInfo Implementation.
1399 
1400 
1401 PropertySetInfo::PropertySetInfo(
1402  const PropertyInfo* pProps,
1403  sal_Int32 nProps )
1404  : m_pProps( new uno::Sequence< beans::Property >( nProps ) )
1405 {
1406 
1407  if ( !nProps )
1408  return;
1409 
1410  const PropertyInfo* pEntry = pProps;
1411  beans::Property* pProperties = m_pProps->getArray();
1412 
1413  for ( sal_Int32 n = 0; n < nProps; ++n )
1414  {
1415  beans::Property& rProp = pProperties[ n ];
1416 
1417  rProp.Name = OUString::createFromAscii( pEntry->pName );
1418  rProp.Handle = pEntry->nHandle;
1419  rProp.Type = pEntry->pGetCppuType();
1420  rProp.Attributes = pEntry->nAttributes;
1421 
1422  pEntry++;
1423  }
1424 }
1425 
1426 
1427 
1428 // XInterface methods.
1429 void SAL_CALL PropertySetInfo::acquire()
1430  throw()
1431 {
1432  OWeakObject::acquire();
1433 }
1434 
1435 void SAL_CALL PropertySetInfo::release()
1436  throw()
1437 {
1438  OWeakObject::release();
1439 }
1440 
1441 css::uno::Any SAL_CALL PropertySetInfo::queryInterface(
1442  const css::uno::Type & rType )
1443 {
1444  css::uno::Any aRet = cppu::queryInterface( rType,
1445  static_cast< lang::XTypeProvider* >(this),
1446  static_cast< beans::XPropertySetInfo* >(this)
1447  );
1448  return aRet.hasValue() ? aRet : OWeakObject::queryInterface( rType );
1449 }
1450 
1451 // XTypeProvider methods.
1452 
1453 
1454 XTYPEPROVIDER_IMPL_2( PropertySetInfo,
1455  lang::XTypeProvider,
1456  beans::XPropertySetInfo );
1457 
1458 
1459 // XPropertySetInfo methods.
1460 
1461 
1462 // virtual
1463 uno::Sequence< beans::Property > SAL_CALL PropertySetInfo::getProperties()
1464 {
1465  return *m_pProps;
1466 }
1467 
1468 
1469 // virtual
1470 beans::Property SAL_CALL PropertySetInfo::getPropertyByName(
1471  const OUString& aName )
1472 {
1473  beans::Property aProp;
1474  if ( queryProperty( aName, aProp ) )
1475  return aProp;
1476 
1477  throw beans::UnknownPropertyException(aName);
1478 }
1479 
1480 
1481 // virtual
1482 sal_Bool SAL_CALL PropertySetInfo::hasPropertyByName(
1483  const OUString& Name )
1484 {
1485  beans::Property aProp;
1486  return queryProperty( Name, aProp );
1487 }
1488 
1489 
1490 bool PropertySetInfo::queryProperty(
1491  const OUString& aName, beans::Property& rProp ) const
1492 {
1493  sal_Int32 nCount = m_pProps->getLength();
1494  const beans::Property* pProps = m_pProps->getConstArray();
1495  for ( sal_Int32 n = 0; n < nCount; ++n )
1496  {
1497  const beans::Property& rCurr = pProps[ n ];
1498  if ( rCurr.Name == aName )
1499  {
1500  rProp = rCurr;
1501  return true;
1502  }
1503  }
1504 
1505  return false;
1506 }
1507 
1508 } // namespace ucbhelper_impl
1509 
1510 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
Type
virtual sal_Bool SAL_CALL rowUpdated() override
Definition: resultset.cxx:654
virtual void SAL_CALL addPropertyChangeListener(const OUString &aPropertyName, const css::uno::Reference< css::beans::XPropertyChangeListener > &xListener) override
Definition: resultset.cxx:1254
#define RESULTSET_PROPERTY_COUNT
Definition: resultset.cxx:82
virtual css::uno::Any SAL_CALL getPropertyValue(const OUString &PropertyName) override
Definition: resultset.cxx:1231
#define RESULTSET_SERVICE_NAME
Definition: resultset.hxx:44
virtual css::uno::Sequence< sal_Int8 > SAL_CALL getBytes(sal_Int32 columnIndex) override
Definition: resultset.cxx:894
virtual sal_Int32 SAL_CALL getRow() override
Definition: resultset.cxx:458
signed char sal_Int8
virtual sal_Int8 SAL_CALL getByte(sal_Int32 columnIndex) override
Definition: resultset.cxx:761
virtual sal_Bool SAL_CALL isAfterLast() override
Definition: resultset.cxx:360
std::unique_ptr< ResultSet_Impl > m_pImpl
Definition: resultset.hxx:70
cppu::OMultiTypeInterfaceContainerHelperVar< OUString > PropertyChangeListeners
virtual sal_Bool SAL_CALL first() override
Definition: resultset.cxx:422
std::unique_ptr< uno::Sequence< beans::Property > > m_pProps
Definition: resultset.cxx:93
static const uno::Type & sal_Bool_getCppuType()
Definition: resultset.cxx:58
uno::Reference< sdbc::XResultSetMetaData > m_xMetaData
Definition: resultset.cxx:154
virtual css::uno::Reference< css::sdbc::XArray > SAL_CALL getArray(sal_Int32 columnIndex) override
Definition: resultset.cxx:1123
virtual sal_Bool SAL_CALL rowDeleted() override
Definition: resultset.cxx:670
Reference
virtual sal_Int32 SAL_CALL getInt(sal_Int32 columnIndex) override
Definition: resultset.cxx:805
virtual sal_Bool SAL_CALL supportsService(const OUString &ServiceName) override
Definition: resultset.cxx:228
virtual sal_Bool SAL_CALL next() override
Definition: resultset.cxx:311
virtual void SAL_CALL removePropertyChangeListener(const OUString &aPropertyName, const css::uno::Reference< css::beans::XPropertyChangeListener > &aListener) override
Definition: resultset.cxx:1277
virtual sal_Bool SAL_CALL wasNull() override
Definition: resultset.cxx:693
css::uno::XInterface *SAL_CALL next()
virtual OUString SAL_CALL getString(sal_Int32 columnIndex) override
Definition: resultset.cxx:717
virtual sal_Bool SAL_CALL isLast() override
Definition: resultset.cxx:382
static const uno::Type & sal_Int32_getCppuType()
Definition: resultset.cxx:53
virtual css::uno::Reference< css::sdbc::XClob > SAL_CALL getClob(sal_Int32 columnIndex) override
Definition: resultset.cxx:1100
int nCount
bool CPPUHELPER_DLLPUBLIC supportsService(css::lang::XServiceInfo *implementation, rtl::OUString const &name)
virtual sal_Bool SAL_CALL previous() override
Definition: resultset.cxx:613
virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() override
Definition: resultset.cxx:233
virtual void SAL_CALL beforeFirst() override
Definition: resultset.cxx:403
sal_Int32 nHandle
Definition: resultset.cxx:46
virtual sal_Bool SAL_CALL relative(sal_Int32 rows) override
Definition: resultset.cxx:544
virtual sal_Bool SAL_CALL last() override
Definition: resultset.cxx:440
virtual void SAL_CALL removeVetoableChangeListener(const OUString &PropertyName, const css::uno::Reference< css::beans::XVetoableChangeListener > &aListener) override
Definition: resultset.cxx:1305
virtual css::uno::Reference< css::beans::XPropertySetInfo > SAL_CALL getPropertySetInfo() override
Definition: resultset.cxx:1197
void rowCountChanged(sal_uInt32 nOld, sal_uInt32 nNew)
This method should be called by the data supplier for the result set to indicate that there were new ...
Definition: resultset.cxx:1347
rtl::Reference< ResultSetDataSupplier > m_xDataSupplier
Definition: resultset.cxx:156
virtual css::uno::Any SAL_CALL getObject(sal_Int32 columnIndex, const css::uno::Reference< css::container::XNameAccess > &typeMap) override
Definition: resultset.cxx:1029
This class provides a propertyset info ( the complete implementation of the interface XPropertySetInf...
Definition: contentinfo.hxx:46
virtual double SAL_CALL getDouble(sal_Int32 columnIndex) override
Definition: resultset.cxx:871
uno::Reference< beans::XPropertySetInfo > m_xPropSetInfo
Definition: resultset.cxx:153
virtual void SAL_CALL setPropertyValue(const OUString &aPropertyName, const css::uno::Any &aValue) override
Definition: resultset.cxx:1210
sal_Int16 nAttributes
Definition: resultset.cxx:47
unsigned char sal_Bool
virtual OUString SAL_CALL queryContentIdentifierString() override
Definition: resultset.cxx:1159
virtual css::util::Date SAL_CALL getDate(sal_Int32 columnIndex) override
Definition: resultset.cxx:916
css::uno::Type const & get()
cppu::OMultiTypeInterfaceContainerHelperVar< OUString > PropertyChangeListenerContainer
Definition: resultset.cxx:125
void propertyChanged(const css::beans::PropertyChangeEvent &rEvt) const
This method propagates property value changes to all registered listeners.
Definition: resultset.cxx:1316
virtual css::uno::Reference< css::ucb::XContentIdentifier > SAL_CALL queryContentIdentifier() override
Definition: resultset.cxx:1171
virtual sal_Bool SAL_CALL rowInserted() override
Definition: resultset.cxx:662
const PropertyInfo aPropertyTable[]
Definition: resultset.cxx:63
const char * pName
Definition: resultset.cxx:45
virtual sal_Int64 SAL_CALL getLong(sal_Int32 columnIndex) override
Definition: resultset.cxx:827
virtual sal_Bool SAL_CALL getBoolean(sal_Int32 columnIndex) override
Definition: resultset.cxx:739
std::unique_ptr< cppu::OInterfaceContainerHelper > m_pDisposeEventListeners
Definition: resultset.cxx:158
uno::Reference< uno::XComponentContext > m_xContext
Definition: resultset.cxx:151
virtual sal_Bool SAL_CALL isFirst() override
Definition: resultset.cxx:368
virtual css::uno::Reference< css::uno::XInterface > SAL_CALL getStatement() override
Definition: resultset.cxx:678
virtual void SAL_CALL refreshRow() override
Definition: resultset.cxx:642
virtual void SAL_CALL addEventListener(const css::uno::Reference< css::lang::XEventListener > &Listener) override
Definition: resultset.cxx:267
virtual void SAL_CALL addVetoableChangeListener(const OUString &PropertyName, const css::uno::Reference< css::beans::XVetoableChangeListener > &aListener) override
Definition: resultset.cxx:1296
virtual void SAL_CALL dispose() override
Definition: resultset.cxx:243
virtual ~ResultSet() override
Definition: resultset.cxx:216
This is an implementation of the interface XResultSetMetaData.
virtual void SAL_CALL afterLast() override
Definition: resultset.cxx:413
uno::Sequence< beans::Property > m_aProperties
Definition: resultset.cxx:155
virtual css::uno::Reference< css::sdbc::XBlob > SAL_CALL getBlob(sal_Int32 columnIndex) override
Definition: resultset.cxx:1077
std::unique_ptr< PropertyChangeListeners > m_pPropertyChangeListeners
Definition: resultset.cxx:159
virtual float SAL_CALL getFloat(sal_Int32 columnIndex) override
Definition: resultset.cxx:849
virtual void SAL_CALL close() override
Definition: resultset.cxx:1148
virtual OUString SAL_CALL getImplementationName() override
Definition: resultset.cxx:223
virtual void SAL_CALL removeEventListener(const css::uno::Reference< css::lang::XEventListener > &Listener) override
Definition: resultset.cxx:281
virtual sal_Bool SAL_CALL absolute(sal_Int32 row) override
Definition: resultset.cxx:472
uno::Reference< css::ucb::XCommandEnvironment > m_xEnv
Definition: resultset.cxx:152
virtual css::util::Time SAL_CALL getTime(sal_Int32 columnIndex) override
Definition: resultset.cxx:938
void notifyEach(void(SAL_CALL ListenerT::*NotificationMethod)(const EventT &), const EventT &Event)
ResultSet(const css::uno::Reference< css::uno::XComponentContext > &rxContext, const css::uno::Sequence< css::beans::Property > &rProperties, const rtl::Reference< ResultSetDataSupplier > &rDataSupplier)
Construction.
sal_uInt32 m_nPos
virtual css::uno::Reference< css::io::XInputStream > SAL_CALL getCharacterStream(sal_Int32 columnIndex) override
Definition: resultset.cxx:1007
Reference< XComponentContext > m_xContext
virtual css::uno::Reference< css::ucb::XContent > SAL_CALL queryContent() override
Definition: resultset.cxx:1183
::std::unique_ptr< XmlIdRegistry_Impl > m_pImpl
virtual css::uno::Reference< css::io::XInputStream > SAL_CALL getBinaryStream(sal_Int32 columnIndex) override
Definition: resultset.cxx:984
virtual sal_Bool SAL_CALL isBeforeFirst() override
Definition: resultset.cxx:339
virtual css::uno::Reference< css::sdbc::XResultSetMetaData > SAL_CALL getMetaData() override
Definition: resultset.cxx:295
virtual css::util::DateTime SAL_CALL getTimestamp(sal_Int32 columnIndex) override
Definition: resultset.cxx:961
virtual css::uno::Reference< css::sdbc::XRef > SAL_CALL getRef(sal_Int32 columnIndex) override
Definition: resultset.cxx:1054
css::uno::Any SAL_CALL queryInterface(const css::uno::Type &rType, Interface1 *p1)
virtual sal_Int16 SAL_CALL getShort(sal_Int32 columnIndex) override
Definition: resultset.cxx:783
bool SAL_CALL hasMoreElements() const