29#include <com/sun/star/task/XInteractionHandler.hpp>
30#include <com/sun/star/sdb/CommandType.hpp>
31#include <com/sun/star/sdbc/DataType.hpp>
32#include <com/sun/star/sdbc/XRow.hpp>
33#include <com/sun/star/sdbc/XResultSet.hpp>
34#include <com/sun/star/sdbc/XResultSetMetaDataSupplier.hpp>
35#include <com/sun/star/sdbc/XColumnLocate.hpp>
36#include <com/sun/star/beans/NamedValue.hpp>
37#include <com/sun/star/chart/ChartDataRowSource.hpp>
38#include <com/sun/star/chart/XChartDataArray.hpp>
48using ::com::sun::star::uno::Reference;
52 ::
cppu::PropertySetMixin< chart2::data::XDatabaseDataProvider >(
53 context, IMPLEMENTS_PROPERTY_SET,
uno::
Sequence< OUString >()),
54 m_aParameterManager(
m_aMutex, context ),
58 m_EscapeProcessing(true),
61 m_xInternal.set(
m_xContext->getServiceManager()->createInstanceWithContext(
"com.sun.star.comp.chart.InternalDataProvider",
m_xContext ), uno::UNO_QUERY );
62 m_xRangeConversion.set(m_xInternal,uno::UNO_QUERY);
63 m_xComplexDescriptionAccess.set(m_xInternal,uno::UNO_QUERY);
65 osl_atomic_increment( &m_refCount );
68 m_xAggregate.set(m_xRowSet,uno::UNO_QUERY);
69 m_xAggregateSet.set(m_xRowSet,uno::UNO_QUERY);
70 uno::Reference<beans::XPropertySet> xProp(
static_cast< ::
cppu::OWeakObject*
>(
this ),uno::UNO_QUERY);
71 m_aFilterManager.initialize( m_xAggregateSet );
72 m_aParameterManager.initialize( xProp, m_xAggregate );
76 osl_atomic_decrement( &m_refCount );
79void SAL_CALL DatabaseDataProvider::disposing()
81 m_aParameterManager.dispose();
82 m_aFilterManager.dispose();
85 m_xAggregateSet.clear();
87 m_xRangeConversion.clear();
88 ::comphelper::disposeComponent(m_xRowSet);
89 ::comphelper::disposeComponent(m_xInternal);
90 m_xActiveConnection.clear();
95 return TDatabaseDataProvider::queryInterface(
type);
99OUString SAL_CALL DatabaseDataProvider::getImplementationName( )
101 return "com.sun.star.comp.dbaccess.DatabaseDataProvider";
104sal_Bool SAL_CALL DatabaseDataProvider::supportsService(
const OUString& _rServiceName )
109uno::Sequence< OUString > SAL_CALL DatabaseDataProvider::getSupportedServiceNames( )
111 return {
"com.sun.star.chart2.data.DatabaseDataProvider" };
115void SAL_CALL DatabaseDataProvider::initialize(
const uno::Sequence< uno::Any > &
aArguments)
120 for(;pIter != pEnd;++pIter)
122 if ( !m_xActiveConnection.is() )
123 (*pIter) >>= m_xActiveConnection;
131sal_Bool SAL_CALL DatabaseDataProvider::createDataSourcePossible(
const uno::Sequence< beans::PropertyValue > & _aArguments)
133 const beans::PropertyValue* pArgIter = _aArguments.getConstArray();
134 const beans::PropertyValue* pArgEnd = pArgIter + _aArguments.getLength();
135 for(;pArgIter != pArgEnd;++pArgIter)
137 if ( pArgIter->Name ==
"DataRowSource" )
139 css::chart::ChartDataRowSource eRowSource = css::chart::ChartDataRowSource_COLUMNS;
140 pArgIter->Value >>= eRowSource;
141 if ( eRowSource != css::chart::ChartDataRowSource_COLUMNS )
144 else if ( pArgIter->Name ==
"CellRangeRepresentation" )
147 pArgIter->Value >>= sRange;
148 if ( sRange !=
"all" )
151 else if ( pArgIter->Name ==
"FirstCellAsLabel" )
153 bool bFirstCellAsLabel =
true;
154 pArgIter->Value >>= bFirstCellAsLabel;
155 if ( !bFirstCellAsLabel )
162uno::Reference< chart2::data::XDataSource > SAL_CALL DatabaseDataProvider::createDataSource(
const uno::Sequence< beans::PropertyValue > & _aArguments)
164 osl::ResettableMutexGuard aClearForNotifies(
m_aMutex);
165 if ( createDataSourcePossible(_aArguments) )
169 uno::Reference< chart::XChartDataArray> xChartData( m_xInternal, uno::UNO_QUERY_THROW );
170 xChartData->setData( uno::Sequence< uno::Sequence< double > >() );
171 xChartData->setColumnDescriptions( uno::Sequence< OUString >() );
172 if ( m_xInternal->hasDataByRangeRepresentation( OUString::number( 0 ) ) )
173 m_xInternal->deleteSequence(0);
175 catch(
const uno::Exception& )
181 const bool bHasCategories = aArgs.
getOrDefault(
"HasCategories",
true );
182 uno::Sequence< OUString > aColumnNames =
183 aArgs.
getOrDefault(
"ColumnDescriptions", uno::Sequence< OUString >() );
186 if ( !m_Command.isEmpty() && m_xActiveConnection.is() )
190 impl_fillRowSet_throw();
191 if ( impl_fillParameters_nothrow(aClearForNotifies) )
192 m_xRowSet->execute();
193 impl_fillInternalDataProvider_throw(bHasCategories,aColumnNames);
196 catch(
const uno::Exception& )
202 uno::Reference< lang::XInitialization> xIni(m_xInternal,uno::UNO_QUERY);
205 beans::NamedValue aParam(
"CreateDefaultData",
uno::Any(
true));
206 uno::Sequence< uno::Any > aInitArgs{
uno::Any(aParam) };
207 xIni->initialize(aInitArgs);
212 return m_xInternal->createDataSource(_aArguments);
215uno::Sequence< beans::PropertyValue > SAL_CALL DatabaseDataProvider::detectArguments(
const uno::Reference< chart2::data::XDataSource > & _xDataSource)
223 bool bHasCategories =
false;
224 if( _xDataSource.is())
226 uno::Sequence< uno::Reference< chart2::data::XLabeledDataSequence > > aSequences(_xDataSource->getDataSequences());
227 const sal_Int32
nCount( aSequences.getLength());
228 for( sal_Int32 nIdx=0; nIdx<
nCount; ++nIdx )
230 if( aSequences[nIdx].is() )
232 uno::Reference< beans::XPropertySet > xSeqProp( aSequences[nIdx]->getValues(), uno::UNO_QUERY );
235 && ( xSeqProp->getPropertyValue(
"Role" ) >>= aRole )
236 && aRole ==
"categories"
239 bHasCategories =
true;
249sal_Bool SAL_CALL DatabaseDataProvider::createDataSequenceByRangeRepresentationPossible(
const OUString & )
254uno::Any DatabaseDataProvider::impl_getNumberFormatKey_nothrow(
const OUString & _sRangeRepresentation)
const
256 std::map< OUString,css::uno::Any>::const_iterator aFind = m_aNumberFormats.find(_sRangeRepresentation);
257 if ( aFind != m_aNumberFormats.end() )
258 return aFind->second;
262uno::Reference< chart2::data::XDataSequence > SAL_CALL DatabaseDataProvider::createDataSequenceByRangeRepresentation(
const OUString & _sRangeRepresentation)
265 uno::Reference< chart2::data::XDataSequence > xData = m_xInternal->createDataSequenceByRangeRepresentation(_sRangeRepresentation);
266 uno::Reference<beans::XPropertySet> xProp(xData,uno::UNO_QUERY);
267 static constexpr OUStringLiteral s_sNumberFormatKey =
u"NumberFormatKey";
268 if ( xProp.is() && xProp->getPropertySetInfo()->hasPropertyByName(s_sNumberFormatKey) )
270 xProp->setPropertyValue(s_sNumberFormatKey,impl_getNumberFormatKey_nothrow(_sRangeRepresentation));
275uno::Reference<chart2::data::XDataSequence>
276SAL_CALL DatabaseDataProvider::createDataSequenceByValueArray(
277 const OUString& ,
const OUString& ,
const OUString& )
279 return uno::Reference<chart2::data::XDataSequence>();
282uno::Sequence< uno::Sequence< OUString > > SAL_CALL DatabaseDataProvider::getComplexRowDescriptions()
284 return m_xComplexDescriptionAccess->getComplexRowDescriptions();
287void SAL_CALL DatabaseDataProvider::setComplexRowDescriptions(
const uno::Sequence< uno::Sequence< OUString > >& aRowDescriptions )
289 m_xComplexDescriptionAccess->setComplexRowDescriptions(aRowDescriptions);
292uno::Sequence< uno::Sequence< OUString > > SAL_CALL DatabaseDataProvider::getComplexColumnDescriptions()
294 return m_xComplexDescriptionAccess->getComplexColumnDescriptions();
297void SAL_CALL DatabaseDataProvider::setComplexColumnDescriptions(
const uno::Sequence< uno::Sequence< OUString > >& aColumnDescriptions )
299 m_xComplexDescriptionAccess->setComplexColumnDescriptions(aColumnDescriptions);
303uno::Sequence< uno::Sequence< double > > SAL_CALL DatabaseDataProvider::getData()
305 return m_xComplexDescriptionAccess->getData();
308void SAL_CALL DatabaseDataProvider::setData(
const uno::Sequence< uno::Sequence< double > >& rDataInRows )
310 m_xComplexDescriptionAccess->setData(rDataInRows);
313void SAL_CALL DatabaseDataProvider::setRowDescriptions(
const uno::Sequence< OUString >& aRowDescriptions )
315 m_xComplexDescriptionAccess->setRowDescriptions(aRowDescriptions);
318void SAL_CALL DatabaseDataProvider::setColumnDescriptions(
const uno::Sequence< OUString >& aColumnDescriptions )
320 m_xComplexDescriptionAccess->setColumnDescriptions(aColumnDescriptions);
323uno::Sequence< OUString > SAL_CALL DatabaseDataProvider::getRowDescriptions()
325 return m_xComplexDescriptionAccess->getRowDescriptions();
328uno::Sequence< OUString > SAL_CALL DatabaseDataProvider::getColumnDescriptions()
330 return m_xComplexDescriptionAccess->getColumnDescriptions();
334void SAL_CALL DatabaseDataProvider::addChartDataChangeEventListener(
const uno::Reference< css::chart::XChartDataChangeEventListener >& x)
336 m_xComplexDescriptionAccess->addChartDataChangeEventListener(
x);
339void SAL_CALL DatabaseDataProvider::removeChartDataChangeEventListener(
const uno::Reference< css::chart::XChartDataChangeEventListener >& x)
341 m_xComplexDescriptionAccess->removeChartDataChangeEventListener(
x);
344double SAL_CALL DatabaseDataProvider::getNotANumber()
346 return m_xComplexDescriptionAccess->getNotANumber();
349sal_Bool SAL_CALL DatabaseDataProvider::isNotANumber(
double nNumber )
351 return m_xComplexDescriptionAccess->isNotANumber(nNumber);
354uno::Reference< sheet::XRangeSelection > SAL_CALL DatabaseDataProvider::getRangeSelection()
361 return uno::Reference< sheet::XRangeSelection >();
365OUString SAL_CALL DatabaseDataProvider::convertRangeToXML(
const OUString & _sRangeRepresentation)
368 return m_xRangeConversion->convertRangeToXML(_sRangeRepresentation);
371OUString SAL_CALL DatabaseDataProvider::convertRangeFromXML(
const OUString & _sXMLRange)
374 return m_xRangeConversion->convertRangeFromXML(_sXMLRange);
378uno::Reference< beans::XPropertySetInfo > SAL_CALL DatabaseDataProvider::getPropertySetInfo()
380 return ::cppu::PropertySetMixin< chart2::data::XDatabaseDataProvider >::getPropertySetInfo();
383void SAL_CALL DatabaseDataProvider::setPropertyValue(
const OUString & aPropertyName,
const uno::Any & aValue)
388uno::Any SAL_CALL DatabaseDataProvider::getPropertyValue(
const OUString & aPropertyName)
390 return ::cppu::PropertySetMixin< chart2::data::XDatabaseDataProvider >::getPropertyValue(aPropertyName);
393void SAL_CALL DatabaseDataProvider::addPropertyChangeListener(
const OUString & aPropertyName,
const uno::Reference< beans::XPropertyChangeListener > & xListener)
398void SAL_CALL DatabaseDataProvider::removePropertyChangeListener(
const OUString & aPropertyName,
const uno::Reference< beans::XPropertyChangeListener > & xListener)
403void SAL_CALL DatabaseDataProvider::addVetoableChangeListener(
const OUString & aPropertyName,
const uno::Reference< beans::XVetoableChangeListener > & xListener)
408void SAL_CALL DatabaseDataProvider::removeVetoableChangeListener(
const OUString & aPropertyName,
const uno::Reference< beans::XVetoableChangeListener > & xListener)
414uno::Sequence< OUString > SAL_CALL DatabaseDataProvider::getMasterFields()
417 return m_MasterFields;
420void SAL_CALL DatabaseDataProvider::setMasterFields(
const uno::Sequence< OUString > & the_value)
422 impl_invalidateParameter_nothrow();
423 set(
"MasterFields",the_value,m_MasterFields);
426uno::Sequence< OUString > SAL_CALL DatabaseDataProvider::getDetailFields()
429 return m_DetailFields;
432void SAL_CALL DatabaseDataProvider::setDetailFields(
const uno::Sequence< OUString > & the_value)
434 set(
"DetailFields",the_value,m_DetailFields);
437OUString SAL_CALL DatabaseDataProvider::getCommand()
443void SAL_CALL DatabaseDataProvider::setCommand(
const OUString & the_value)
447 impl_invalidateParameter_nothrow();
453::sal_Int32 SAL_CALL DatabaseDataProvider::getCommandType()
456 return m_CommandType;
459void SAL_CALL DatabaseDataProvider::setCommandType(::sal_Int32 the_value)
468OUString SAL_CALL DatabaseDataProvider::getFilter()
474void SAL_CALL DatabaseDataProvider::setFilter(
const OUString & the_value)
483sal_Bool SAL_CALL DatabaseDataProvider::getApplyFilter()
486 return m_ApplyFilter;
489void SAL_CALL DatabaseDataProvider::setApplyFilter(
sal_Bool the_value )
498OUString SAL_CALL DatabaseDataProvider::getHavingClause()
501 return m_HavingClause;
504void SAL_CALL DatabaseDataProvider::setHavingClause(
const OUString& the_value )
513OUString SAL_CALL DatabaseDataProvider::getGroupBy()
519void SAL_CALL DatabaseDataProvider::setGroupBy(
const OUString& the_value )
528OUString SAL_CALL DatabaseDataProvider::getOrder()
534void SAL_CALL DatabaseDataProvider::setOrder(
const OUString& the_value )
543sal_Bool SAL_CALL DatabaseDataProvider::getEscapeProcessing()
546 return m_EscapeProcessing;
549void SAL_CALL DatabaseDataProvider::setEscapeProcessing(
sal_Bool the_value)
554::sal_Int32 SAL_CALL DatabaseDataProvider::getRowLimit()
560void SAL_CALL DatabaseDataProvider::setRowLimit(::sal_Int32 the_value)
562 set(
"RowLimit",the_value,m_RowLimit);
565uno::Reference< sdbc::XConnection > SAL_CALL DatabaseDataProvider::getActiveConnection()
568 return m_xActiveConnection;
571void SAL_CALL DatabaseDataProvider::setActiveConnection(
const uno::Reference< sdbc::XConnection > & the_value)
573 if ( !the_value.is() )
574 throw lang::IllegalArgumentException();
578OUString SAL_CALL DatabaseDataProvider::getDataSourceName()
581 return m_DataSourceName;
584void SAL_CALL DatabaseDataProvider::setDataSourceName(
const OUString& the_value)
591 struct ColumnDescription
602 explicit ColumnDescription( OUString i_sName )
610 struct CreateColumnDescription
612 ColumnDescription operator()(
const OUString& i_rName )
614 return ColumnDescription( i_rName );
618 struct SelectColumnName
620 const OUString& operator()(
const ColumnDescription& i_rColumn )
622 return i_rColumn.sName;
627void DatabaseDataProvider::impl_fillInternalDataProvider_throw(
bool _bHasCategories,
const uno::Sequence< OUString >& i_aColumnNames)
630 uno::Reference< sdbcx::XColumnsSupplier > xColSup(m_xRowSet,uno::UNO_QUERY_THROW);
631 uno::Reference< container::XNameAccess > xColumns( xColSup->getColumns(), uno::UNO_SET_THROW );
632 const uno::Sequence< OUString > aRowSetColumnNames( xColumns->getElementNames() );
634 typedef std::vector< ColumnDescription > ColumnDescriptions;
635 ColumnDescriptions aColumns;
636 bool bFirstColumnIsCategory = _bHasCategories;
637 if ( i_aColumnNames.hasElements() )
640 uno::Sequence< OUString > aImposedColumnNames( i_aColumnNames );
646 sal_Int32 nLastNonEmptyColName = aImposedColumnNames.getLength() - 1;
647 for ( ; nLastNonEmptyColName >= 0; --nLastNonEmptyColName )
649 if ( !aImposedColumnNames[ nLastNonEmptyColName ].isEmpty() )
652 aImposedColumnNames.realloc( nLastNonEmptyColName + 1 );
658 if ( aImposedColumnNames.hasElements() && ( !aImposedColumnNames[0].isEmpty() ) )
660 const sal_Int32 nAssumedRowSetColumnIndex = _bHasCategories ? 1 : 0;
661 if ( nAssumedRowSetColumnIndex < aRowSetColumnNames.getLength() )
662 aImposedColumnNames.getArray()[0] = aRowSetColumnNames[ nAssumedRowSetColumnIndex ];
665 const sal_Int32
nCount = aImposedColumnNames.getLength();
666 for ( sal_Int32
i = 0 ;
i <
nCount; ++
i )
668 const OUString sColumnName( aImposedColumnNames[
i] );
669 if ( !xColumns->hasByName( sColumnName ) )
672 if ( _bHasCategories && aColumns.empty() )
674 if ( aRowSetColumnNames.hasElements() )
675 aColumns.emplace_back( aRowSetColumnNames[0] );
677 aColumns.emplace_back( sColumnName );
678 bFirstColumnIsCategory =
true;
680 aColumns.emplace_back( sColumnName );
683 if ( aColumns.empty() )
685 aColumns.resize( aRowSetColumnNames.getLength() );
687 aRowSetColumnNames.begin(),
688 aRowSetColumnNames.end(),
690 CreateColumnDescription()
695 uno::Reference< sdbc::XResultSet> xRes( m_xRowSet, uno::UNO_QUERY_THROW );
696 uno::Reference< sdbc::XRow> xRow( m_xRowSet,uno::UNO_QUERY_THROW );
697 uno::Reference< sdbc::XResultSetMetaDataSupplier > xSuppMeta( m_xRowSet,uno::UNO_QUERY_THROW );
698 uno::Reference< sdbc::XColumnLocate > xColumnLocate( m_xRowSet, uno::UNO_QUERY_THROW );
700 sal_Int32 columnIndex = 0;
701 for (
auto & column : aColumns)
703 column.nResultSetPosition = xColumnLocate->findColumn( column.sName );
705 const uno::Reference< beans::XPropertySet >
xColumn( xColumns->getByName( column.sName ), uno::UNO_QUERY_THROW );
709 const OUString sRangeName = OUString::number( columnIndex );
710 m_aNumberFormats.emplace( sRangeName, aNumberFormat );
714 std::vector< OUString > aRowLabels;
715 std::vector< std::vector< double > > aDataValues;
716 sal_Int32 nRowCount = 0;
718 while( xRes->next() && (!m_RowLimit || nRowCount < m_RowLimit) )
723 aRowLabels.push_back( aValue.
getString() );
725 std::vector< double > aRow;
726 bool bFirstLoop =
true;
727 for (
auto const& column : aColumns)
732 if (bFirstColumnIsCategory)
736 aValue.
fill( column.nResultSetPosition, column.nDataType, xRow );
738 aRow.push_back( std::numeric_limits<double>::quiet_NaN() );
743 aDataValues.push_back( aRow );
755 for(sal_Int32
h = 0,k = 0;
h < nRowCount; ++
h,++k )
757 aRowLabels.push_back(OUString::number(
h+1));
758 std::vector< double > aRow;
760 for (
size_t j = 0; j < (aColumns.size()-1); ++j,++k)
766 aDataValues.push_back(aRow);
770 uno::Reference< chart::XChartDataArray> xData(m_xInternal,uno::UNO_QUERY);
773 const size_t nOffset = bFirstColumnIsCategory ? 1 : 0;
774 uno::Sequence< OUString > aColumnDescriptions( aColumns.size() - nOffset );
776 aColumns.begin() + nOffset,
778 aColumnDescriptions.getArray(),
781 xData->setColumnDescriptions( aColumnDescriptions );
783 uno::Sequence< uno::Sequence< double > >
aData(aDataValues.size());
784 uno::Sequence< double >* pDataIter =
aData.getArray();
785 uno::Sequence< double >* pDataEnd = pDataIter +
aData.getLength();
786 for(sal_Int32
i= 0;pDataIter != pDataEnd; ++pDataIter,++
i )
788 if ( !aDataValues[
i].empty() )
791 xData->setData(
aData);
794void DatabaseDataProvider::impl_fillRowSet_throw()
797 uno::Reference< sdbc::XParameters> xParam(m_xRowSet,uno::UNO_QUERY_THROW);
798 xParam->clearParameters( );
801bool DatabaseDataProvider::impl_fillParameters_nothrow( ::osl::ResettableMutexGuard& _rClearForNotifies)
804 if ( !m_aParameterManager.isUpToDate() )
805 m_aParameterManager.updateParameterInfo( m_aFilterManager );
807 if ( m_aParameterManager.isUpToDate() )
808 return m_aParameterManager.fillParameterValues(
m_xHandler, _rClearForNotifies );
814void SAL_CALL DatabaseDataProvider::setNull(sal_Int32 parameterIndex, sal_Int32 sqlType)
816 m_aParameterManager.setNull(parameterIndex, sqlType);
819void SAL_CALL DatabaseDataProvider::setObjectNull(sal_Int32 parameterIndex, sal_Int32 sqlType,
const OUString& typeName)
821 m_aParameterManager.setObjectNull(parameterIndex, sqlType,
typeName);
824void SAL_CALL DatabaseDataProvider::setBoolean(sal_Int32 parameterIndex,
sal_Bool x)
826 m_aParameterManager.setBoolean(parameterIndex,
x);
829void SAL_CALL DatabaseDataProvider::setByte(sal_Int32 parameterIndex,
sal_Int8 x)
831 m_aParameterManager.setByte(parameterIndex,
x);
834void SAL_CALL DatabaseDataProvider::setShort(sal_Int32 parameterIndex, sal_Int16 x)
836 m_aParameterManager.setShort(parameterIndex,
x);
839void SAL_CALL DatabaseDataProvider::setInt(sal_Int32 parameterIndex, sal_Int32 x)
841 m_aParameterManager.setInt(parameterIndex,
x);
844void SAL_CALL DatabaseDataProvider::setLong(sal_Int32 parameterIndex, sal_Int64 x)
846 m_aParameterManager.setLong(parameterIndex,
x);
849void SAL_CALL DatabaseDataProvider::setFloat(sal_Int32 parameterIndex,
float x)
851 m_aParameterManager.setFloat(parameterIndex,
x);
854void SAL_CALL DatabaseDataProvider::setDouble(sal_Int32 parameterIndex,
double x)
856 m_aParameterManager.setDouble(parameterIndex,
x);
859void SAL_CALL DatabaseDataProvider::setString(sal_Int32 parameterIndex,
const OUString& x)
861 m_aParameterManager.setString(parameterIndex,
x);
864void SAL_CALL DatabaseDataProvider::setBytes(sal_Int32 parameterIndex,
const uno::Sequence< sal_Int8 >& x)
866 m_aParameterManager.setBytes(parameterIndex,
x);
869void SAL_CALL DatabaseDataProvider::setDate(sal_Int32 parameterIndex,
const util::Date& x)
871 m_aParameterManager.setDate(parameterIndex,
x);
874void SAL_CALL DatabaseDataProvider::setTime(sal_Int32 parameterIndex,
const util::Time& x)
876 m_aParameterManager.setTime(parameterIndex,
x);
879void SAL_CALL DatabaseDataProvider::setTimestamp(sal_Int32 parameterIndex,
const util::DateTime& x)
881 m_aParameterManager.setTimestamp(parameterIndex,
x);
884void SAL_CALL DatabaseDataProvider::setBinaryStream(sal_Int32 parameterIndex,
const uno::Reference<io::XInputStream>& x, sal_Int32 length)
886 m_aParameterManager.setBinaryStream(parameterIndex,
x,
length);
889void SAL_CALL DatabaseDataProvider::setCharacterStream(sal_Int32 parameterIndex,
const uno::Reference<io::XInputStream>& x, sal_Int32 length)
891 m_aParameterManager.setCharacterStream(parameterIndex,
x,
length);
894void SAL_CALL DatabaseDataProvider::setObjectWithInfo(sal_Int32 parameterIndex,
const uno::Any& x, sal_Int32 targetSqlType, sal_Int32 scale)
896 m_aParameterManager.setObjectWithInfo(parameterIndex,
x, targetSqlType,
scale);
899void SAL_CALL DatabaseDataProvider::setObject(sal_Int32 parameterIndex,
const uno::Any& x)
901 m_aParameterManager.setObject(parameterIndex,
x);
904void SAL_CALL DatabaseDataProvider::setRef(sal_Int32 parameterIndex,
const uno::Reference<sdbc::XRef>& x)
906 m_aParameterManager.setRef(parameterIndex,
x);
909void SAL_CALL DatabaseDataProvider::setBlob(sal_Int32 parameterIndex,
const uno::Reference<sdbc::XBlob>& x)
911 m_aParameterManager.setBlob(parameterIndex,
x);
914void SAL_CALL DatabaseDataProvider::setClob(sal_Int32 parameterIndex,
const uno::Reference<sdbc::XClob>& x)
916 m_aParameterManager.setClob(parameterIndex,
x);
919void SAL_CALL DatabaseDataProvider::setArray(sal_Int32 parameterIndex,
const Reference<sdbc::XArray>& x)
921 m_aParameterManager.setArray(parameterIndex,
x);
924void SAL_CALL DatabaseDataProvider::clearParameters()
926 m_aParameterManager.clearParameters();
930void SAL_CALL DatabaseDataProvider::execute()
932 uno::Sequence< beans::PropertyValue > aEmpty;
933 createDataSource(aEmpty);
936void SAL_CALL DatabaseDataProvider::addRowSetListener(
const uno::Reference<sdbc::XRowSetListener>& _rListener)
939 m_xRowSet->addRowSetListener(_rListener);
942void SAL_CALL DatabaseDataProvider::removeRowSetListener(
const uno::Reference<sdbc::XRowSetListener>& _rListener)
945 m_xRowSet->removeRowSetListener(_rListener);
951 return m_xRowSet->next();
954sal_Bool SAL_CALL DatabaseDataProvider::isBeforeFirst()
956 return m_xRowSet->isBeforeFirst();
959sal_Bool SAL_CALL DatabaseDataProvider::isAfterLast()
961 return m_xRowSet->isAfterLast();
966 return m_xRowSet->isFirst();
971 return m_xRowSet->isLast();
974void SAL_CALL DatabaseDataProvider::beforeFirst()
976 m_xRowSet->beforeFirst();
979void SAL_CALL DatabaseDataProvider::afterLast()
981 m_xRowSet->afterLast();
986 return m_xRowSet->first();
991 return m_xRowSet->last();
994sal_Int32 SAL_CALL DatabaseDataProvider::getRow()
996 return m_xRowSet->getRow();
999sal_Bool SAL_CALL DatabaseDataProvider::absolute(sal_Int32 row)
1001 return m_xRowSet->absolute(row);
1004sal_Bool SAL_CALL DatabaseDataProvider::relative(sal_Int32 rows)
1006 return m_xRowSet->relative(rows);
1011 return m_xRowSet->previous();
1014void SAL_CALL DatabaseDataProvider::refreshRow()
1016 m_xRowSet->refreshRow();
1021 return m_xRowSet->rowUpdated();
1026 return m_xRowSet->rowInserted();
1031 return m_xRowSet->rowDeleted();
1034uno::Reference< uno::XInterface > SAL_CALL DatabaseDataProvider::getStatement()
1036 return m_xRowSet->getStatement();
1039uno::Reference< uno::XInterface > SAL_CALL DatabaseDataProvider::getParent( )
1044void SAL_CALL DatabaseDataProvider::setParent(
const uno::Reference< uno::XInterface >& _xParent )
1047 m_xParent = _xParent;
1050void DatabaseDataProvider::impl_invalidateParameter_nothrow()
1053 m_aParameterManager.clearAllParameterInformation();
1059extern "C" SAL_DLLPUBLIC_EXPORT css::uno::XInterface*
1061 css::uno::XComponentContext* context, css::uno::Sequence<css::uno::Any>
const& )
SAL_DLLPUBLIC_EXPORT css::uno::XInterface * com_sun_star_comp_dbaccess_DatabaseDataProvider_get_implementation(css::uno::XComponentContext *context, css::uno::Sequence< css::uno::Any > const &)
sal_Int32 nResultSetPosition
VALUE_TYPE getOrDefault(const OUString &_rValueName, const VALUE_TYPE &_rDefault) const
OUString getString() const
void fill(sal_Int32 _nPos, sal_Int32 _nType, const css::uno::Reference< css::sdbc::XRow > &_xRow)
virtual void SAL_CALL removeVetoableChangeListener(rtl::OUString const &propertyName, css::uno::Reference< css::beans::XVetoableChangeListener > const &listener) SAL_OVERRIDE
virtual void SAL_CALL addPropertyChangeListener(rtl::OUString const &propertyName, css::uno::Reference< css::beans::XPropertyChangeListener > const &listener) SAL_OVERRIDE
virtual void SAL_CALL addVetoableChangeListener(rtl::OUString const &propertyName, css::uno::Reference< css::beans::XVetoableChangeListener > const &listener) SAL_OVERRIDE
virtual void SAL_CALL setPropertyValue(rtl::OUString const &propertyName, css::uno::Any const &value) SAL_OVERRIDE
virtual void SAL_CALL removePropertyChangeListener(rtl::OUString const &propertyName, css::uno::Reference< css::beans::XPropertyChangeListener > const &listener) SAL_OVERRIDE
DatabaseDataProvider(css::uno::Reference< css::uno::XComponentContext > const &context)
Reference< XComponentContext > m_xContext
#define DBG_UNHANDLED_EXCEPTION(...)
uno::Reference< task::XInteractionHandler2 > m_xHandler
Sequence< PropertyValue > aArguments
constexpr OUStringLiteral aData
void set(css::uno::UnoInterfaceReference const &value)
const double fDefaultData[]
css::uno::Sequence< DstElementType > containerToSequence(const SrcType &i_Container)
bool CPPUHELPER_DLLPUBLIC supportsService(css::lang::XServiceInfo *implementation, rtl::OUString const &name)
::cppu::WeakComponentImplHelper< css::chart2::data::XDatabaseDataProvider, css::container::XChild, css::chart::XComplexDescriptionAccess, css::lang::XServiceInfo > TDatabaseDataProvider
constexpr OUStringLiteral PROPERTY_COMMAND(u"Command")
constexpr OUStringLiteral PROPERTY_HAVING_CLAUSE(u"HavingClause")
constexpr OUStringLiteral PROPERTY_NUMBERFORMAT(u"FormatKey")
constexpr OUStringLiteral SERVICE_SDB_ROWSET
constexpr OUStringLiteral PROPERTY_APPLYFILTER(u"ApplyFilter")
constexpr OUStringLiteral PROPERTY_GROUP_BY(u"GroupBy")
constexpr OUStringLiteral PROPERTY_FILTER(u"Filter")
constexpr OUStringLiteral PROPERTY_ACTIVE_CONNECTION(u"ActiveConnection")
constexpr OUStringLiteral PROPERTY_ESCAPE_PROCESSING(u"EscapeProcessing")
constexpr OUStringLiteral PROPERTY_TYPE(u"Type")
constexpr OUStringLiteral PROPERTY_DATASOURCENAME(u"DataSourceName")
constexpr OUStringLiteral PROPERTY_COMMAND_TYPE(u"CommandType")
constexpr OUStringLiteral PROPERTY_ORDER(u"Order")