21#include <com/sun/star/beans/PropertyAttribute.hpp>
22#include <com/sun/star/sdbc/DataType.hpp>
23#include <com/sun/star/sdbc/SQLException.hpp>
24#include <com/sun/star/sdbc/XParameters.hpp>
25#include <com/sun/star/lang/IndexOutOfBoundsException.hpp>
26#include <com/sun/star/lang/WrappedTargetException.hpp>
27#include <com/sun/star/sdb/XParametersSupplier.hpp>
28#include <com/sun/star/sdb/XSingleSelectQueryAnalyzer.hpp>
29#include <com/sun/star/lang/DisposedException.hpp>
35#define PROPERTY_ID_VALUE 1000
42 using ::com::sun::star::uno::Reference;
43 using ::com::sun::star::sdbc::XParameters;
44 using ::com::sun::star::uno::Sequence;
45 using ::com::sun::star::uno::Type;
46 using ::com::sun::star::uno::RuntimeException;
47 using ::com::sun::star::uno::XWeak;
48 using ::com::sun::star::beans::XPropertySet;
49 using ::com::sun::star::beans::XFastPropertySet;
50 using ::com::sun::star::beans::XMultiPropertySet;
51 using ::com::sun::star::beans::XPropertySetInfo;
52 using ::com::sun::star::beans::Property;
53 using ::com::sun::star::uno::Exception;
54 using ::com::sun::star::uno::UNO_QUERY_THROW;
55 using ::com::sun::star::uno::Any;
56 using ::com::sun::star::sdbc::SQLException;
57 using ::com::sun::star::lang::WrappedTargetException;
58 using ::com::sun::star::lang::IndexOutOfBoundsException;
59 using ::com::sun::star::container::XEnumeration;
60 using ::com::sun::star::sdb::XSingleSelectQueryAnalyzer;
61 using ::com::sun::star::sdb::XParametersSupplier;
62 using ::com::sun::star::lang::DisposedException;
64 namespace PropertyAttribute = ::com::sun::star::beans::PropertyAttribute;
65 namespace DataType = ::com::sun::star::sdbc::DataType;
68 :PropertyBase( m_aBHelper )
73 if ( !m_xDelegatorPSI.is() )
79 const Reference< XParameters >& _rxAllParameters, std::vector< sal_Int32 >&& _rIndexes )
80 :PropertyBase( m_aBHelper )
81 ,m_aIndexes( std::move(_rIndexes) )
83 ,m_xValueDestination( _rxAllParameters )
87 if ( !m_xDelegatorPSI.is() )
90 OSL_ENSURE( !m_aIndexes.empty(),
"ParameterWrapper::ParameterWrapper: sure about the indexes?" );
109 a <<= css::uno::Reference<css::lang::XTypeProvider>(
this);
118 return Sequence< Type > {
133 Reference< XPropertySetInfo > xInfo =
const_cast<ParameterWrapper*
>( this )->getPropertySetInfo();
134 const css::uno::Sequence<Property>
aProperties = xInfo->getProperties();
137 if ( rProperty.Handle == _nHandle )
138 return rProperty.Name;
141 OSL_FAIL(
"ParameterWrapper::impl_getPseudoAggregatePropertyName: invalid argument!" );
166 PropertyAttribute::TRANSIENT | PropertyAttribute::MAYBEVOID
182 OSL_ENSURE(
PROPERTY_ID_VALUE ==
nHandle,
"ParameterWrapper::convertFastPropertyValue: the only non-readonly prop should be our PROPERTY_VALUE!" );
186 rConvertedValue = rValue;
198 sal_Int32 nParamType = DataType::VARCHAR;
199 OSL_VERIFY(
m_xDelegator->getPropertyValue(
"Type") >>= nParamType );
201 sal_Int32 nScale = 0;
203 OSL_VERIFY(
m_xDelegator->getPropertyValue(
"Scale") >>= nScale );
216 catch( SQLException& e )
218 WrappedTargetException aExceptionWrapper;
219 aExceptionWrapper.Context = e.Context;
220 aExceptionWrapper.Message = e.Message;
221 aExceptionWrapper.TargetException <<= e;
222 throw aExceptionWrapper;
249 ::osl::MutexGuard aGuard(
m_aMutex );
267 Reference< XParametersSupplier > xSuppParams( _rxComposer, UNO_QUERY_THROW );
268 Reference< XIndexAccess > xParameters( xSuppParams->getParameters(), css::uno::UNO_SET_THROW );
269 sal_Int32 nParamCount( xParameters->getCount() );
271 for ( sal_Int32 i=0;
i<nParamCount; ++
i )
285 std::unique_lock aGuard(
m_aMutex );
293 std::unique_lock aGuard(
m_aMutex );
301 std::unique_lock aGuard(
m_aMutex );
309 std::unique_lock aGuard(
m_aMutex );
313 throw IndexOutOfBoundsException();
321 std::unique_lock aGuard(
m_aMutex );
324 return new ::comphelper::OEnumerationByIndex(
static_cast< XIndexAccess*
>(
this ) );
331 throw DisposedException( OUString(), *
this );
PropertiesInfo aProperties
::cppu::OBroadcastHelper m_aBHelper
css::uno::Any makeAny() const
static css::uno::Reference< css::beans::XPropertySetInfo > SAL_CALL createPropertySetInfo(IPropertyArrayHelper &rProperties)
virtual css::uno::Any SAL_CALL queryInterface(const css::uno::Type &rType) SAL_OVERRIDE
virtual css::uno::Any SAL_CALL queryInterface(const css::uno::Type &rType) SAL_OVERRIDE
css::uno::Type const & get()
#define DBG_UNHANDLED_EXCEPTION(...)
constexpr std::enable_if_t< std::is_signed_v< T >, std::make_unsigned_t< T > > make_unsigned(T value)
IMPLEMENT_GET_IMPLEMENTATION_ID(DrawController)
#define PROPERTY_ID_VALUE
#define IMPLEMENT_FORWARD_REFCOUNT(classname, refcountbase)