cid#1607171 Data race condition
[LibreOffice.git] / odk / examples / DevelopersGuide / Database / DriverSkeleton / SResultSet.cxx
blob1e85337289f2f072ae632819065ec373c8e58408
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*************************************************************************
4 * The Contents of this file are made available subject to the terms of
5 * the BSD license.
7 * Copyright 2000, 2010 Oracle and/or its affiliates.
8 * All rights reserved.
10 * Redistribution and use in source and binary forms, with or without
11 * modification, are permitted provided that the following conditions
12 * are met:
13 * 1. Redistributions of source code must retain the above copyright
14 * notice, this list of conditions and the following disclaimer.
15 * 2. Redistributions in binary form must reproduce the above copyright
16 * notice, this list of conditions and the following disclaimer in the
17 * documentation and/or other materials provided with the distribution.
18 * 3. Neither the name of Sun Microsystems, Inc. nor the names of its
19 * contributors may be used to endorse or promote products derived
20 * from this software without specific prior written permission.
22 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
23 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
24 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
25 * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
26 * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
27 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
28 * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
29 * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
30 * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR
31 * TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE
32 * USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
34 *************************************************************************/
36 #include "SResultSet.hxx"
37 #include "SResultSetMetaData.hxx"
38 #include <com/sun/star/sdbc/DataType.hpp>
39 #include <com/sun/star/beans/PropertyAttribute.hpp>
40 #include <com/sun/star/sdbcx/CompareBookmark.hpp>
41 #include <cppuhelper/typeprovider.hxx>
42 #include <cppuhelper/supportsservice.hxx>
43 #include <com/sun/star/lang/DisposedException.hpp>
44 #include "propertyids.hxx"
46 using namespace connectivity::skeleton;
47 using namespace cppu;
48 using namespace com::sun::star::uno;
49 using namespace com::sun::star::lang;
50 using namespace com::sun::star::beans;
51 using namespace com::sun::star::sdbc;
52 using namespace com::sun::star::sdbcx;
53 using namespace com::sun::star::container;
54 using namespace com::sun::star::io;
55 using namespace com::sun::star::util;
57 // IMPLEMENT_SERVICE_INFO(OResultSet,"com.sun.star.sdbcx.OResultSet","com.sun.star.sdbc.ResultSet");
58 ::rtl::OUString SAL_CALL OResultSet::getImplementationName( )
60 return ::rtl::OUString("com.sun.star.sdbcx.skeleton.ResultSet");
63 Sequence< ::rtl::OUString > SAL_CALL OResultSet::getSupportedServiceNames( )
65 Sequence< ::rtl::OUString > aSupported(2);
66 aSupported[0] = ::rtl::OUString("com.sun.star.sdbc.ResultSet");
67 aSupported[1] = ::rtl::OUString("com.sun.star.sdbcx.ResultSet");
68 return aSupported;
71 sal_Bool SAL_CALL OResultSet::supportsService( const ::rtl::OUString& _rServiceName )
73 return cppu::supportsService(this, _rServiceName);
76 OResultSet::OResultSet(OStatement_Base* pStmt)
77 : OResultSet_BASE(m_aMutex)
78 ,OPropertySetHelper(OResultSet_BASE::rBHelper)
79 ,m_aStatement((OWeakObject*)pStmt)
80 ,m_xMetaData(NULL)
81 ,m_nTextEncoding(pStmt->getOwnConnection()->getTextEncoding())
82 ,m_pStatement(pStmt)
83 ,m_bWasNull(sal_True)
87 OResultSet::~OResultSet()
91 void OResultSet::disposing()
93 OPropertySetHelper::disposing();
95 ::osl::MutexGuard aGuard(m_aMutex);
97 m_aStatement = NULL;
98 m_xMetaData = NULL;
101 Any SAL_CALL OResultSet::queryInterface( const Type & rType )
103 Any aRet = OPropertySetHelper::queryInterface(rType);
104 if(!aRet.hasValue())
105 aRet = OResultSet_BASE::queryInterface(rType);
106 return aRet;
109 Sequence< Type > SAL_CALL OResultSet::getTypes( )
111 OTypeCollection aTypes(
112 ::cppu::UnoType<css::beans::XMultiPropertySet>::get(),
113 ::cppu::UnoType<css::beans::XFastPropertySet>::get(),
114 ::cppu::UnoType<css::beans::XPropertySet>::get());
116 return concatSequences(aTypes.getTypes(),OResultSet_BASE::getTypes());
120 sal_Int32 SAL_CALL OResultSet::findColumn( const ::rtl::OUString& columnName )
123 checkDisposed(OResultSet_BASE::rBHelper.bDisposed);
125 // find the first column with the name columnName
127 ::osl::MutexGuard aGuard( m_aMutex );
129 Reference< XResultSetMetaData > xMeta = getMetaData();
130 sal_Int32 nLen = xMeta->getColumnCount();
131 sal_Int32 i = 1;
132 for(;i<=nLen;++i)
133 if(xMeta->isCaseSensitive(i) ? columnName == xMeta->getColumnName(i) :
134 columnName.equalsIgnoreAsciiCase(xMeta->getColumnName(i)))
135 break;
136 return i;
139 Reference< XInputStream > SAL_CALL OResultSet::getBinaryStream( sal_Int32 columnIndex )
141 ::osl::MutexGuard aGuard( m_aMutex );
142 checkDisposed(OResultSet_BASE::rBHelper.bDisposed);
145 return NULL;
148 Reference< XInputStream > SAL_CALL OResultSet::getCharacterStream( sal_Int32 columnIndex )
150 ::osl::MutexGuard aGuard( m_aMutex );
151 checkDisposed(OResultSet_BASE::rBHelper.bDisposed);
154 return NULL;
158 sal_Bool SAL_CALL OResultSet::getBoolean( sal_Int32 columnIndex )
160 ::osl::MutexGuard aGuard( m_aMutex );
161 checkDisposed(OResultSet_BASE::rBHelper.bDisposed);
163 return sal_False;
167 sal_Int8 SAL_CALL OResultSet::getByte( sal_Int32 columnIndex )
169 ::osl::MutexGuard aGuard( m_aMutex );
170 checkDisposed(OResultSet_BASE::rBHelper.bDisposed);
173 sal_Int8 nRet = 0;
174 return nRet;
178 Sequence< sal_Int8 > SAL_CALL OResultSet::getBytes( sal_Int32 columnIndex )
181 checkDisposed(OResultSet_BASE::rBHelper.bDisposed);
182 ::osl::MutexGuard aGuard( m_aMutex );
184 return Sequence< sal_Int8 >();
188 Date SAL_CALL OResultSet::getDate( sal_Int32 columnIndex )
190 ::osl::MutexGuard aGuard( m_aMutex );
191 checkDisposed(OResultSet_BASE::rBHelper.bDisposed);
194 Date nRet;
195 return nRet;
199 double SAL_CALL OResultSet::getDouble( sal_Int32 columnIndex )
201 ::osl::MutexGuard aGuard( m_aMutex );
202 checkDisposed(OResultSet_BASE::rBHelper.bDisposed);
205 double nRet = 0;
206 return nRet;
210 float SAL_CALL OResultSet::getFloat( sal_Int32 columnIndex )
212 ::osl::MutexGuard aGuard( m_aMutex );
213 checkDisposed(OResultSet_BASE::rBHelper.bDisposed);
216 float nVal(0);
217 return nVal;
221 sal_Int32 SAL_CALL OResultSet::getInt( sal_Int32 columnIndex )
223 ::osl::MutexGuard aGuard( m_aMutex );
224 checkDisposed(OResultSet_BASE::rBHelper.bDisposed);
226 sal_Int32 nRet=0;
227 return nRet;
231 sal_Int32 SAL_CALL OResultSet::getRow( )
233 ::osl::MutexGuard aGuard( m_aMutex );
234 checkDisposed(OResultSet_BASE::rBHelper.bDisposed);
236 sal_Int32 nValue = 0;
237 return nValue;
241 sal_Int64 SAL_CALL OResultSet::getLong( sal_Int32 columnIndex )
243 ::osl::MutexGuard aGuard( m_aMutex );
244 checkDisposed(OResultSet_BASE::rBHelper.bDisposed);
246 return sal_Int64();
250 Reference< XResultSetMetaData > SAL_CALL OResultSet::getMetaData( )
252 ::osl::MutexGuard aGuard( m_aMutex );
253 checkDisposed(OResultSet_BASE::rBHelper.bDisposed);
256 if(!m_xMetaData.is())
257 m_xMetaData = new OResultSetMetaData(m_pStatement->getOwnConnection());
258 return m_xMetaData;
261 Reference< XArray > SAL_CALL OResultSet::getArray( sal_Int32 columnIndex )
263 ::osl::MutexGuard aGuard( m_aMutex );
264 checkDisposed(OResultSet_BASE::rBHelper.bDisposed);
266 return NULL;
270 Reference< XClob > SAL_CALL OResultSet::getClob( sal_Int32 columnIndex )
272 ::osl::MutexGuard aGuard( m_aMutex );
273 checkDisposed(OResultSet_BASE::rBHelper.bDisposed);
275 return NULL;
278 Reference< XBlob > SAL_CALL OResultSet::getBlob( sal_Int32 columnIndex )
280 ::osl::MutexGuard aGuard( m_aMutex );
281 checkDisposed(OResultSet_BASE::rBHelper.bDisposed);
283 return NULL;
287 Reference< XRef > SAL_CALL OResultSet::getRef( sal_Int32 columnIndex )
289 ::osl::MutexGuard aGuard( m_aMutex );
290 checkDisposed(OResultSet_BASE::rBHelper.bDisposed);
292 return NULL;
296 Any SAL_CALL OResultSet::getObject( sal_Int32 columnIndex, const Reference< ::com::sun::star::container::XNameAccess >& typeMap )
298 ::osl::MutexGuard aGuard( m_aMutex );
299 checkDisposed(OResultSet_BASE::rBHelper.bDisposed);
301 return Any();
305 sal_Int16 SAL_CALL OResultSet::getShort( sal_Int32 columnIndex )
307 ::osl::MutexGuard aGuard( m_aMutex );
308 checkDisposed(OResultSet_BASE::rBHelper.bDisposed);
311 sal_Int16 nRet=0;
312 return nRet;
316 ::rtl::OUString SAL_CALL OResultSet::getString( sal_Int32 columnIndex )
318 ::osl::MutexGuard aGuard( m_aMutex );
319 checkDisposed(OResultSet_BASE::rBHelper.bDisposed);
322 ::rtl::OUString nRet;
323 return nRet;
327 css::util::Time SAL_CALL OResultSet::getTime( sal_Int32 columnIndex )
329 checkDisposed(OResultSet_BASE::rBHelper.bDisposed);
331 ::osl::MutexGuard aGuard( m_aMutex );
333 css::util::Time nRet;
334 return nRet;
338 DateTime SAL_CALL OResultSet::getTimestamp( sal_Int32 columnIndex )
340 checkDisposed(OResultSet_BASE::rBHelper.bDisposed);
343 ::osl::MutexGuard aGuard( m_aMutex );
345 DateTime nRet;
346 return nRet;
350 sal_Bool SAL_CALL OResultSet::isBeforeFirst( )
352 ::osl::MutexGuard aGuard( m_aMutex );
353 checkDisposed(OResultSet_BASE::rBHelper.bDisposed);
356 // here you have to implement your movements
357 // return true means there is no data
358 return sal_True;
361 sal_Bool SAL_CALL OResultSet::isAfterLast( )
363 ::osl::MutexGuard aGuard( m_aMutex );
364 checkDisposed(OResultSet_BASE::rBHelper.bDisposed);
366 return sal_True;
369 sal_Bool SAL_CALL OResultSet::isFirst( )
371 ::osl::MutexGuard aGuard( m_aMutex );
372 checkDisposed(OResultSet_BASE::rBHelper.bDisposed);
375 return sal_False;
378 sal_Bool SAL_CALL OResultSet::isLast( )
380 ::osl::MutexGuard aGuard( m_aMutex );
381 checkDisposed(OResultSet_BASE::rBHelper.bDisposed);
384 return sal_False;
387 void SAL_CALL OResultSet::beforeFirst( )
389 ::osl::MutexGuard aGuard( m_aMutex );
390 checkDisposed(OResultSet_BASE::rBHelper.bDisposed);
392 // move before the first row so that isBeforeFirst returns false
393 // the same for other movement methods
396 void SAL_CALL OResultSet::afterLast( )
398 ::osl::MutexGuard aGuard( m_aMutex );
399 checkDisposed(OResultSet_BASE::rBHelper.bDisposed);
403 void SAL_CALL OResultSet::close( )
406 ::osl::MutexGuard aGuard( m_aMutex );
407 checkDisposed(OResultSet_BASE::rBHelper.bDisposed);
410 dispose();
414 sal_Bool SAL_CALL OResultSet::first( )
416 ::osl::MutexGuard aGuard( m_aMutex );
417 checkDisposed(OResultSet_BASE::rBHelper.bDisposed);
419 return sal_False;
423 sal_Bool SAL_CALL OResultSet::last( )
425 ::osl::MutexGuard aGuard( m_aMutex );
426 checkDisposed(OResultSet_BASE::rBHelper.bDisposed);
428 return sal_False;
431 sal_Bool SAL_CALL OResultSet::absolute( sal_Int32 row )
433 ::osl::MutexGuard aGuard( m_aMutex );
434 checkDisposed(OResultSet_BASE::rBHelper.bDisposed);
436 return sal_False;
439 sal_Bool SAL_CALL OResultSet::relative( sal_Int32 row )
441 ::osl::MutexGuard aGuard( m_aMutex );
442 checkDisposed(OResultSet_BASE::rBHelper.bDisposed);
444 return sal_False;
447 sal_Bool SAL_CALL OResultSet::previous( )
449 ::osl::MutexGuard aGuard( m_aMutex );
450 checkDisposed(OResultSet_BASE::rBHelper.bDisposed);
452 return sal_False;
455 Reference< XInterface > SAL_CALL OResultSet::getStatement( )
457 ::osl::MutexGuard aGuard( m_aMutex );
458 checkDisposed(OResultSet_BASE::rBHelper.bDisposed);
461 return m_aStatement.get();
465 sal_Bool SAL_CALL OResultSet::rowDeleted( )
467 ::osl::MutexGuard aGuard( m_aMutex );
468 checkDisposed(OResultSet_BASE::rBHelper.bDisposed);
471 return sal_False;
474 sal_Bool SAL_CALL OResultSet::rowInserted( )
476 ::osl::MutexGuard aGuard( m_aMutex );
477 checkDisposed(OResultSet_BASE::rBHelper.bDisposed);
480 return sal_False;
483 sal_Bool SAL_CALL OResultSet::rowUpdated( )
485 ::osl::MutexGuard aGuard( m_aMutex );
486 checkDisposed(OResultSet_BASE::rBHelper.bDisposed);
489 return sal_False;
493 sal_Bool SAL_CALL OResultSet::next( )
495 ::osl::MutexGuard aGuard( m_aMutex );
496 checkDisposed(OResultSet_BASE::rBHelper.bDisposed);
499 return sal_False;
503 sal_Bool SAL_CALL OResultSet::wasNull( )
505 ::osl::MutexGuard aGuard( m_aMutex );
506 checkDisposed(OResultSet_BASE::rBHelper.bDisposed);
509 return m_bWasNull;
513 void SAL_CALL OResultSet::cancel( )
515 ::osl::MutexGuard aGuard( m_aMutex );
516 checkDisposed(OResultSet_BASE::rBHelper.bDisposed);
520 void SAL_CALL OResultSet::clearWarnings( )
524 Any SAL_CALL OResultSet::getWarnings( )
526 return Any();
529 void SAL_CALL OResultSet::insertRow( )
531 ::osl::MutexGuard aGuard( m_aMutex );
532 checkDisposed(OResultSet_BASE::rBHelper.bDisposed);
534 // you only have to implement this if you want to insert new rows
537 void SAL_CALL OResultSet::updateRow( )
539 ::osl::MutexGuard aGuard( m_aMutex );
540 checkDisposed(OResultSet_BASE::rBHelper.bDisposed);
543 // only when you allow updates
546 void SAL_CALL OResultSet::deleteRow( )
548 ::osl::MutexGuard aGuard( m_aMutex );
549 checkDisposed(OResultSet_BASE::rBHelper.bDisposed);
553 void SAL_CALL OResultSet::cancelRowUpdates( )
555 ::osl::MutexGuard aGuard( m_aMutex );
556 checkDisposed(OResultSet_BASE::rBHelper.bDisposed);
560 void SAL_CALL OResultSet::moveToInsertRow( )
562 ::osl::MutexGuard aGuard( m_aMutex );
563 checkDisposed(OResultSet_BASE::rBHelper.bDisposed);
566 // only when you allow insert's
570 void SAL_CALL OResultSet::moveToCurrentRow( )
572 ::osl::MutexGuard aGuard( m_aMutex );
573 checkDisposed(OResultSet_BASE::rBHelper.bDisposed);
577 void SAL_CALL OResultSet::updateNull( sal_Int32 columnIndex )
579 ::osl::MutexGuard aGuard( m_aMutex );
580 checkDisposed(OResultSet_BASE::rBHelper.bDisposed);
584 void SAL_CALL OResultSet::updateBoolean( sal_Int32 columnIndex, sal_Bool x )
586 ::osl::MutexGuard aGuard( m_aMutex );
587 checkDisposed(OResultSet_BASE::rBHelper.bDisposed);
591 void SAL_CALL OResultSet::updateByte( sal_Int32 columnIndex, sal_Int8 x )
593 checkDisposed(OResultSet_BASE::rBHelper.bDisposed);
594 ::osl::MutexGuard aGuard( m_aMutex );
599 void SAL_CALL OResultSet::updateShort( sal_Int32 columnIndex, sal_Int16 x )
601 ::osl::MutexGuard aGuard( m_aMutex );
602 checkDisposed(OResultSet_BASE::rBHelper.bDisposed);
606 void SAL_CALL OResultSet::updateInt( sal_Int32 columnIndex, sal_Int32 x )
608 checkDisposed(OResultSet_BASE::rBHelper.bDisposed);
609 ::osl::MutexGuard aGuard( m_aMutex );
613 void SAL_CALL OResultSet::updateLong( sal_Int32 columnIndex, sal_Int64 x )
615 ::osl::MutexGuard aGuard( m_aMutex );
616 checkDisposed(OResultSet_BASE::rBHelper.bDisposed);
620 void SAL_CALL OResultSet::updateFloat( sal_Int32 columnIndex, float x )
622 ::osl::MutexGuard aGuard( m_aMutex );
623 checkDisposed(OResultSet_BASE::rBHelper.bDisposed);
628 void SAL_CALL OResultSet::updateDouble( sal_Int32 columnIndex, double x )
630 ::osl::MutexGuard aGuard( m_aMutex );
631 checkDisposed(OResultSet_BASE::rBHelper.bDisposed);
635 void SAL_CALL OResultSet::updateString( sal_Int32 columnIndex, const ::rtl::OUString& x )
637 ::osl::MutexGuard aGuard( m_aMutex );
638 checkDisposed(OResultSet_BASE::rBHelper.bDisposed);
642 void SAL_CALL OResultSet::updateBytes( sal_Int32 columnIndex, const Sequence< sal_Int8 >& x )
644 ::osl::MutexGuard aGuard( m_aMutex );
645 checkDisposed(OResultSet_BASE::rBHelper.bDisposed);
649 void SAL_CALL OResultSet::updateDate( sal_Int32 columnIndex, const Date& x )
651 ::osl::MutexGuard aGuard( m_aMutex );
652 checkDisposed(OResultSet_BASE::rBHelper.bDisposed);
657 void SAL_CALL OResultSet::updateTime( sal_Int32 columnIndex, const css::util::Time& x )
659 ::osl::MutexGuard aGuard( m_aMutex );
660 checkDisposed(OResultSet_BASE::rBHelper.bDisposed);
665 void SAL_CALL OResultSet::updateTimestamp( sal_Int32 columnIndex, const DateTime& x )
667 ::osl::MutexGuard aGuard( m_aMutex );
668 checkDisposed(OResultSet_BASE::rBHelper.bDisposed);
673 void SAL_CALL OResultSet::updateBinaryStream( sal_Int32 columnIndex, const Reference< XInputStream >& x, sal_Int32 length )
675 ::osl::MutexGuard aGuard( m_aMutex );
676 checkDisposed(OResultSet_BASE::rBHelper.bDisposed);
680 void SAL_CALL OResultSet::updateCharacterStream( sal_Int32 columnIndex, const Reference< XInputStream >& x, sal_Int32 length )
682 ::osl::MutexGuard aGuard( m_aMutex );
683 checkDisposed(OResultSet_BASE::rBHelper.bDisposed);
687 void SAL_CALL OResultSet::refreshRow( )
689 ::osl::MutexGuard aGuard( m_aMutex );
690 checkDisposed(OResultSet_BASE::rBHelper.bDisposed);
694 void SAL_CALL OResultSet::updateObject( sal_Int32 columnIndex, const Any& x )
696 ::osl::MutexGuard aGuard( m_aMutex );
697 checkDisposed(OResultSet_BASE::rBHelper.bDisposed);
702 void SAL_CALL OResultSet::updateNumericObject( sal_Int32 columnIndex, const Any& x, sal_Int32 scale )
704 ::osl::MutexGuard aGuard( m_aMutex );
705 checkDisposed(OResultSet_BASE::rBHelper.bDisposed);
709 // XRowLocate
710 Any SAL_CALL OResultSet::getBookmark( )
712 ::osl::MutexGuard aGuard( m_aMutex );
713 checkDisposed(OResultSet_BASE::rBHelper.bDisposed);
715 // if you don't want to support bookmark you must remove the XRowLocate interface
717 return Any();
720 sal_Bool SAL_CALL OResultSet::moveToBookmark( const Any& bookmark )
722 ::osl::MutexGuard aGuard( m_aMutex );
723 checkDisposed(OResultSet_BASE::rBHelper.bDisposed);
725 return sal_False;
728 sal_Bool SAL_CALL OResultSet::moveRelativeToBookmark( const Any& bookmark, sal_Int32 rows )
730 ::osl::MutexGuard aGuard( m_aMutex );
731 checkDisposed(OResultSet_BASE::rBHelper.bDisposed);
733 return sal_False;
736 sal_Int32 SAL_CALL OResultSet::compareBookmarks( const Any& first, const Any& second )
738 ::osl::MutexGuard aGuard( m_aMutex );
739 checkDisposed(OResultSet_BASE::rBHelper.bDisposed);
742 return CompareBookmark::NOT_EQUAL;
745 sal_Bool SAL_CALL OResultSet::hasOrderedBookmarks( )
747 return sal_False;
750 sal_Int32 SAL_CALL OResultSet::hashBookmark( const Any& bookmark )
752 throw SQLException();
755 // XDeleteRows
756 Sequence< sal_Int32 > SAL_CALL OResultSet::deleteRows( const Sequence< Any >& rows )
758 ::osl::MutexGuard aGuard( m_aMutex );
759 checkDisposed(OResultSet_BASE::rBHelper.bDisposed);
761 return Sequence< sal_Int32 >();
764 IPropertyArrayHelper* OResultSet::createArrayHelper( ) const
766 Sequence< Property > aProps(6);
767 Property* pProperties = aProps.getArray();
768 sal_Int32 nPos = 0;
769 pProperties[nPos++] = ::com::sun::star::beans::Property(OPropertyMap::getPropMap().getNameByIndex(PROPERTY_ID_CURSORNAME),
770 PROPERTY_ID_CURSORNAME, ::cppu::UnoType<rtl::OUString>::get(), PropertyAttribute::READONLY);
771 pProperties[nPos++] = ::com::sun::star::beans::Property(OPropertyMap::getPropMap().getNameByIndex(PROPERTY_ID_FETCHDIRECTION),
772 PROPERTY_ID_FETCHDIRECTION, ::cppu::UnoType<sal_Int32>::get(), 0);
773 pProperties[nPos++] = ::com::sun::star::beans::Property(OPropertyMap::getPropMap().getNameByIndex(PROPERTY_ID_FETCHSIZE),
774 PROPERTY_ID_FETCHSIZE, ::cppu::UnoType<sal_Int32>::get(), 0);
775 pProperties[nPos++] = ::com::sun::star::beans::Property(OPropertyMap::getPropMap().getNameByIndex(PROPERTY_ID_ISBOOKMARKABLE),
776 PROPERTY_ID_ISBOOKMARKABLE, cppu::UnoType<bool>::get(), PropertyAttribute::READONLY);
777 pProperties[nPos++] = ::com::sun::star::beans::Property(OPropertyMap::getPropMap().getNameByIndex(PROPERTY_ID_RESULTSETCONCURRENCY),
778 PROPERTY_ID_RESULTSETCONCURRENCY, ::cppu::UnoType<sal_Int32>::get(), PropertyAttribute::READONLY);
779 pProperties[nPos++] = ::com::sun::star::beans::Property(OPropertyMap::getPropMap().getNameByIndex(PROPERTY_ID_RESULTSETTYPE),
780 PROPERTY_ID_RESULTSETTYPE, ::cppu::UnoType<sal_Int32>::get(), PropertyAttribute::READONLY);
782 return new OPropertyArrayHelper(aProps);
785 IPropertyArrayHelper & OResultSet::getInfoHelper()
787 return *const_cast<OResultSet*>(this)->getArrayHelper();
790 sal_Bool OResultSet::convertFastPropertyValue(
791 Any & rConvertedValue,
792 Any & rOldValue,
793 sal_Int32 nHandle,
794 const Any& rValue )
796 switch(nHandle)
798 case PROPERTY_ID_ISBOOKMARKABLE:
799 case PROPERTY_ID_CURSORNAME:
800 case PROPERTY_ID_RESULTSETCONCURRENCY:
801 case PROPERTY_ID_RESULTSETTYPE:
802 throw ::com::sun::star::lang::IllegalArgumentException();
803 break;
804 case PROPERTY_ID_FETCHDIRECTION:
805 case PROPERTY_ID_FETCHSIZE:
806 default:
809 return sal_False;
812 void OResultSet::setFastPropertyValue_NoBroadcast(
813 sal_Int32 nHandle,
814 const Any& rValue
817 switch(nHandle)
819 case PROPERTY_ID_ISBOOKMARKABLE:
820 case PROPERTY_ID_CURSORNAME:
821 case PROPERTY_ID_RESULTSETCONCURRENCY:
822 case PROPERTY_ID_RESULTSETTYPE:
823 throw Exception();
824 break;
825 case PROPERTY_ID_FETCHDIRECTION:
826 break;
827 case PROPERTY_ID_FETCHSIZE:
828 break;
829 default:
834 void OResultSet::getFastPropertyValue(
835 Any& rValue,
836 sal_Int32 nHandle
837 ) const
839 switch(nHandle)
841 case PROPERTY_ID_ISBOOKMARKABLE:
842 case PROPERTY_ID_CURSORNAME:
843 case PROPERTY_ID_RESULTSETCONCURRENCY:
844 case PROPERTY_ID_RESULTSETTYPE:
845 case PROPERTY_ID_FETCHDIRECTION:
846 case PROPERTY_ID_FETCHSIZE:
851 void SAL_CALL OResultSet::acquire() SAL_NOEXCEPT
853 OResultSet_BASE::acquire();
856 void SAL_CALL OResultSet::release() SAL_NOEXCEPT
858 OResultSet_BASE::release();
861 ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySetInfo > SAL_CALL OResultSet::getPropertySetInfo( )
863 return ::cppu::OPropertySetHelper::createPropertySetInfo(getInfoHelper());
867 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */