Line data Source code
1 : /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 : /*
3 : * This file is part of the LibreOffice project.
4 : *
5 : * This Source Code Form is subject to the terms of the Mozilla Public
6 : * License, v. 2.0. If a copy of the MPL was not distributed with this
7 : * file, You can obtain one at http://mozilla.org/MPL/2.0/.
8 : *
9 : * This file incorporates work covered by the following license notice:
10 : *
11 : * Licensed to the Apache Software Foundation (ASF) under one or more
12 : * contributor license agreements. See the NOTICE file distributed
13 : * with this work for additional information regarding copyright
14 : * ownership. The ASF licenses this file to you under the Apache
15 : * License, Version 2.0 (the "License"); you may not use this file
16 : * except in compliance with the License. You may obtain a copy of
17 : * the License at http://www.apache.org/licenses/LICENSE-2.0 .
18 : */
19 :
20 : #include <connectivity/parameters.hxx>
21 :
22 : #include <com/sun/star/form/DatabaseParameterEvent.hpp>
23 : #include <com/sun/star/sdbc/XParameters.hpp>
24 : #include <com/sun/star/container/XChild.hpp>
25 : #include <com/sun/star/sdbcx/XColumnsSupplier.hpp>
26 : #include <com/sun/star/container/XEnumerationAccess.hpp>
27 : #include <com/sun/star/sdb/XParametersSupplier.hpp>
28 : #include <com/sun/star/sdb/XInteractionSupplyParameters.hpp>
29 : #include <com/sun/star/sdb/ParametersRequest.hpp>
30 :
31 : #include <connectivity/dbtools.hxx>
32 : #include <connectivity/filtermanager.hxx>
33 : #include "TConnection.hxx"
34 :
35 : #include <tools/diagnose_ex.h>
36 :
37 : #include <comphelper/uno3.hxx>
38 : #include <comphelper/proparrhlp.hxx>
39 : #include <comphelper/broadcasthelper.hxx>
40 : #include <connectivity/ParameterCont.hxx>
41 : #include <rtl/ustrbuf.hxx>
42 :
43 : namespace dbtools
44 : {
45 : using namespace ::com::sun::star::uno;
46 : using namespace ::com::sun::star::sdb;
47 : using namespace ::com::sun::star::sdbc;
48 : using namespace ::com::sun::star::sdbcx;
49 : using namespace ::com::sun::star::lang;
50 : using namespace ::com::sun::star::beans;
51 : using namespace ::com::sun::star::task;
52 : using namespace ::com::sun::star::form;
53 : using namespace ::com::sun::star::container;
54 :
55 : using namespace ::comphelper;
56 : using namespace ::connectivity;
57 :
58 192 : ParameterManager::ParameterManager( ::osl::Mutex& _rMutex, const Reference< XComponentContext >& _rxContext )
59 : :m_rMutex ( _rMutex )
60 : ,m_aParameterListeners( _rMutex )
61 : ,m_xContext ( _rxContext )
62 : ,m_pOuterParameters ( NULL )
63 : ,m_nInnerCount ( 0 )
64 192 : ,m_bUpToDate ( false )
65 : {
66 : OSL_ENSURE( m_xContext.is(), "ParameterManager::ParameterManager: no service factory!" );
67 192 : }
68 :
69 :
70 184 : void ParameterManager::initialize( const Reference< XPropertySet >& _rxComponent, const Reference< XAggregation >& _rxComponentAggregate )
71 : {
72 : OSL_ENSURE( !m_xComponent.get().is(), "ParameterManager::initialize: already initialized!" );
73 :
74 184 : m_xComponent = _rxComponent;
75 184 : m_xAggregatedRowSet = _rxComponentAggregate;
76 184 : if ( m_xAggregatedRowSet.is() )
77 184 : m_xAggregatedRowSet->queryAggregation( cppu::UnoType<decltype(m_xInnerParamUpdate)>::get() ) >>= m_xInnerParamUpdate;
78 : OSL_ENSURE( m_xComponent.get().is() && m_xInnerParamUpdate.is(), "ParameterManager::initialize: invalid arguments!" );
79 184 : if ( !m_xComponent.get().is() || !m_xInnerParamUpdate.is() )
80 0 : return;
81 : }
82 :
83 :
84 183 : void ParameterManager::dispose( )
85 : {
86 183 : clearAllParameterInformation();
87 :
88 183 : m_xComposer.clear();
89 183 : m_xParentComposer.clear();
90 : //m_xComponent.clear();
91 183 : m_xInnerParamUpdate.clear();
92 183 : m_xAggregatedRowSet.clear();
93 183 : }
94 :
95 :
96 438 : void ParameterManager::clearAllParameterInformation()
97 : {
98 438 : m_xInnerParamColumns.clear();
99 438 : if ( m_pOuterParameters.is() )
100 0 : m_pOuterParameters->dispose();
101 438 : m_pOuterParameters = NULL;
102 438 : m_nInnerCount = 0;
103 438 : ParameterInformation aEmptyInfo;
104 438 : m_aParameterInformation.swap( aEmptyInfo );
105 438 : m_aMasterFields.realloc( 0 );
106 438 : m_aDetailFields.realloc( 0 );
107 438 : m_sIdentifierQuoteString.clear();
108 876 : ::std::vector< bool > aEmptyArray;
109 438 : m_aParametersVisited.swap( aEmptyArray );
110 876 : m_bUpToDate = false;
111 438 : }
112 :
113 :
114 0 : void ParameterManager::setAllParametersNull()
115 : {
116 : OSL_PRECOND( isAlive(), "ParameterManager::setAllParametersNull: not initialized, or already disposed!" );
117 0 : if ( !isAlive() )
118 0 : return;
119 :
120 0 : for ( sal_Int32 i = 1; i <= m_nInnerCount; ++i )
121 0 : m_xInnerParamUpdate->setNull( i, DataType::VARCHAR );
122 : }
123 :
124 :
125 12 : bool ParameterManager::initializeComposerByComponent( const Reference< XPropertySet >& _rxComponent )
126 : {
127 : OSL_PRECOND( _rxComponent.is(), "ParameterManager::initializeComposerByComponent: invalid !" );
128 :
129 12 : m_xComposer.clear();
130 12 : m_xInnerParamColumns.clear();
131 12 : m_nInnerCount = 0;
132 :
133 : // create and fill a composer
134 : try
135 : {
136 : // get a query composer for the 's settings
137 12 : m_xComposer.reset( getCurrentSettingsComposer( _rxComponent, m_xContext ), SharedQueryComposer::TakeOwnership );
138 :
139 : // see if the composer found parameters
140 12 : Reference< XParametersSupplier > xParamSupp( m_xComposer, UNO_QUERY );
141 12 : if ( xParamSupp.is() )
142 12 : m_xInnerParamColumns = xParamSupp->getParameters();
143 :
144 12 : if ( m_xInnerParamColumns.is() )
145 12 : m_nInnerCount = m_xInnerParamColumns->getCount();
146 : }
147 0 : catch( const SQLException& )
148 : {
149 : }
150 :
151 12 : return m_xInnerParamColumns.is();
152 : }
153 :
154 :
155 12 : void ParameterManager::collectInnerParameters( bool _bSecondRun )
156 : {
157 : OSL_PRECOND( m_xInnerParamColumns.is(), "ParameterManager::collectInnerParameters: missing some internal data!" );
158 12 : if ( !m_xInnerParamColumns.is() )
159 12 : return;
160 :
161 : // strip previous index information
162 12 : if ( _bSecondRun )
163 : {
164 0 : for ( ParameterInformation::iterator aParamInfo = m_aParameterInformation.begin();
165 0 : aParamInfo != m_aParameterInformation.end();
166 : ++aParamInfo
167 : )
168 : {
169 0 : aParamInfo->second.aInnerIndexes.clear();
170 : }
171 : }
172 :
173 : // we need to map the parameter names (which is all we get from the 's
174 : // MasterFields property) to indices, which are needed by the XParameters
175 : // interface of the row set)
176 12 : Reference<XPropertySet> xParam;
177 12 : for ( sal_Int32 i = 0; i < m_nInnerCount; ++i )
178 : {
179 : try
180 : {
181 0 : xParam.clear();
182 0 : m_xInnerParamColumns->getByIndex( i ) >>= xParam;
183 :
184 0 : OUString sName;
185 0 : xParam->getPropertyValue( OMetaConnection::getPropMap().getNameByIndex(PROPERTY_ID_NAME) ) >>= sName;
186 :
187 : // only append additional parameters when they are not already in the list
188 0 : ParameterInformation::iterator aExistentPos = m_aParameterInformation.find( sName );
189 : OSL_ENSURE( !_bSecondRun || ( aExistentPos != m_aParameterInformation.end() ),
190 : "ParameterManager::collectInnerParameters: the parameter information should already exist in the second run!" );
191 :
192 0 : if ( aExistentPos == m_aParameterInformation.end() )
193 : {
194 : aExistentPos = m_aParameterInformation.insert( ParameterInformation::value_type(
195 0 : sName, xParam ) ).first;
196 : }
197 : else
198 0 : aExistentPos->second.xComposerColumn = xParam;
199 :
200 0 : aExistentPos->second.aInnerIndexes.push_back( i );
201 : }
202 0 : catch( const Exception& )
203 : {
204 : SAL_WARN( "connectivity.commontools", "ParameterManager::collectInnerParameters: caught an exception!" );
205 : }
206 12 : }
207 : }
208 :
209 :
210 0 : OUString ParameterManager::createFilterConditionFromColumnLink(
211 : const OUString& _rMasterColumn, const OUString& _rDetailLink, OUString& _rNewParamName )
212 : {
213 0 : OUString sFilter;
214 :
215 : // format is:
216 : // <detail_column> = :<new_param_name>
217 0 : sFilter = quoteName( m_sIdentifierQuoteString, _rDetailLink );
218 0 : sFilter += " = :";
219 :
220 : // generate a parameter name which is not already used
221 0 : _rNewParamName = "link_from_";
222 0 : _rNewParamName += convertName2SQLName( _rMasterColumn, m_sSpecialCharacters );
223 0 : while ( m_aParameterInformation.find( _rNewParamName ) != m_aParameterInformation.end() )
224 : {
225 0 : _rNewParamName += "_";
226 : }
227 :
228 0 : return sFilter += _rNewParamName;
229 : }
230 :
231 :
232 0 : void ParameterManager::classifyLinks( const Reference< XNameAccess >& _rxParentColumns,
233 : const Reference< XNameAccess >& _rxColumns, ::std::vector< OUString >& _out_rAdditionalFilterComponents )
234 : {
235 : OSL_PRECOND( m_aMasterFields.getLength() == m_aDetailFields.getLength(),
236 : "ParameterManager::classifyLinks: master and detail fields should have the same length!" );
237 : OSL_ENSURE( _rxColumns.is(), "ParameterManager::classifyLinks: invalid columns!" );
238 :
239 0 : if ( !_rxColumns.is() )
240 0 : return;
241 :
242 : // we may need to strip any links which are invalid, so here go the containers
243 : // for temporarirly holding the new pairs
244 0 : ::std::vector< OUString > aStrippedMasterFields;
245 0 : ::std::vector< OUString > aStrippedDetailFields;
246 :
247 0 : bool bNeedExchangeLinks = false;
248 :
249 : // classify the links
250 0 : const OUString* pMasterFields = m_aMasterFields.getConstArray();
251 0 : const OUString* pDetailFields = m_aDetailFields.getConstArray();
252 0 : const OUString* pDetailFieldsEnd = pDetailFields + m_aDetailFields.getLength();
253 0 : for ( ; pDetailFields < pDetailFieldsEnd; ++pDetailFields, ++pMasterFields )
254 : {
255 0 : if ( pMasterFields->isEmpty() || pDetailFields->isEmpty() )
256 0 : continue;
257 :
258 : // if not even the master part of the relationship exists in the parent , the
259 : // link is invalid as a whole
260 : // #i63674# / 2006-03-28 / frank.schoenheit@sun.com
261 0 : if ( !_rxParentColumns->hasByName( *pMasterFields ) )
262 : {
263 0 : bNeedExchangeLinks = true;
264 0 : continue;
265 : }
266 :
267 0 : bool bValidLink = true;
268 :
269 : // is there an inner parameter with this name? That is, a parameter which is already part of
270 : // the very original statement (not the one we create ourselve, with the additional parameters)
271 0 : ParameterInformation::iterator aPos = m_aParameterInformation.find( *pDetailFields );
272 0 : if ( aPos != m_aParameterInformation.end() )
273 : { // there is an inner parameter with this name
274 0 : aPos->second.eType = eLinkedByParamName;
275 0 : aStrippedDetailFields.push_back( *pDetailFields );
276 : }
277 : else
278 : {
279 : // does the detail name denote a column?
280 0 : if ( _rxColumns->hasByName( *pDetailFields ) )
281 : {
282 0 : OUString sNewParamName;
283 0 : const OUString sFilterCondition = createFilterConditionFromColumnLink( *pMasterFields, *pDetailFields, sNewParamName );
284 : OSL_PRECOND( !sNewParamName.isEmpty(), "ParameterManager::classifyLinks: createFilterConditionFromColumnLink returned nonsense!" );
285 :
286 : // remember meta information about this new parameter
287 : ::std::pair< ParameterInformation::iterator, bool > aInsertionPos =
288 : m_aParameterInformation.insert(
289 : ParameterInformation::value_type( sNewParamName, ParameterMetaData( NULL ) )
290 0 : );
291 : OSL_ENSURE( aInsertionPos.second, "ParameterManager::classifyLinks: there already was a parameter with this name!" );
292 0 : aInsertionPos.first->second.eType = eLinkedByColumnName;
293 :
294 : // remember the filter component
295 0 : _out_rAdditionalFilterComponents.push_back( sFilterCondition );
296 :
297 : // remember the new "detail field" for this link
298 0 : aStrippedDetailFields.push_back( sNewParamName );
299 0 : bNeedExchangeLinks = true;
300 : }
301 : else
302 : {
303 : // the detail field neither denotes a column name, nor a parameter name
304 0 : bValidLink = false;
305 0 : bNeedExchangeLinks = true;
306 : }
307 : }
308 :
309 0 : if ( bValidLink )
310 0 : aStrippedMasterFields.push_back( *pMasterFields );
311 : }
312 : SAL_WARN_IF( aStrippedMasterFields.size() != aStrippedDetailFields.size(),
313 : "connectivity.commontools",
314 : "ParameterManager::classifyLinks: inconsistency in new link pairs!" );
315 :
316 0 : if ( bNeedExchangeLinks )
317 : {
318 0 : m_aMasterFields = Sequence< OUString >( aStrippedMasterFields.data(), aStrippedMasterFields.size() );
319 0 : m_aDetailFields = Sequence< OUString >( aStrippedDetailFields.data(), aStrippedDetailFields.size() );
320 0 : }
321 : }
322 :
323 :
324 12 : void ParameterManager::analyzeFieldLinks( FilterManager& _rFilterManager, bool& /* [out] */ _rColumnsInLinkDetails )
325 : {
326 : OSL_PRECOND( isAlive(), "ParameterManager::analyzeFieldLinks: not initialized, or already disposed!" );
327 12 : if ( !isAlive() )
328 0 : return;
329 :
330 12 : _rColumnsInLinkDetails = false;
331 : try
332 : {
333 : // the links as determined by the properties
334 12 : Reference< XPropertySet > xProp = m_xComponent;
335 : OSL_ENSURE(xProp.is(),"Some already released my component!");
336 12 : if ( xProp.is() )
337 : {
338 12 : xProp->getPropertyValue( OMetaConnection::getPropMap().getNameByIndex(PROPERTY_ID_MASTERFIELDS) ) >>= m_aMasterFields;
339 12 : xProp->getPropertyValue( OMetaConnection::getPropMap().getNameByIndex(PROPERTY_ID_DETAILFIELDS) ) >>= m_aDetailFields;
340 : }
341 :
342 : {
343 : // normalize to equal length
344 12 : sal_Int32 nMasterLength = m_aMasterFields.getLength();
345 12 : sal_Int32 nDetailLength = m_aDetailFields.getLength();
346 :
347 12 : if ( nMasterLength > nDetailLength )
348 0 : m_aMasterFields.realloc( nDetailLength );
349 12 : else if ( nDetailLength > nMasterLength )
350 0 : m_aDetailFields.realloc( nMasterLength );
351 : }
352 :
353 12 : Reference< XNameAccess > xColumns;
354 12 : if ( !getColumns( xColumns, true ) )
355 : // already asserted in getColumns
356 0 : return;
357 :
358 12 : Reference< XNameAccess > xParentColumns;
359 12 : if ( !getParentColumns( xParentColumns, true ) )
360 12 : return;
361 :
362 : // classify the links - depending on what the detail fields in each link pair denotes
363 0 : ::std::vector< OUString > aAdditionalFilterComponents;
364 0 : classifyLinks( xParentColumns, xColumns, aAdditionalFilterComponents );
365 :
366 : // did we find links where the detail field refers to a detail column (instead of a parameter name)?
367 0 : if ( !aAdditionalFilterComponents.empty() )
368 : {
369 : // build a conjunction of all the filter components
370 0 : OUStringBuffer sAdditionalFilter;
371 0 : for ( ::std::vector< OUString >::const_iterator aComponent = aAdditionalFilterComponents.begin();
372 0 : aComponent != aAdditionalFilterComponents.end();
373 : ++aComponent
374 : )
375 : {
376 0 : if ( !sAdditionalFilter.isEmpty() )
377 0 : sAdditionalFilter.append(" AND ");
378 :
379 0 : sAdditionalFilter.appendAscii("( ",((sal_Int32)(sizeof("( ")-1)));
380 0 : sAdditionalFilter.append(*aComponent);
381 0 : sAdditionalFilter.appendAscii(" )",((sal_Int32)(sizeof(" )")-1)));
382 : }
383 :
384 : // now set this filter at the 's filter manager
385 0 : _rFilterManager.setFilterComponent( FilterManager::fcLinkFilter, sAdditionalFilter.makeStringAndClear() );
386 :
387 0 : _rColumnsInLinkDetails = true;
388 0 : }
389 : }
390 0 : catch( const Exception& )
391 : {
392 : SAL_WARN( "connectivity.commontools", "ParameterManager::analyzeFieldLinks: caught an exception!" );
393 : }
394 : }
395 :
396 :
397 0 : void ParameterManager::createOuterParameters()
398 : {
399 : OSL_PRECOND( !m_pOuterParameters.is(), "ParameterManager::createOuterParameters: outer parameters not initialized!" );
400 : OSL_PRECOND( m_xInnerParamUpdate.is(), "ParameterManager::createOuterParameters: no write access to the inner parameters!" );
401 0 : if ( !m_xInnerParamUpdate.is() )
402 0 : return;
403 :
404 0 : m_pOuterParameters = new param::ParameterWrapperContainer;
405 :
406 : #if OSL_DEBUG_LEVEL > 0
407 : sal_Int32 nSmallestIndexLinkedByColumnName = -1;
408 : sal_Int32 nLargestIndexNotLinkedByColumnName = -1;
409 : #endif
410 0 : for ( ParameterInformation::iterator aParam = m_aParameterInformation.begin();
411 0 : aParam != m_aParameterInformation.end();
412 : ++aParam
413 : )
414 : {
415 : #if OSL_DEBUG_LEVEL > 0
416 : if ( aParam->second.aInnerIndexes.size() )
417 : {
418 : if ( aParam->second.eType == eLinkedByColumnName )
419 : {
420 : if ( nSmallestIndexLinkedByColumnName == -1 )
421 : nSmallestIndexLinkedByColumnName = aParam->second.aInnerIndexes[ 0 ];
422 : }
423 : else
424 : {
425 : nLargestIndexNotLinkedByColumnName = aParam->second.aInnerIndexes[ aParam->second.aInnerIndexes.size() - 1 ];
426 : }
427 : }
428 : #endif
429 0 : if ( aParam->second.eType != eFilledExternally )
430 0 : continue;
431 :
432 : // check which of the parameters have already been visited (e.g. filled via XParameters)
433 0 : size_t nAlreadyVisited = 0;
434 0 : for ( ::std::vector< sal_Int32 >::iterator aIndex = aParam->second.aInnerIndexes.begin();
435 0 : aIndex != aParam->second.aInnerIndexes.end();
436 : ++aIndex
437 : )
438 : {
439 0 : if ( ( m_aParametersVisited.size() > (size_t)*aIndex ) && m_aParametersVisited[ *aIndex ] )
440 : { // exclude this index
441 0 : *aIndex = -1;
442 0 : ++nAlreadyVisited;
443 : }
444 : }
445 0 : if ( nAlreadyVisited == aParam->second.aInnerIndexes.size() )
446 0 : continue;
447 :
448 : // need a wrapper for this .... the "inner parameters" as supplied by a result set don't have a "Value"
449 : // property, but the parameter listeners expect such a property. So we need an object "aggregating"
450 : // xParam and supplying an additional property ("Value")
451 : // (it's no real aggregation of course ...)
452 0 : m_pOuterParameters->push_back( new param::ParameterWrapper( aParam->second.xComposerColumn, m_xInnerParamUpdate, aParam->second.aInnerIndexes ) );
453 : }
454 :
455 : #if OSL_DEBUG_LEVEL > 0
456 : OSL_ENSURE( ( nSmallestIndexLinkedByColumnName == -1 ) || ( nLargestIndexNotLinkedByColumnName == -1 ) ||
457 : ( nSmallestIndexLinkedByColumnName > nLargestIndexNotLinkedByColumnName ),
458 : "ParameterManager::createOuterParameters: inconsistency!" );
459 :
460 : // for the master-detail links, where the detail field denoted a column name, we created an additional ("artificial")
461 : // filter, and *appended* it to all other (potentially) existing filters of the row set. This means that the indexes
462 : // for the parameters resulting from the artificial filter should be larger than any other parameter index, and this
463 : // is what the assertion checks.
464 : // If the assertion fails, then we would need another handling for the "parameters visited" flags, since they're based
465 : // on parameter indexes *without* the artificial filter (because this filter is not visible from the outside).
466 : #endif
467 : }
468 :
469 :
470 12 : void ParameterManager::updateParameterInfo( FilterManager& _rFilterManager )
471 : {
472 : OSL_PRECOND( isAlive(), "ParameterManager::updateParameterInfo: not initialized, or already disposed!" );
473 12 : if ( !isAlive() )
474 12 : return;
475 :
476 12 : clearAllParameterInformation();
477 12 : cacheConnectionInfo();
478 :
479 : // check whether the is based on a statement/query which requires parameters
480 12 : Reference< XPropertySet > xProp = m_xComponent;
481 : OSL_ENSURE(xProp.is(),"Some already released my component!");
482 12 : if ( xProp.is() )
483 : {
484 12 : if ( !initializeComposerByComponent( xProp ) )
485 : { // okay, nothing to do
486 0 : m_bUpToDate = true;
487 0 : return;
488 : } // if ( !initializeComposerByComponent( m_xComponent ) )
489 : }
490 : SAL_WARN_IF( !m_xInnerParamColumns.is(),
491 : "connectivity.commontools",
492 : "ParameterManager::updateParameterInfo: initializeComposerByComponent did nonsense (1)!" );
493 :
494 : // collect all parameters which are defined by the "inner parameters"
495 12 : collectInnerParameters( false );
496 :
497 : // analyze the master-detail relationships
498 12 : bool bColumnsInLinkDetails = false;
499 12 : analyzeFieldLinks( _rFilterManager, bColumnsInLinkDetails );
500 :
501 12 : if ( bColumnsInLinkDetails )
502 : {
503 : // okay, in this case, analyzeFieldLinks modified the "real" filter at the RowSet, to contain
504 : // an additional restriction (which we created ourself)
505 : // So we need to update all information about our inner parameter columns
506 0 : Reference< XPropertySet > xDirectRowSetProps;
507 0 : m_xAggregatedRowSet->queryAggregation( cppu::UnoType<decltype(xDirectRowSetProps)>::get() ) >>= xDirectRowSetProps;
508 0 : OSL_VERIFY( initializeComposerByComponent( xDirectRowSetProps ) );
509 0 : collectInnerParameters( true );
510 : }
511 :
512 12 : if ( !m_nInnerCount )
513 : { // no parameters at all
514 12 : m_bUpToDate = true;
515 12 : return;
516 : }
517 :
518 : // for what now remains as outer parameters, create the wrappers for the single
519 : // parameter columns
520 0 : createOuterParameters();
521 :
522 0 : m_bUpToDate = true;
523 : }
524 :
525 :
526 0 : void ParameterManager::fillLinkedParameters( const Reference< XNameAccess >& _rxParentColumns )
527 : {
528 : OSL_PRECOND( isAlive(), "ParameterManager::fillLinkedParameters: not initialized, or already disposed!" );
529 0 : if ( !isAlive() )
530 0 : return;
531 : OSL_PRECOND( m_xInnerParamColumns.is(), "ParameterManager::fillLinkedParameters: no inner parameters found!" );
532 : OSL_ENSURE ( _rxParentColumns.is(), "ParameterManager::fillLinkedParameters: invalid parent columns!" );
533 :
534 : try
535 : {
536 : // the master and detail field( name)s of the
537 0 : const OUString* pMasterFields = m_aMasterFields.getConstArray();
538 0 : const OUString* pDetailFields = m_aDetailFields.getConstArray();
539 :
540 0 : sal_Int32 nMasterLen = m_aMasterFields.getLength();
541 :
542 : // loop through all master fields. For each of them, get the respective column from the
543 : // parent , and forward its current value as parameter value to the (inner) row set
544 0 : for ( sal_Int32 i = 0; i < nMasterLen; ++i, ++pMasterFields, ++pDetailFields )
545 : {
546 : // does the name denote a valid column in the parent?
547 0 : if ( !_rxParentColumns->hasByName( *pMasterFields ) )
548 : {
549 : SAL_WARN( "connectivity.commontools", "ParameterManager::fillLinkedParameters: invalid master names should have been stripped long before!" );
550 0 : continue;
551 : }
552 :
553 : // do we, for this name, know where to place the values?
554 0 : ParameterInformation::const_iterator aParamInfo = m_aParameterInformation.find( *pDetailFields );
555 0 : if ( ( aParamInfo == m_aParameterInformation.end() )
556 0 : || ( aParamInfo->second.aInnerIndexes.empty() )
557 : )
558 : {
559 : SAL_WARN( "connectivity.commontools", "ParameterManager::fillLinkedParameters: nothing known about this detail field!" );
560 0 : continue;
561 : }
562 :
563 : // the concrete master field
564 0 : Reference< XPropertySet > xMasterField(_rxParentColumns->getByName( *pMasterFields ),UNO_QUERY);
565 :
566 : // the positions where we have to fill in values for the current parameter name
567 0 : for ( ::std::vector< sal_Int32 >::const_iterator aPosition = aParamInfo->second.aInnerIndexes.begin();
568 0 : aPosition != aParamInfo->second.aInnerIndexes.end();
569 : ++aPosition
570 : )
571 : {
572 : // the concrete detail field
573 0 : Reference< XPropertySet > xDetailField(m_xInnerParamColumns->getByIndex( *aPosition ),UNO_QUERY);
574 : OSL_ENSURE( xDetailField.is(), "ParameterManager::fillLinkedParameters: invalid detail field!" );
575 0 : if ( !xDetailField.is() )
576 0 : continue;
577 :
578 : // type and scale of the parameter field
579 0 : sal_Int32 nParamType = DataType::VARCHAR;
580 0 : OSL_VERIFY( xDetailField->getPropertyValue( OMetaConnection::getPropMap().getNameByIndex(PROPERTY_ID_TYPE) ) >>= nParamType );
581 :
582 0 : sal_Int32 nScale = 0;
583 0 : if ( xDetailField->getPropertySetInfo()->hasPropertyByName( OMetaConnection::getPropMap().getNameByIndex(PROPERTY_ID_SCALE) ) )
584 0 : OSL_VERIFY( xDetailField->getPropertyValue( OMetaConnection::getPropMap().getNameByIndex(PROPERTY_ID_SCALE) ) >>= nScale );
585 :
586 : // transfer the param value
587 : try
588 : {
589 0 : m_xInnerParamUpdate->setObjectWithInfo(
590 0 : *aPosition + 1, // parameters are based at 1
591 0 : xMasterField->getPropertyValue( OMetaConnection::getPropMap().getNameByIndex(PROPERTY_ID_VALUE) ),
592 : nParamType,
593 : nScale
594 0 : );
595 : }
596 0 : catch( const Exception& )
597 : {
598 : DBG_UNHANDLED_EXCEPTION();
599 : SAL_WARN( "connectivity.commontools", "ParameterManager::fillLinkedParameters: master-detail parameter number " <<
600 : sal_Int32( *aPosition + 1 ) << " could not be filled!" );
601 : }
602 0 : }
603 0 : }
604 : }
605 0 : catch( const Exception& )
606 : {
607 : DBG_UNHANDLED_EXCEPTION();
608 : }
609 : }
610 :
611 :
612 0 : bool ParameterManager::completeParameters( const Reference< XInteractionHandler >& _rxCompletionHandler, const Reference< XConnection >& _rxConnection )
613 : {
614 : OSL_PRECOND( isAlive(), "ParameterManager::completeParameters: not initialized, or already disposed!" );
615 : OSL_ENSURE ( _rxCompletionHandler.is(), "ParameterManager::completeParameters: invalid interaction handler!" );
616 :
617 : // two continuations (Ok and Cancel)
618 0 : OInteractionAbort* pAbort = new OInteractionAbort;
619 0 : OParameterContinuation* pParams = new OParameterContinuation;
620 :
621 : // the request
622 0 : ParametersRequest aRequest;
623 0 : aRequest.Parameters = m_pOuterParameters.get();
624 0 : aRequest.Connection = _rxConnection;
625 0 : OInteractionRequest* pRequest = new OInteractionRequest( makeAny( aRequest ) );
626 0 : Reference< XInteractionRequest > xRequest( pRequest );
627 :
628 : // some knittings
629 0 : pRequest->addContinuation( pAbort );
630 0 : pRequest->addContinuation( pParams );
631 :
632 : // execute the request
633 : try
634 : {
635 0 : _rxCompletionHandler->handle( xRequest );
636 : }
637 0 : catch( const Exception& )
638 : {
639 : SAL_WARN( "connectivity.commontools", "ParameterManager::completeParameters: caught an exception while calling the handler!" );
640 : }
641 :
642 0 : if ( !pParams->wasSelected() )
643 : // canceled by the user (i.e. (s)he canceled the dialog)
644 0 : return false;
645 :
646 : try
647 : {
648 : // transfer the values from the continuation object to the parameter columns
649 0 : Sequence< PropertyValue > aFinalValues = pParams->getValues();
650 0 : const PropertyValue* pFinalValues = aFinalValues.getConstArray();
651 0 : for ( sal_Int32 i = 0; i < aFinalValues.getLength(); ++i, ++pFinalValues )
652 : {
653 0 : Reference< XPropertySet > xParamColumn(aRequest.Parameters->getByIndex( i ),UNO_QUERY);
654 0 : if ( xParamColumn.is() )
655 : {
656 : #ifdef DBG_UTIL
657 : OUString sName;
658 : xParamColumn->getPropertyValue( OMetaConnection::getPropMap().getNameByIndex(PROPERTY_ID_NAME) ) >>= sName;
659 : OSL_ENSURE( sName == pFinalValues->Name, "ParameterManager::completeParameters: inconsistent parameter names!" );
660 : #endif
661 0 : xParamColumn->setPropertyValue( OMetaConnection::getPropMap().getNameByIndex(PROPERTY_ID_VALUE), pFinalValues->Value );
662 : // the property sets are wrapper classes, translating the Value property into a call to
663 : // the appropriate XParameters interface
664 : }
665 0 : }
666 : }
667 0 : catch( const Exception& )
668 : {
669 : SAL_WARN( "connectivity.commontools", "ParameterManager::completeParameters: caught an exception while propagating the values!" );
670 : }
671 0 : return true;
672 : }
673 :
674 :
675 0 : bool ParameterManager::consultParameterListeners( ::osl::ResettableMutexGuard& _rClearForNotifies )
676 : {
677 0 : bool bCanceled = false;
678 :
679 0 : sal_Int32 nParamsLeft = m_pOuterParameters->getParameters().size();
680 : // TODO: shouldn't we subtract all the parameters which were already visited?
681 0 : if ( nParamsLeft )
682 : {
683 0 : ::cppu::OInterfaceIteratorHelper aIter( m_aParameterListeners );
684 0 : Reference< XPropertySet > xProp = m_xComponent;
685 : OSL_ENSURE(xProp.is(),"Some already released my component!");
686 0 : DatabaseParameterEvent aEvent( xProp.get(), m_pOuterParameters.get() );
687 :
688 0 : _rClearForNotifies.clear();
689 0 : while ( aIter.hasMoreElements() && !bCanceled )
690 0 : bCanceled = !static_cast< XDatabaseParameterListener* >( aIter.next() )->approveParameter( aEvent );
691 0 : _rClearForNotifies.reset();
692 : }
693 :
694 0 : return !bCanceled;
695 : }
696 :
697 :
698 12 : bool ParameterManager::fillParameterValues( const Reference< XInteractionHandler >& _rxCompletionHandler, ::osl::ResettableMutexGuard& _rClearForNotifies )
699 : {
700 : OSL_PRECOND( isAlive(), "ParameterManager::fillParameterValues: not initialized, or already disposed!" );
701 12 : if ( !isAlive() )
702 0 : return true;
703 :
704 12 : if ( m_nInnerCount == 0 )
705 : // no parameters at all
706 12 : return true;
707 :
708 : // fill the parameters from the master-detail relationship
709 0 : Reference< XNameAccess > xParentColumns;
710 0 : if ( getParentColumns( xParentColumns, false ) && xParentColumns->hasElements() && m_aMasterFields.getLength() )
711 0 : fillLinkedParameters( xParentColumns );
712 :
713 : // let the user (via the interaction handler) fill all remaining parameters
714 0 : Reference< XConnection > xConnection;
715 0 : getConnection( xConnection );
716 :
717 0 : if ( _rxCompletionHandler.is() )
718 0 : return completeParameters( _rxCompletionHandler, xConnection );
719 :
720 0 : return consultParameterListeners( _rClearForNotifies );
721 : }
722 :
723 :
724 12 : bool ParameterManager::getConnection( Reference< XConnection >& /* [out] */ _rxConnection )
725 : {
726 : OSL_PRECOND( isAlive(), "ParameterManager::getConnection: not initialized, or already disposed!" );
727 12 : if ( !isAlive() )
728 0 : return false;
729 :
730 12 : _rxConnection.clear();
731 : try
732 : {
733 12 : Reference< XPropertySet > xProp = m_xComponent;
734 : OSL_ENSURE(xProp.is(),"Some already released my component!");
735 12 : if ( xProp.is() )
736 12 : xProp->getPropertyValue( OMetaConnection::getPropMap().getNameByIndex(PROPERTY_ID_ACTIVE_CONNECTION) ) >>= _rxConnection;
737 : }
738 0 : catch( const Exception& )
739 : {
740 : SAL_WARN( "connectivity.commontools", "ParameterManager::getConnection: could not retrieve the connection of the !" );
741 : }
742 12 : return _rxConnection.is();
743 : }
744 :
745 :
746 12 : void ParameterManager::cacheConnectionInfo()
747 : {
748 : try
749 : {
750 12 : Reference< XConnection > xConnection;
751 12 : getConnection( xConnection );
752 24 : Reference< XDatabaseMetaData > xMeta;
753 12 : if ( xConnection.is() )
754 12 : xMeta = xConnection->getMetaData();
755 12 : if ( xMeta.is() )
756 : {
757 12 : m_sIdentifierQuoteString = xMeta->getIdentifierQuoteString();
758 12 : m_sSpecialCharacters = xMeta->getExtraNameCharacters();
759 12 : }
760 : }
761 0 : catch( const Exception& )
762 : {
763 : SAL_WARN( "connectivity.commontools", "ParameterManager::cacheConnectionInfo: caught an exception!" );
764 : }
765 12 : }
766 :
767 :
768 12 : bool ParameterManager::getColumns( Reference< XNameAccess >& /* [out] */ _rxColumns, bool _bFromComposer )
769 : {
770 12 : _rxColumns.clear();
771 :
772 12 : Reference< XColumnsSupplier > xColumnSupp;
773 12 : if ( _bFromComposer )
774 12 : xColumnSupp.set(m_xComposer, css::uno::UNO_QUERY);
775 : else
776 0 : xColumnSupp.set( m_xComponent.get(),UNO_QUERY);
777 12 : if ( xColumnSupp.is() )
778 12 : _rxColumns = xColumnSupp->getColumns();
779 : OSL_ENSURE( _rxColumns.is(), "ParameterManager::getColumns: could not retrieve the columns for the detail !" );
780 :
781 12 : return _rxColumns.is();
782 : }
783 :
784 :
785 12 : bool ParameterManager::getParentColumns( Reference< XNameAccess >& /* [out] */ _out_rxParentColumns, bool _bFromComposer )
786 : {
787 : OSL_PRECOND( isAlive(), "ParameterManager::getParentColumns: not initialized, or already disposed!" );
788 :
789 12 : _out_rxParentColumns.clear();
790 : try
791 : {
792 : // get the parent of the component we're working for
793 12 : Reference< XChild > xAsChild( m_xComponent.get(), UNO_QUERY_THROW );
794 12 : Reference< XPropertySet > xParent( xAsChild->getParent(), UNO_QUERY );
795 12 : if ( !xParent.is() )
796 12 : return false;
797 :
798 : // the columns supplier: either from a composer, or directly from the
799 0 : Reference< XColumnsSupplier > xParentColSupp;
800 0 : if ( _bFromComposer )
801 : {
802 : // re-create the parent composer all the time. Else, we'd have to bother with
803 : // being a listener at its properties, its loaded state, and event the parent-relationship.
804 : m_xParentComposer.reset(
805 : getCurrentSettingsComposer( xParent, m_xContext ),
806 : SharedQueryComposer::TakeOwnership
807 0 : );
808 0 : xParentColSupp.set(m_xParentComposer, css::uno::UNO_QUERY);
809 : }
810 : else
811 0 : xParentColSupp.set(xParent, css::uno::UNO_QUERY);
812 :
813 : // get the columns of the parent
814 0 : if ( xParentColSupp.is() )
815 0 : _out_rxParentColumns = xParentColSupp->getColumns();
816 : }
817 0 : catch( const Exception& )
818 : {
819 : SAL_WARN( "connectivity.commontools", "ParameterManager::getParentColumns: caught an exception!" );
820 : }
821 0 : return _out_rxParentColumns.is();
822 : }
823 :
824 :
825 96 : void ParameterManager::addParameterListener( const Reference< XDatabaseParameterListener >& _rxListener )
826 : {
827 96 : if ( _rxListener.is() )
828 96 : m_aParameterListeners.addInterface( _rxListener );
829 96 : }
830 :
831 :
832 96 : void ParameterManager::removeParameterListener( const Reference< XDatabaseParameterListener >& _rxListener )
833 : {
834 96 : m_aParameterListeners.removeInterface( _rxListener );
835 96 : }
836 :
837 :
838 0 : void ParameterManager::resetParameterValues( )
839 : {
840 : OSL_PRECOND( isAlive(), "ParameterManager::resetParameterValues: not initialized, or already disposed!" );
841 0 : if ( !isAlive() )
842 0 : return;
843 :
844 0 : if ( !m_nInnerCount )
845 : // no parameters at all
846 0 : return;
847 :
848 : try
849 : {
850 0 : Reference< XNameAccess > xColumns;
851 0 : if ( !getColumns( xColumns, false ) )
852 : // already asserted in getColumns
853 0 : return;
854 :
855 0 : Reference< XNameAccess > xParentColumns;
856 0 : if ( !getParentColumns( xParentColumns, false ) )
857 0 : return;
858 :
859 : // loop through all links pairs
860 0 : const OUString* pMasterFields = m_aMasterFields.getConstArray();
861 0 : const OUString* pDetailFields = m_aDetailFields.getConstArray();
862 :
863 0 : Reference< XPropertySet > xMasterField;
864 0 : Reference< XPropertySet > xDetailField;
865 :
866 : // now really ....
867 0 : const OUString* pDetailFieldsEnd = pDetailFields + m_aDetailFields.getLength();
868 0 : for ( ; pDetailFields < pDetailFieldsEnd; ++pDetailFields, ++pMasterFields )
869 : {
870 0 : if ( !xParentColumns->hasByName( *pMasterFields ) )
871 : {
872 : // if this name is unknown in the parent columns, then we don't have a source
873 : // for copying the value to the detail columns
874 : SAL_WARN( "connectivity.commontools", "ParameterManager::resetParameterValues: this should have been stripped long before!" );
875 0 : continue;
876 : }
877 :
878 : // for all inner parameters which are bound to the name as specified by the
879 : // slave element of the link, propagate the value from the master column to this
880 : // parameter column
881 0 : ParameterInformation::const_iterator aParamInfo = m_aParameterInformation.find( *pDetailFields );
882 0 : if ( ( aParamInfo == m_aParameterInformation.end() )
883 0 : || ( aParamInfo->second.aInnerIndexes.empty() )
884 : )
885 : {
886 : SAL_WARN( "connectivity.commontools", "ParameterManager::resetParameterValues: nothing known about this detail field!" );
887 0 : continue;
888 : }
889 :
890 0 : xParentColumns->getByName( *pMasterFields ) >>= xMasterField;
891 0 : if ( !xMasterField.is() )
892 0 : continue;
893 :
894 0 : for ( ::std::vector< sal_Int32 >::const_iterator aPosition = aParamInfo->second.aInnerIndexes.begin();
895 0 : aPosition != aParamInfo->second.aInnerIndexes.end();
896 : ++aPosition
897 : )
898 : {
899 0 : Reference< XPropertySet > xInnerParameter;
900 0 : m_xInnerParamColumns->getByIndex( *aPosition ) >>= xInnerParameter;
901 0 : if ( !xInnerParameter.is() )
902 0 : continue;
903 :
904 0 : OUString sParamColumnRealName;
905 0 : xInnerParameter->getPropertyValue( OMetaConnection::getPropMap().getNameByIndex(PROPERTY_ID_REALNAME) ) >>= sParamColumnRealName;
906 0 : if ( xColumns->hasByName( sParamColumnRealName ) )
907 : { // our own columns have a column which's name equals the real name of the param column
908 : // -> transfer the value property
909 0 : xColumns->getByName( sParamColumnRealName ) >>= xDetailField;
910 0 : if ( xDetailField.is() )
911 0 : xDetailField->setPropertyValue( OMetaConnection::getPropMap().getNameByIndex(PROPERTY_ID_VALUE), xMasterField->getPropertyValue( OMetaConnection::getPropMap().getNameByIndex(PROPERTY_ID_VALUE) ) );
912 : }
913 0 : }
914 0 : }
915 : }
916 0 : catch( const Exception& )
917 : {
918 : SAL_WARN( "connectivity.commontools", "ParameterManager::resetParameterValues: caught an exception!" );
919 : }
920 :
921 : }
922 :
923 :
924 0 : void ParameterManager::externalParameterVisited( sal_Int32 _nIndex )
925 : {
926 0 : if ( m_aParametersVisited.size() < (size_t)_nIndex )
927 : {
928 0 : m_aParametersVisited.reserve( _nIndex );
929 0 : for ( sal_Int32 i = m_aParametersVisited.size(); i < _nIndex; ++i )
930 0 : m_aParametersVisited.push_back( false );
931 : }
932 0 : m_aParametersVisited[ _nIndex - 1 ] = true;
933 0 : }
934 :
935 : #define VISIT_PARAMETER( method ) \
936 : ::osl::MutexGuard aGuard( m_rMutex ); \
937 : OSL_ENSURE( m_xInnerParamUpdate.is(), "ParameterManager::XParameters::setXXX: no XParameters access to the RowSet!" ); \
938 : if ( !m_xInnerParamUpdate.is() ) \
939 : return; \
940 : m_xInnerParamUpdate->method; \
941 : externalParameterVisited( _nIndex ) \
942 :
943 :
944 0 : void ParameterManager::setNull( sal_Int32 _nIndex, sal_Int32 sqlType )
945 : {
946 0 : VISIT_PARAMETER( setNull( _nIndex, sqlType ) );
947 : }
948 :
949 :
950 0 : void ParameterManager::setObjectNull( sal_Int32 _nIndex, sal_Int32 sqlType, const OUString& typeName )
951 : {
952 0 : VISIT_PARAMETER( setObjectNull( _nIndex, sqlType, typeName ) );
953 : }
954 :
955 :
956 0 : void ParameterManager::setBoolean( sal_Int32 _nIndex, bool x )
957 : {
958 0 : VISIT_PARAMETER( setBoolean( _nIndex, x ) );
959 : }
960 :
961 :
962 0 : void ParameterManager::setByte( sal_Int32 _nIndex, sal_Int8 x )
963 : {
964 0 : VISIT_PARAMETER( setByte( _nIndex, x ) );
965 : }
966 :
967 :
968 0 : void ParameterManager::setShort( sal_Int32 _nIndex, sal_Int16 x )
969 : {
970 0 : VISIT_PARAMETER( setShort( _nIndex, x ) );
971 : }
972 :
973 :
974 0 : void ParameterManager::setInt( sal_Int32 _nIndex, sal_Int32 x )
975 : {
976 0 : VISIT_PARAMETER( setInt( _nIndex, x ) );
977 : }
978 :
979 :
980 0 : void ParameterManager::setLong( sal_Int32 _nIndex, sal_Int64 x )
981 : {
982 0 : VISIT_PARAMETER( setLong( _nIndex, x ) );
983 : }
984 :
985 :
986 0 : void ParameterManager::setFloat( sal_Int32 _nIndex, float x )
987 : {
988 0 : VISIT_PARAMETER( setFloat( _nIndex, x ) );
989 : }
990 :
991 :
992 0 : void ParameterManager::setDouble( sal_Int32 _nIndex, double x )
993 : {
994 0 : VISIT_PARAMETER( setDouble( _nIndex, x ) );
995 : }
996 :
997 :
998 0 : void ParameterManager::setString( sal_Int32 _nIndex, const OUString& x )
999 : {
1000 0 : VISIT_PARAMETER( setString( _nIndex, x ) );
1001 : }
1002 :
1003 :
1004 0 : void ParameterManager::setBytes( sal_Int32 _nIndex, const ::com::sun::star::uno::Sequence< sal_Int8 >& x )
1005 : {
1006 0 : VISIT_PARAMETER( setBytes( _nIndex, x ) );
1007 : }
1008 :
1009 :
1010 0 : void ParameterManager::setDate( sal_Int32 _nIndex, const ::com::sun::star::util::Date& x )
1011 : {
1012 0 : VISIT_PARAMETER( setDate( _nIndex, x ) );
1013 : }
1014 :
1015 :
1016 0 : void ParameterManager::setTime( sal_Int32 _nIndex, const ::com::sun::star::util::Time& x )
1017 : {
1018 0 : VISIT_PARAMETER( setTime( _nIndex, x ) );
1019 : }
1020 :
1021 :
1022 0 : void ParameterManager::setTimestamp( sal_Int32 _nIndex, const ::com::sun::star::util::DateTime& x )
1023 : {
1024 0 : VISIT_PARAMETER( setTimestamp( _nIndex, x ) );
1025 : }
1026 :
1027 :
1028 0 : void ParameterManager::setBinaryStream( sal_Int32 _nIndex, const ::com::sun::star::uno::Reference< ::com::sun::star::io::XInputStream>& x, sal_Int32 length )
1029 : {
1030 0 : VISIT_PARAMETER( setBinaryStream( _nIndex, x, length ) );
1031 : }
1032 :
1033 :
1034 0 : void ParameterManager::setCharacterStream( sal_Int32 _nIndex, const ::com::sun::star::uno::Reference< ::com::sun::star::io::XInputStream>& x, sal_Int32 length )
1035 : {
1036 0 : VISIT_PARAMETER( setCharacterStream( _nIndex, x, length ) );
1037 : }
1038 :
1039 :
1040 0 : void ParameterManager::setObject( sal_Int32 _nIndex, const ::com::sun::star::uno::Any& x )
1041 : {
1042 0 : VISIT_PARAMETER( setObject( _nIndex, x ) );
1043 : }
1044 :
1045 :
1046 0 : void ParameterManager::setObjectWithInfo( sal_Int32 _nIndex, const ::com::sun::star::uno::Any& x, sal_Int32 targetSqlType, sal_Int32 scale )
1047 : {
1048 0 : VISIT_PARAMETER( setObjectWithInfo( _nIndex, x, targetSqlType, scale ) );
1049 : }
1050 :
1051 :
1052 0 : void ParameterManager::setRef( sal_Int32 _nIndex, const ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XRef>& x )
1053 : {
1054 0 : VISIT_PARAMETER( setRef( _nIndex, x ) );
1055 : }
1056 :
1057 :
1058 0 : void ParameterManager::setBlob( sal_Int32 _nIndex, const ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XBlob>& x )
1059 : {
1060 0 : VISIT_PARAMETER( setBlob( _nIndex, x ) );
1061 : }
1062 :
1063 :
1064 0 : void ParameterManager::setClob( sal_Int32 _nIndex, const ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XClob>& x )
1065 : {
1066 0 : VISIT_PARAMETER( setClob( _nIndex, x ) );
1067 : }
1068 :
1069 :
1070 0 : void ParameterManager::setArray( sal_Int32 _nIndex, const ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XArray>& x )
1071 : {
1072 0 : VISIT_PARAMETER( setArray( _nIndex, x ) );
1073 : }
1074 :
1075 :
1076 0 : void ParameterManager::clearParameters( )
1077 : {
1078 0 : if ( m_xInnerParamUpdate.is() )
1079 0 : m_xInnerParamUpdate->clearParameters( );
1080 0 : }
1081 :
1082 1 : void SAL_CALL OParameterContinuation::setParameters( const Sequence< PropertyValue >& _rValues ) throw( RuntimeException, std::exception )
1083 : {
1084 1 : m_aValues = _rValues;
1085 1 : }
1086 :
1087 :
1088 : } // namespace frm
1089 :
1090 :
1091 : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|