LibreOffice Module dbaccess (master) 1
TableDeco.cxx
Go to the documentation of this file.
1/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2/*
3 * This file is part of the LibreOffice project.
4 *
5 * This Source Code Form is subject to the terms of the Mozilla Public
6 * License, v. 2.0. If a copy of the MPL was not distributed with this
7 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
8 *
9 * This file incorporates work covered by the following license notice:
10 *
11 * Licensed to the Apache Software Foundation (ASF) under one or more
12 * contributor license agreements. See the NOTICE file distributed
13 * with this work for additional information regarding copyright
14 * ownership. The ASF licenses this file to you under the Apache
15 * License, Version 2.0 (the "License"); you may not use this file
16 * except in compliance with the License. You may obtain a copy of
17 * the License at http://www.apache.org/licenses/LICENSE-2.0 .
18 */
19
20#include <TableDeco.hxx>
21#include <definitioncolumn.hxx>
22#include <stringconstants.hxx>
23#include <strings.hxx>
24#include <core_resource.hxx>
25#include <strings.hrc>
26#include <osl/diagnose.h>
27#include <sal/log.hxx>
28
31#include <com/sun/star/sdbc/SQLException.hpp>
32#include <com/sun/star/sdbc/XConnection.hpp>
33#include <com/sun/star/beans/PropertyAttribute.hpp>
36#include <ContainerMediator.hxx>
37
38using namespace dbaccess;
39using namespace ::com::sun::star::uno;
40using namespace ::com::sun::star::util;
41using namespace ::com::sun::star::lang;
42using namespace ::com::sun::star::beans;
43using namespace ::com::sun::star::sdbc;
44using namespace ::com::sun::star::sdbcx;
45using namespace ::com::sun::star::container;
46using namespace ::osl;
47using namespace ::comphelper;
48using namespace ::dbtools;
49using namespace ::cppu;
50
51// ODBTableDecorator
52
53ODBTableDecorator::ODBTableDecorator( const Reference< XConnection >& _rxConnection, const Reference< XColumnsSupplier >& _rxNewTable,
54 const Reference< XNumberFormatsSupplier >& _rxNumberFormats, const Reference< XNameAccess >& _xColumnDefinitions )
57 ,m_xTable(_rxNewTable)
58 ,m_xColumnDefinitions(_xColumnDefinitions)
59 ,m_xConnection( _rxConnection )
60 ,m_xMetaData( _rxConnection.is() ? _rxConnection->getMetaData() : Reference< XDatabaseMetaData >() )
61 ,m_xNumberFormats( _rxNumberFormats )
62 ,m_nPrivileges(-1)
63{
65}
66
68{
69}
70
72{
73 return css::uno::Sequence<sal_Int8>();
74}
75
76// OComponentHelper
78{
80 OTableDescriptor_BASE::disposing();
81
82 MutexGuard aGuard(m_aMutex);
83 m_xTable = nullptr;
84 m_xMetaData = nullptr;
85 m_xColumnDefinitions = nullptr;
86 m_xNumberFormats = nullptr;
87 if ( m_pColumns )
88 m_pColumns->disposing();
89 m_xColumnMediator = nullptr;
90}
91
93 Any & rConvertedValue,
94 Any & rOldValue,
95 sal_Int32 nHandle,
96 const Any& rValue )
97{
98 bool bRet = true;
99 switch(nHandle)
100 {
105 case PROPERTY_ID_FONT:
128 bRet = ODataSettings::convertFastPropertyValue(rConvertedValue, rOldValue,nHandle,rValue);
129 break;
130
131 default:
132 {
133 Any aValue;
135 bRet = ::comphelper::tryPropertyValue(rConvertedValue,rOldValue,rValue,aValue,::cppu::UnoType<OUString>::get());
136 }
137 break; // we assume that it works
138 }
139 return bRet;
140}
141
142void ODBTableDecorator::setFastPropertyValue_NoBroadcast(sal_Int32 _nHandle, const Any& _rValue)
143{
144 switch(_nHandle)
145 {
147 SAL_WARN("dbaccess", "Property is readonly!");
148 [[fallthrough]];
152 case PROPERTY_ID_FONT:
175
177 break;
179 {
180 Reference<XPropertySet> xProp(m_xTable,UNO_QUERY);
181 xProp->setPropertyValue(PROPERTY_CATALOGNAME,_rValue);
182 }
183 break;
185 {
186 Reference<XPropertySet> xProp(m_xTable,UNO_QUERY);
187 xProp->setPropertyValue(PROPERTY_SCHEMANAME,_rValue);
188 }
189 break;
190 case PROPERTY_ID_NAME:
191 {
192 Reference<XPropertySet> xProp(m_xTable,UNO_QUERY);
193 xProp->setPropertyValue(PROPERTY_NAME,_rValue);
194 }
195 break;
197 {
198 Reference<XPropertySet> xProp(m_xTable,UNO_QUERY);
199 xProp->setPropertyValue(PROPERTY_DESCRIPTION,_rValue);
200 }
201 break;
202 case PROPERTY_ID_TYPE:
203 {
204 Reference<XPropertySet> xProp(m_xTable,UNO_QUERY);
205 xProp->setPropertyValue(PROPERTY_TYPE,_rValue);
206 }
207 break;
208 }
209}
210
211void ODBTableDecorator::getFastPropertyValue(Any& _rValue, sal_Int32 _nHandle) const
212{
213
214 switch(_nHandle)
215 {
217 {
218 if ( -1 == m_nPrivileges )
220 Reference<XPropertySet> xProp(m_xTable,UNO_QUERY);
221 Reference<XPropertySetInfo> xInfo = xProp->getPropertySetInfo();
222 if ( xInfo->hasPropertyByName(PROPERTY_PRIVILEGES) )
223 {
224 _rValue <<= m_nPrivileges;
225 break;
226 }
227 }
228 [[fallthrough]];
229
233 case PROPERTY_ID_FONT:
256 ODataSettings::getFastPropertyValue(_rValue, _nHandle);
257 break;
259 {
260 Reference<XPropertySet> xProp(m_xTable,UNO_QUERY);
261 _rValue = xProp->getPropertyValue(PROPERTY_CATALOGNAME);
262 }
263 break;
265 {
266 Reference<XPropertySet> xProp(m_xTable,UNO_QUERY);
267 _rValue = xProp->getPropertyValue(PROPERTY_SCHEMANAME);
268 }
269 break;
270 case PROPERTY_ID_NAME:
271 {
272 Reference<XPropertySet> xProp(m_xTable,UNO_QUERY);
273 _rValue = xProp->getPropertyValue(PROPERTY_NAME);
274 }
275 break;
277 {
278 Reference<XPropertySet> xProp(m_xTable,UNO_QUERY);
279 _rValue = xProp->getPropertyValue(PROPERTY_DESCRIPTION);
280 }
281 break;
282 case PROPERTY_ID_TYPE:
283 {
284 Reference<XPropertySet> xProp(m_xTable,UNO_QUERY);
285 _rValue = xProp->getPropertyValue(PROPERTY_TYPE);
286 }
287 break;
288 default:
289 SAL_WARN("dbaccess", "Invalid Handle for table");
290 }
291}
292
294{
295 bool bNotFound = true;
296 Reference<XPropertySet> xProp(m_xTable,UNO_QUERY);
297 if ( xProp.is() )
298 {
299 Reference<XPropertySetInfo> xInfo = xProp->getPropertySetInfo();
300 bNotFound = !xInfo->hasPropertyByName(PROPERTY_PRIVILEGES);
301 }
302 if ( bNotFound )
303 registerProperty(PROPERTY_PRIVILEGES, PROPERTY_ID_PRIVILEGES, PropertyAttribute::BOUND | PropertyAttribute::READONLY,
305}
306
308{
309 Reference<XPropertySet> xProp(m_xTable,UNO_QUERY);
310 Reference<XPropertySetInfo> xInfo = xProp->getPropertySetInfo();
311
312 Sequence< Property > aTableProps = xInfo->getProperties();
313 for (Property & prop : asNonConstRange(aTableProps))
314 {
315 if (prop.Name == PROPERTY_CATALOGNAME)
316 prop.Handle = PROPERTY_ID_CATALOGNAME;
317 else if (prop.Name == PROPERTY_SCHEMANAME)
318 prop.Handle = PROPERTY_ID_SCHEMANAME;
319 else if (prop.Name == PROPERTY_NAME)
320 prop.Handle = PROPERTY_ID_NAME;
321 else if (prop.Name == PROPERTY_DESCRIPTION)
322 prop.Handle = PROPERTY_ID_DESCRIPTION;
323 else if (prop.Name == PROPERTY_TYPE)
324 prop.Handle = PROPERTY_ID_TYPE;
325 else if (prop.Name == PROPERTY_PRIVILEGES)
326 prop.Handle = PROPERTY_ID_PRIVILEGES;
327 }
328
329 describeProperties(aTableProps);
330
331 return new ::cppu::OPropertyArrayHelper(aTableProps);
332}
333
335{
336 Reference<XPropertySet> xProp(m_xTable,UNO_QUERY);
337
338 Reference<XPropertySetInfo> xInfo = xProp->getPropertySetInfo();
339 bool bIsDescriptor = (xInfo->getPropertyByName(PROPERTY_NAME).Attributes & PropertyAttribute::READONLY) == 0;
340
341 return *ODBTableDecorator_PROP::getArrayHelper( bIsDescriptor ? 0 : 1 );
342
343 // TODO: this is a HACK, and prone to errors
344 // The OIdPropertyArrayUsageHelper is intended for classes where there exists a known, limited
345 // number of different property set infos (distinguished by the ID), all implemented by this very
346 // same class.
347 // However, in this case here we have an unknown, potentially unlimited number of different
348 // property set infos: Depending on the table for which we act as decorator, different property
349 // sets might exist.
350}
351
352// XServiceInfo
353OUString SAL_CALL ODBTableDecorator::getImplementationName()
354 {
355 return "com.sun.star.sdb.dbaccess.ODBTableDecorator";
356 }
357sal_Bool SAL_CALL ODBTableDecorator::supportsService(const OUString& _rServiceName)
358 {
359 const css::uno::Sequence< OUString > aSupported(getSupportedServiceNames());
360 for (const OUString& s : aSupported)
361 if (s == _rServiceName)
362 return true;
363
364 return false;
365 }
366css::uno::Sequence< OUString > SAL_CALL ODBTableDecorator::getSupportedServiceNames()
367{
368 return { SERVICE_SDBCX_TABLE };
369}
370
371
373{
374 Any aRet;
375 if(m_xTable.is())
376 {
377 aRet = m_xTable->queryInterface(rType);
378 if(aRet.hasValue())
379 { // now we know that our table supports this type so we return ourself
380 aRet = OTableDescriptor_BASE::queryInterface(rType);
381 if(!aRet.hasValue())
382 aRet = ODataSettings::queryInterface(rType);
383 }
384 }
385
386 return aRet;
387}
388
389Sequence< Type > SAL_CALL ODBTableDecorator::getTypes( )
390{
391 Reference<XTypeProvider> xTypes(m_xTable,UNO_QUERY);
392 OSL_ENSURE(xTypes.is(),"Table must be a TypeProvider!");
393 return xTypes->getTypes();
394}
395
396// XRename,
397void SAL_CALL ODBTableDecorator::rename( const OUString& _rNewName )
398{
399 ::osl::MutexGuard aGuard(m_aMutex);
400 ::connectivity::checkDisposed(OTableDescriptor_BASE::rBHelper.bDisposed);
401 Reference<XRename> xRename(m_xTable,UNO_QUERY);
402 if(!xRename.is())
403 throw SQLException(DBA_RES(RID_STR_NO_TABLE_RENAME),*this,SQLSTATE_GENERAL,1000,Any() );
404 // not supported
405 xRename->rename(_rNewName);
406}
407
408// XAlterTable,
409void SAL_CALL ODBTableDecorator::alterColumnByName( const OUString& _rName, const Reference< XPropertySet >& _rxDescriptor )
410{
411 ::osl::MutexGuard aGuard(m_aMutex);
412 ::connectivity::checkDisposed(OTableDescriptor_BASE::rBHelper.bDisposed);
413 Reference<XAlterTable> xAlter(m_xTable,UNO_QUERY);
414 if(!xAlter.is())
415 throw SQLException(DBA_RES(RID_STR_COLUMN_ALTER_BY_NAME),*this,SQLSTATE_GENERAL,1000,Any() );
416 xAlter->alterColumnByName(_rName,_rxDescriptor);
417 if(m_pColumns)
418 m_pColumns->refresh();
419}
420
421void SAL_CALL ODBTableDecorator::alterColumnByIndex( sal_Int32 _nIndex, const Reference< XPropertySet >& _rxDescriptor )
422{
423 ::osl::MutexGuard aGuard(m_aMutex);
424 ::connectivity::checkDisposed(OTableDescriptor_BASE::rBHelper.bDisposed);
425 Reference<XAlterTable> xAlter(m_xTable,UNO_QUERY);
426 if(!xAlter.is())
427 throw SQLException(DBA_RES(RID_STR_COLUMN_ALTER_BY_INDEX),*this,SQLSTATE_GENERAL,1000,Any() );
428 // not supported
429 xAlter->alterColumnByIndex(_nIndex,_rxDescriptor);
430 if(m_pColumns)
431 m_pColumns->refresh();
432}
433
434Reference< XNameAccess> ODBTableDecorator::getIndexes()
435{
436 ::osl::MutexGuard aGuard(m_aMutex);
437 ::connectivity::checkDisposed(OTableDescriptor_BASE::rBHelper.bDisposed);
438 return Reference< XIndexesSupplier>(m_xTable,UNO_QUERY_THROW)->getIndexes();
439}
440
441Reference< XIndexAccess> ODBTableDecorator::getKeys()
442{
443 ::osl::MutexGuard aGuard(m_aMutex);
444 ::connectivity::checkDisposed(OTableDescriptor_BASE::rBHelper.bDisposed);
445 return Reference< XKeysSupplier>(m_xTable,UNO_QUERY_THROW)->getKeys();
446}
447
448Reference< XNameAccess> ODBTableDecorator::getColumns()
449{
450 ::osl::MutexGuard aGuard(m_aMutex);
451 ::connectivity::checkDisposed(OTableDescriptor_BASE::rBHelper.bDisposed);
452
453 if(!m_pColumns)
455
456 return m_pColumns.get();
457}
458
459OUString SAL_CALL ODBTableDecorator::getName()
460{
461 ::osl::MutexGuard aGuard(m_aMutex);
462 ::connectivity::checkDisposed(OTableDescriptor_BASE::rBHelper.bDisposed);
463 Reference<XNamed> xName(m_xTable,UNO_QUERY);
464 OSL_ENSURE(xName.is(),"Table should support the XNamed interface");
465 return xName->getName();
466}
467
468sal_Int64 SAL_CALL ODBTableDecorator::getSomething( const Sequence< sal_Int8 >& rId )
469{
470 if (comphelper::isUnoTunnelId<ODBTableDecorator>(rId))
472
473 sal_Int64 nRet = 0;
474 Reference<XUnoTunnel> xTunnel(m_xTable,UNO_QUERY);
475 if(xTunnel.is())
476 nRet = xTunnel->getSomething(rId);
477 return nRet;
478}
479
480const Sequence< sal_Int8 > & ODBTableDecorator::getUnoTunnelId()
481{
482 static const comphelper::UnoIdInit implId;
483 return implId.getSeq();
484}
485
487{
488 // somebody is asking for the privileges and we do not know them, yet
489 m_nPrivileges = 0;
490 try
491 {
492 Reference<XPropertySet> xProp(m_xTable,UNO_QUERY);
493 if ( xProp.is() )
494 {
495 if ( xProp->getPropertySetInfo()->hasPropertyByName(PROPERTY_PRIVILEGES) )
496 {
497 xProp->getPropertyValue(PROPERTY_PRIVILEGES) >>= m_nPrivileges;
498 }
499 if ( m_nPrivileges == 0 ) // second chance
500 {
501 OUString sCatalog,sSchema,sName;
502 xProp->getPropertyValue(PROPERTY_CATALOGNAME) >>= sCatalog;
503 xProp->getPropertyValue(PROPERTY_SCHEMANAME) >>= sSchema;
504 xProp->getPropertyValue(PROPERTY_NAME) >>= sName;
505 m_nPrivileges = ::dbtools::getTablePrivileges(m_xMetaData, sCatalog,sSchema, sName);
506 }
507 }
508 }
509 catch(const SQLException&)
510 {
511 SAL_WARN("dbaccess", "ODBTableDecorator::ODBTableDecorator : could not collect the privileges !");
512 }
513}
514
515Reference< XPropertySet > SAL_CALL ODBTableDecorator::createDataDescriptor( )
516{
517 ::osl::MutexGuard aGuard(m_aMutex);
518 ::connectivity::checkDisposed(OTableDescriptor_BASE::rBHelper.bDisposed);
519
520 Reference< XDataDescriptorFactory > xFactory( m_xTable, UNO_QUERY );
521 OSL_ENSURE( xFactory.is(), "ODBTableDecorator::createDataDescriptor: invalid table!" );
522 Reference< XColumnsSupplier > xColsSupp;
523 if ( xFactory.is() )
524 xColsSupp.set(xFactory->createDataDescriptor(), css::uno::UNO_QUERY);
525
526 return new ODBTableDecorator(
528 xColsSupp,
530 nullptr
531 );
532}
533
534Reference< css::beans::XPropertySetInfo > SAL_CALL ODBTableDecorator::getPropertySetInfo( )
535{
536 return ::cppu::OPropertySetHelper::createPropertySetInfo(getInfoHelper());
537}
538
540{
541 ::osl::MutexGuard aGuard(m_aMutex);
542 ::connectivity::checkDisposed(OTableDescriptor_BASE::rBHelper.bDisposed);
543
544 std::vector< OUString> aVector;
545
546 Reference<XNameAccess> xNames;
547 if(m_xTable.is())
548 {
549 xNames = m_xTable->getColumns();
550 if(xNames.is())
551 {
552 const Sequence< OUString> aNames = xNames->getElementNames();
553 aVector.insert(aVector.end(), aNames.begin(), aNames.end());
554 }
555 }
556 if(!m_pColumns)
557 {
558 OColumns* pCol = new OColumns(*this,m_aMutex,xNames,m_xMetaData.is() && m_xMetaData->supportsMixedCaseQuotedIdentifiers(),aVector,
559 this,this,
560 m_xMetaData.is() && m_xMetaData->supportsAlterTableWithAddColumn(),
561 m_xMetaData.is() && m_xMetaData->supportsAlterTableWithDropColumn());
562
563 pCol->setParent(*this);
565 m_xColumnMediator = pMediator;
566 pCol->setMediator( pMediator.get() );
567 m_pColumns.reset(pCol);
568 }
569 else
570 m_pColumns->reFill(aVector);
571}
572
574{
576
577 Reference<XNameAccess> xNames;
578 if ( m_xTable.is() )
579 {
580 xNames = m_xTable->getColumns();
581
582 if ( xNames.is() && xNames->hasByName(_rName) )
583 {
584 Reference<XPropertySet> xProp(xNames->getByName(_rName),UNO_QUERY);
585
586 Reference<XPropertySet> xColumnDefinition;
587 if ( m_xColumnDefinitions.is() && m_xColumnDefinitions->hasByName(_rName))
588 xColumnDefinition.set(m_xColumnDefinitions->getByName(_rName),UNO_QUERY);
589
590 pReturn = new OTableColumnWrapper( xProp, xColumnDefinition, false );
591 }
592 }
593 return pReturn;
594}
595
596void ODBTableDecorator::columnAppended( const Reference< XPropertySet >& /*_rxSourceDescriptor*/ )
597{
598 // not interested in
599}
600
601void ODBTableDecorator::columnDropped(const OUString& _sName)
602{
603 Reference<XDrop> xDrop(m_xColumnDefinitions,UNO_QUERY);
604 if ( xDrop.is() && m_xColumnDefinitions->hasByName(_sName) )
605 xDrop->dropByName(_sName);
606}
607
609{
610 Reference<XDataDescriptorFactory> xNames;
611 if(m_xTable.is())
612 xNames.set(m_xTable->getColumns(),UNO_QUERY);
613 Reference< XPropertySet > xRet;
614 if ( xNames.is() )
615 xRet = new OTableColumnDescriptorWrapper( xNames->createDataDescriptor(), false, true );
616 return xRet;
617}
618
619void SAL_CALL ODBTableDecorator::acquire() noexcept
620{
621 OTableDescriptor_BASE::acquire();
622}
623
624void SAL_CALL ODBTableDecorator::release() noexcept
625{
626 OTableDescriptor_BASE::release();
627}
628
629void SAL_CALL ODBTableDecorator::setName( const OUString& /*aName*/ )
630{
631 throwFunctionNotSupportedRuntimeException( "XNamed::setName", *this );
632}
633
634/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
OptionalString sSchema
OptionalString sCatalog
OptionalString sName
::cppu::IPropertyArrayHelper * getArrayHelper(sal_Int32 nId)
void describeProperties(css::uno::Sequence< css::beans::Property > &_rProps) const
void registerProperty(const OUString &_rName, sal_Int32 _nHandle, sal_Int32 _nAttributes, void *_pPointerToMember, const css::uno::Type &_rMemberType)
virtual void SAL_CALL getFastPropertyValue(css::uno::Any &rValue, sal_Int32 nHandle) const override
virtual sal_Bool SAL_CALL convertFastPropertyValue(css::uno::Any &rConvertedValue, css::uno::Any &rOldValue, sal_Int32 nHandle, const css::uno::Any &rValue) override
virtual void SAL_CALL setFastPropertyValue_NoBroadcast(sal_Int32 nHandle, const css::uno::Any &rValue) override
void disposing(std::unique_lock< std::mutex > &rGuard)
virtual css::uno::Any SAL_CALL queryInterface(const css::uno::Type &_rType) override
const css::uno::Sequence< sal_Int8 > & getSeq() const
mutable::osl::Mutex m_aMutex
virtual void SAL_CALL setParent(const css::uno::Reference< css::uno::XInterface > &Parent) override
Definition: column.cxx:406
void setMediator(OContainerMediator *_pMediator)
Definition: column.hxx:157
virtual sal_Bool SAL_CALL convertFastPropertyValue(css::uno::Any &rConvertedValue, css::uno::Any &rOldValue, sal_Int32 nHandle, const css::uno::Any &rValue) override
Definition: TableDeco.cxx:92
virtual ::cppu::IPropertyArrayHelper * createArrayHelper(sal_Int32 _nId) const override
Definition: TableDeco.cxx:307
virtual void SAL_CALL acquire() noexcept override
Definition: TableDeco.cxx:619
virtual css::uno::Reference< css::container::XNameAccess > SAL_CALL getIndexes() override
Definition: TableDeco.cxx:434
virtual void SAL_CALL setName(const OUString &aName) override
Definition: TableDeco.cxx:629
virtual ::cppu::IPropertyArrayHelper &SAL_CALL getInfoHelper() override
Definition: TableDeco.cxx:334
virtual void SAL_CALL release() noexcept override
Definition: TableDeco.cxx:624
virtual css::uno::Sequence< css::uno::Type > SAL_CALL getTypes() override
Definition: TableDeco.cxx:389
static const css::uno::Sequence< sal_Int8 > & getUnoTunnelId()
Definition: TableDeco.cxx:480
virtual css::uno::Reference< css::beans::XPropertySet > createColumnDescriptor() override
creates a column descriptor object.
Definition: TableDeco.cxx:608
css::uno::Reference< css::sdbc::XConnection > m_xConnection
Definition: TableDeco.hxx:67
virtual void refreshColumns() override
Definition: TableDeco.cxx:539
virtual void SAL_CALL rename(const OUString &_rNewName) override
Definition: TableDeco.cxx:397
virtual OUString SAL_CALL getName() override
Definition: TableDeco.cxx:459
virtual void SAL_CALL disposing() override
Definition: TableDeco.cxx:77
css::uno::Reference< css::util::XNumberFormatsSupplier > m_xNumberFormats
Definition: TableDeco.hxx:69
virtual css::uno::Any SAL_CALL queryInterface(const css::uno::Type &rType) override
Definition: TableDeco.cxx:372
css::uno::Reference< css::container::XContainerListener > m_xColumnMediator
Definition: TableDeco.hxx:64
virtual ~ODBTableDecorator() override
Definition: TableDeco.cxx:67
virtual css::uno::Reference< css::container::XNameAccess > SAL_CALL getColumns() override
Definition: TableDeco.cxx:448
css::uno::Reference< css::container::XNameAccess > m_xColumnDefinitions
Definition: TableDeco.hxx:66
ODBTableDecorator(const css::uno::Reference< css::sdbc::XConnection > &_rxConn, const css::uno::Reference< css::sdbcx::XColumnsSupplier > &_rxTable, const css::uno::Reference< css::util::XNumberFormatsSupplier > &_rxNumberFormats, const css::uno::Reference< css::container::XNameAccess > &_rxColumnDefinitions)
constructs a wrapper supporting the com.sun.star.sdb.Table service.
Definition: TableDeco.cxx:53
std::unique_ptr<::connectivity::sdbcx::OCollection > m_pColumns
Definition: TableDeco.hxx:75
virtual rtl::Reference< OColumn > createColumn(const OUString &_rName) const override
creates an OColumn object which should represent the column with a given name
Definition: TableDeco.cxx:573
virtual void SAL_CALL getFastPropertyValue(css::uno::Any &rValue, sal_Int32 nHandle) const override
Definition: TableDeco.cxx:211
virtual void SAL_CALL alterColumnByIndex(sal_Int32 _nIndex, const css::uno::Reference< css::beans::XPropertySet > &_rxDescriptor) override
Definition: TableDeco.cxx:421
virtual void SAL_CALL alterColumnByName(const OUString &_rName, const css::uno::Reference< css::beans::XPropertySet > &_rxDescriptor) override
Definition: TableDeco.cxx:409
css::uno::Reference< css::sdbcx::XColumnsSupplier > m_xTable
Definition: TableDeco.hxx:65
virtual css::uno::Reference< css::beans::XPropertySet > SAL_CALL createDataDescriptor() override
Definition: TableDeco.cxx:515
virtual sal_Int64 SAL_CALL getSomething(const css::uno::Sequence< sal_Int8 > &aIdentifier) override
Definition: TableDeco.cxx:468
virtual void columnAppended(const css::uno::Reference< css::beans::XPropertySet > &_rxSourceDescriptor) override
notifies that a column, created from a column descriptor, has been appended
Definition: TableDeco.cxx:596
css::uno::Reference< css::sdbc::XDatabaseMetaData > m_xMetaData
Definition: TableDeco.hxx:68
virtual void columnDropped(const OUString &_sName) override
notifies that a column with a given name has been dropped
Definition: TableDeco.cxx:601
virtual css::uno::Reference< css::container::XIndexAccess > SAL_CALL getKeys() override
Definition: TableDeco.cxx:441
virtual css::uno::Sequence< sal_Int8 > SAL_CALL getImplementationId() override
Definition: TableDeco.cxx:71
virtual css::uno::Reference< css::beans::XPropertySetInfo > SAL_CALL getPropertySetInfo() override
Definition: TableDeco.cxx:534
virtual void SAL_CALL setFastPropertyValue_NoBroadcast(sal_Int32 nHandle, const css::uno::Any &rValue) override
Definition: TableDeco.cxx:142
void registerPropertiesFor(ODataSettings_Base *_pItem)
register the properties from the param given.
provides the properties for description.
describes all properties for a columns of a table.
#define DBA_RES(id)
Reference< XSingleServiceFactory > xFactory
std::mutex m_aMutex
#define SAL_WARN(area, stream)
sal_Int64 getSomething_cast(void *p)
css::uno::Sequence< OUString > getSupportedServiceNames()
Type
::cppu::WeakComponentImplHelper< css::sdbcx::XColumnsSupplier, css::sdbcx::XKeysSupplier, css::container::XNamed, css::lang::XServiceInfo, css::sdbcx::XDataDescriptorFactory, css::sdbcx::XIndexesSupplier, css::sdbcx::XRename, css::lang::XUnoTunnel, css::sdbcx::XAlterTable > OTableDescriptor_BASE
Definition: TableDeco.hxx:51
void throwFunctionNotSupportedRuntimeException(const OUString &_rFunctionName, const css::uno::Reference< css::uno::XInterface > &_rxContext)
Reference
Reference< XConnection > m_xConnection
Definition: objectnames.cxx:79
sal_Int32 nHandle
#define PROPERTY_ID_FONTFAMILY
#define PROPERTY_ID_NAME
#define PROPERTY_ID_TEXTEMPHASIS
#define PROPERTY_ID_TYPE
#define PROPERTY_ID_TEXTRELIEF
#define PROPERTY_ID_DESCRIPTION
#define PROPERTY_ID_PRIVILEGES
#define PROPERTY_ID_AUTOGROW
#define PROPERTY_ID_CATALOGNAME
#define PROPERTY_ID_FONTWORDLINEMODE
#define PROPERTY_ID_FILTER
#define PROPERTY_ID_FONTHEIGHT
#define PROPERTY_ID_FONTSLANT
#define PROPERTY_ID_FONTSTYLENAME
#define PROPERTY_ID_FONTSTRIKEOUT
#define PROPERTY_ID_FONTUNDERLINE
#define PROPERTY_ID_FONTWIDTH
#define PROPERTY_ID_FONTWEIGHT
#define PROPERTY_ID_SCHEMANAME
#define PROPERTY_ID_FONTNAME
#define PROPERTY_ID_ORDER
#define PROPERTY_ID_FONTTYPE
#define PROPERTY_ID_FONTCHARWIDTH
#define PROPERTY_ID_TEXTLINECOLOR
#define PROPERTY_ID_TEXTCOLOR
#define PROPERTY_ID_FONTKERNING
#define PROPERTY_ID_FONT
#define PROPERTY_ID_FONTORIENTATION
#define PROPERTY_ID_ROW_HEIGHT
#define PROPERTY_ID_FONTPITCH
#define PROPERTY_ID_APPLYFILTER
#define PROPERTY_ID_FONTCHARSET
constexpr OUStringLiteral PROPERTY_SCHEMANAME(u"SchemaName")
constexpr OUStringLiteral PROPERTY_DESCRIPTION(u"Description")
constexpr OUStringLiteral SQLSTATE_GENERAL
Definition: strings.hxx:267
constexpr OUStringLiteral PROPERTY_CATALOGNAME(u"CatalogName")
constexpr OUStringLiteral PROPERTY_TYPE(u"Type")
constexpr OUStringLiteral PROPERTY_NAME(u"Name")
constexpr OUStringLiteral SERVICE_SDBCX_TABLE
Definition: strings.hxx:172
constexpr OUStringLiteral PROPERTY_PRIVILEGES(u"Privileges")
unsigned char sal_Bool