LibreOffice Module connectivity (master) 1
|
#include <YTable.hxx>
Public Member Functions | |
OMySQLTable (sdbcx::OCollection *_pTables, const css::uno::Reference< css::sdbc::XConnection > &_xConnection) | |
OMySQLTable (sdbcx::OCollection *_pTables, const css::uno::Reference< css::sdbc::XConnection > &_xConnection, const OUString &Name, const OUString &Type, const OUString &Description, const OUString &SchemaName, const OUString &CatalogName, sal_Int32 _nPrivileges) | |
virtual void | construct () override |
virtual void SAL_CALL | alterColumnByName (const OUString &colName, const css::uno::Reference< css::beans::XPropertySet > &descriptor) override |
OUString | getAlterTableColumnPart () const |
returns the ALTER TABLE XXX statement More... | |
void | alterColumnType (sal_Int32 nNewType, const OUString &_rColName, const css::uno::Reference< css::beans::XPropertySet > &_xDescriptor) |
void | alterDefaultValue (std::u16string_view _sNewDefault, const OUString &_rColName) |
void | dropDefaultValue (const OUString &_sNewDefault) |
virtual OUString | getTypeCreatePattern () const override |
![]() | |
virtual void | refreshColumns () override |
virtual void | refreshKeys () override |
virtual void | refreshIndexes () override |
const ColumnDesc * | getColumnDescription (const OUString &_sName) const |
OTableHelper (sdbcx::OCollection *_pTables, const css::uno::Reference< css::sdbc::XConnection > &_xConnection, bool _bCase) | |
OTableHelper (sdbcx::OCollection *_pTables, const css::uno::Reference< css::sdbc::XConnection > &_xConnection, bool _bCase, const OUString &Name, const OUString &Type, const OUString &Description=OUString(), const OUString &SchemaName=OUString(), const OUString &CatalogName=OUString()) | |
virtual css::uno::Reference< css::sdbc::XDatabaseMetaData > | getMetaData () const override |
css::uno::Reference< css::sdbc::XConnection > const & | getConnection () const |
virtual void SAL_CALL | rename (const OUString &newName) override |
virtual void SAL_CALL | alterColumnByIndex (sal_Int32 index, const css::uno::Reference< css::beans::XPropertySet > &descriptor) override |
virtual OUString SAL_CALL | getName () override |
const OUString & | getTableName () |
std::shared_ptr< sdbcx::KeyProperties > | getKeyProperties (const OUString &_sName) const |
void | addKey (const OUString &_sName, const std::shared_ptr< sdbcx::KeyProperties > &_aKeyProperties) |
virtual OUString | getTypeCreatePattern () const |
css::uno::Reference< css::sdb::tools::XTableRename > const & | getRenameService () const |
css::uno::Reference< css::sdb::tools::XTableAlteration > const & | getAlterService () const |
css::uno::Reference< css::sdb::tools::XKeyAlteration > const & | getKeyService () const |
css::uno::Reference< css::sdb::tools::XIndexAlteration > const & | getIndexService () const |
![]() | |
OTable (OCollection *_pTables, bool _bCase) | |
OTable (OCollection *_pTables, bool _bCase, const OUString &Name, OUString Type, OUString Description=OUString(), OUString SchemaName=OUString(), OUString CatalogName=OUString()) | |
virtual | ~OTable () override |
DECLARE_SERVICE_INFO () | |
virtual void SAL_CALL | acquire () noexcept override |
virtual void SAL_CALL | release () noexcept override |
virtual css::uno::Any SAL_CALL | queryInterface (const css::uno::Type &rType) override |
virtual css::uno::Sequence< css::uno::Type > SAL_CALL | getTypes () override |
virtual void | construct () override |
virtual void | refreshColumns () override |
virtual void | refreshKeys () |
virtual void | refreshIndexes () |
virtual void SAL_CALL | disposing () override |
virtual css::uno::Reference< css::beans::XPropertySetInfo > SAL_CALL | getPropertySetInfo () override |
virtual css::uno::Reference< css::container::XNameAccess > SAL_CALL | getColumns () override |
virtual css::uno::Reference< css::container::XIndexAccess > SAL_CALL | getKeys () override |
virtual OUString SAL_CALL | getName () override |
virtual void SAL_CALL | setName (const OUString &aName) override |
virtual css::uno::Reference< css::beans::XPropertySet > SAL_CALL | createDataDescriptor () override |
virtual css::uno::Reference< css::container::XNameAccess > SAL_CALL | getIndexes () override |
virtual void SAL_CALL | rename (const OUString &newName) override |
virtual void SAL_CALL | alterColumnByName (const OUString &colName, const css::uno::Reference< css::beans::XPropertySet > &descriptor) override |
virtual void SAL_CALL | alterColumnByIndex (sal_Int32 index, const css::uno::Reference< css::beans::XPropertySet > &descriptor) override |
virtual css::uno::Reference< css::sdbc::XDatabaseMetaData > | getMetaData () const |
![]() | |
virtual css::uno::Any SAL_CALL | queryInterface (css::uno::Type const &rType) SAL_OVERRIDE |
virtual css::uno::Sequence< css::uno::Type > SAL_CALL | getTypes () SAL_OVERRIDE |
virtual css::uno::Sequence< sal_Int8 > SAL_CALL | getImplementationId () SAL_OVERRIDE |
virtual void | refreshColumns ()=0 |
![]() | |
OIdPropertyArrayUsageHelper () | |
virtual | ~OIdPropertyArrayUsageHelper () |
::cppu::IPropertyArrayHelper * | getArrayHelper (sal_Int32 nId) |
![]() | |
ODescriptor (::cppu::OBroadcastHelper &_rBHelper, bool _bCase, bool _bNew=false) | |
virtual | ~ODescriptor () override |
bool | isNew () const |
void | setNew (bool _bNew) |
bool | isCaseSensitive () const |
virtual void | construct () |
virtual css::uno::Sequence< css::uno::Type > SAL_CALL | getTypes () |
![]() | |
virtual | ~OPropertyContainer () |
Protected Member Functions | |
virtual sdbcx::OCollection * | createColumns (const ::std::vector< OUString > &_rNames) override |
creates the column collection for the table More... | |
virtual sdbcx::OCollection * | createKeys (const ::std::vector< OUString > &_rNames) override |
creates the key collection for the table More... | |
virtual sdbcx::OCollection * | createIndexes (const ::std::vector< OUString > &_rNames) override |
creates the index collection for the table More... | |
virtual OUString | getRenameStart () const override |
Returns always "RENAME TABLE " even for views. More... | |
virtual ::cppu::IPropertyArrayHelper * | createArrayHelper (sal_Int32 nId) const override |
used to implement the creation of the array helper which is shared amongst all instances of the class. More... | |
virtual ::cppu::IPropertyArrayHelper &SAL_CALL | getInfoHelper () override |
![]() | |
virtual sdbcx::OCollection * | createColumns (const ::std::vector< OUString > &_rNames)=0 |
creates the column collection for the table More... | |
virtual sdbcx::OCollection * | createKeys (const ::std::vector< OUString > &_rNames)=0 |
creates the key collection for the table More... | |
virtual sdbcx::OCollection * | createIndexes (const ::std::vector< OUString > &_rNames)=0 |
creates the index collection for the table More... | |
virtual void SAL_CALL | disposing () override |
this function is called upon disposing the component More... | |
virtual OUString | getRenameStart () const |
The default returns "RENAME TABLE " or "RENAME VIEW " depending on the type. More... | |
virtual | ~OTableHelper () override |
![]() | |
virtual ::cppu::IPropertyArrayHelper * | createArrayHelper (sal_Int32 _nId) const override |
virtual ::cppu::IPropertyArrayHelper &SAL_CALL | getInfoHelper () override |
![]() | |
~ImplHelper4 () SAL_NOEXCEPT | |
![]() | |
~IRefreshableColumns () | |
virtual ::cppu::IPropertyArrayHelper * | createArrayHelper (sal_Int32 nId) const=0 |
![]() | |
::cppu::IPropertyArrayHelper * | doCreateArrayHelper () const |
helper for derived classes to implement OPropertyArrayUsageHelper::createArrayHelper More... | |
![]() | |
OPropertyContainer (::cppu::OBroadcastHelper &_rBHelper) | |
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 |
virtual void SAL_CALL | getFastPropertyValue (css::uno::Any &rValue, sal_Int32 nHandle) const override |
virtual css::uno::Any SAL_CALL | getFastPropertyValue (sal_Int32 nHandle) override final |
virtual void | getFastPropertyValue (std::unique_lock< std::mutex > &rGuard, css::uno::Any &rValue, sal_Int32 nHandle) const =0 |
virtual void SAL_CALL | setFastPropertyValue (sal_Int32 nHandle, const css::uno::Any &rValue) override final |
![]() | |
OPropertyContainerHelper () | |
~OPropertyContainerHelper () | |
void | registerProperty (const OUString &_rName, sal_Int32 _nHandle, sal_Int32 _nAttributes, void *_pPointerToMember, const css::uno::Type &_rMemberType) |
void | registerMayBeVoidProperty (const OUString &_rName, sal_Int32 _nHandle, sal_Int32 _nAttributes, css::uno::Any *_pPointerToMember, const css::uno::Type &_rExpectedType) |
void | registerPropertyNoMember (const OUString &_rName, sal_Int32 _nHandle, sal_Int32 _nAttributes, const css::uno::Type &_rType, css::uno::Any const &_pInitialValue) |
void | revokeProperty (sal_Int32 _nHandle) |
bool | isRegisteredProperty (sal_Int32 _nHandle) const |
bool | isRegisteredProperty (const OUString &_rName) const |
bool | convertFastPropertyValue (css::uno::Any &rConvertedValue, css::uno::Any &rOldValue, sal_Int32 nHandle, const css::uno::Any &rValue) |
void | setFastPropertyValue (sal_Int32 nHandle, const css::uno::Any &rValue) |
void | getFastPropertyValue (css::uno::Any &rValue, sal_Int32 nHandle) const |
void | describeProperties (css::uno::Sequence< css::beans::Property > &_rProps) const |
const css::beans::Property & | getProperty (const OUString &_rName) const |
Private Member Functions | |
void | executeStatement (const OUString &_rStatement) |
executes the statement. More... | |
Private Attributes | |
sal_Int32 | m_nPrivileges |
Additional Inherited Members | |
![]() | |
static bool | isNew (const css::uno::Reference< css::uno::XInterface > &_rxDescriptor) |
![]() | |
static css::uno::Sequence< css::uno::Type > | getBaseTypes () |
![]() | |
OUString | m_CatalogName |
OUString | m_SchemaName |
OUString | m_Description |
OUString | m_Type |
std::unique_ptr< OCollection > | m_xKeys |
std::unique_ptr< OCollection > | m_xColumns |
std::unique_ptr< OCollection > | m_xIndexes |
OCollection * | m_pTables |
![]() | |
mutable::osl::Mutex | m_aMutex |
![]() | |
OUString | m_Name |
Definition at line 34 of file YTable.hxx.
connectivity::mysql::OMySQLTable::OMySQLTable | ( | sdbcx::OCollection * | _pTables, |
const css::uno::Reference< css::sdbc::XConnection > & | _xConnection | ||
) |
connectivity::mysql::OMySQLTable::OMySQLTable | ( | sdbcx::OCollection * | _pTables, |
const css::uno::Reference< css::sdbc::XConnection > & | _xConnection, | ||
const OUString & | Name, | ||
const OUString & | Type, | ||
const OUString & | Description, | ||
const OUString & | SchemaName, | ||
const OUString & | CatalogName, | ||
sal_Int32 | _nPrivileges | ||
) |
|
overridevirtual |
Reimplemented from connectivity::sdbcx::OTable.
Definition at line 120 of file YTable.cxx.
References connectivity::mysql::OTables::adjustSQL(), alterColumnType(), alterDefaultValue(), Any, bAutoIncrement, connectivity::checkDisposed(), dbtools::createStandardColumnPart(), dropDefaultValue(), executeStatement(), getAlterTableColumnPart(), connectivity::OTableHelper::getConnection(), connectivity::OTableHelper::getMetaData(), dbtools::OPropertyMap::getNameByIndex(), connectivity::OMetaConnection::getPropMap(), getTypeCreatePattern(), connectivity::sdbcx::ODescriptor::isNew(), cppu::BaseMutex::m_aMutex, connectivity::sdbcx::OTable::m_pTables, connectivity::sdbcx::OTable::m_xColumns, nIndex, PROPERTY_ID_DEFAULTVALUE, PROPERTY_ID_DESCRIPTION, PROPERTY_ID_ISAUTOINCREMENT, PROPERTY_ID_ISNULLABLE, PROPERTY_ID_NAME, PROPERTY_ID_PRECISION, PROPERTY_ID_SCALE, PROPERTY_ID_TYPE, PROPERTY_ID_TYPENAME, dbtools::quoteName(), and sQuote.
void OMySQLTable::alterColumnType | ( | sal_Int32 | nNewType, |
const OUString & | _rColName, | ||
const css::uno::Reference< css::beans::XPropertySet > & | _xDescriptor | ||
) |
Definition at line 248 of file YTable.cxx.
References connectivity::mysql::OTables::adjustSQL(), Any, dbtools::createStandardColumnPart(), executeStatement(), getAlterTableColumnPart(), connectivity::OTableHelper::getConnection(), connectivity::OTableHelper::getMetaData(), connectivity::OMetaConnection::getPropMap(), getTypeCreatePattern(), connectivity::sdbcx::OTable::m_pTables, PROPERTY_ID_TYPE, dbtools::quoteName(), and sQuote.
Referenced by alterColumnByName().
void OMySQLTable::alterDefaultValue | ( | std::u16string_view | _sNewDefault, |
const OUString & | _rColName | ||
) |
Definition at line 267 of file YTable.cxx.
References executeStatement(), getAlterTableColumnPart(), connectivity::OTableHelper::getMetaData(), dbtools::quoteName(), and sQuote.
Referenced by alterColumnByName().
|
overridevirtual |
Reimplemented from connectivity::sdbcx::OTable.
Definition at line 83 of file YTable.cxx.
References connectivity::sdbcx::OTable::construct(), connectivity::OMetaConnection::getPropMap(), connectivity::sdbcx::ODescriptor::isNew(), m_nPrivileges, PROPERTY_ID_PRIVILEGES, and comphelper::OPropertyContainerHelper::registerProperty().
|
overrideprotectedvirtual |
used to implement the creation of the array helper which is shared amongst all instances of the class.
This method needs to be implemented in derived classes.
The method gets called with s_aMutex acquired.
Implements comphelper::OIdPropertyArrayUsageHelper< class TYPE >.
Definition at line 92 of file YTable.cxx.
References connectivity::sdbcx::ODescriptor::doCreateArrayHelper().
|
overrideprotectedvirtual |
creates the column collection for the table
_rNames | The column names. |
Implements connectivity::OTableHelper.
Definition at line 102 of file YTable.cxx.
References cppu::BaseMutex::m_aMutex, and connectivity::OColumnsHelper::setParent().
|
overrideprotectedvirtual |
creates the index collection for the table
_rNames | The index names. |
Implements connectivity::OTableHelper.
Definition at line 114 of file YTable.cxx.
References cppu::BaseMutex::m_aMutex.
|
overrideprotectedvirtual |
creates the key collection for the table
_rNames | The key names. |
Implements connectivity::OTableHelper.
Definition at line 109 of file YTable.cxx.
References cppu::BaseMutex::m_aMutex.
void OMySQLTable::dropDefaultValue | ( | const OUString & | _sNewDefault | ) |
Definition at line 276 of file YTable.cxx.
References executeStatement(), getAlterTableColumnPart(), connectivity::OTableHelper::getMetaData(), dbtools::quoteName(), and sQuote.
Referenced by alterColumnByName().
|
private |
executes the statement.
_rStatement | The statement to execute. |
Definition at line 297 of file YTable.cxx.
References connectivity::OTableHelper::getConnection(), and u.
Referenced by alterColumnByName(), alterColumnType(), alterDefaultValue(), and dropDefaultValue().
OUString OMySQLTable::getAlterTableColumnPart | ( | ) | const |
returns the ALTER TABLE XXX statement
Definition at line 285 of file YTable.cxx.
References dbtools::composeTableName(), connectivity::OTableHelper::getMetaData(), connectivity::sdbcx::OTable::m_CatalogName, connectivity::sdbcx::ODescriptor::m_Name, connectivity::sdbcx::OTable::m_SchemaName, and sComposedName.
Referenced by alterColumnByName(), alterColumnType(), alterDefaultValue(), and dropDefaultValue().
|
overrideprotected |
Definition at line 97 of file YTable.cxx.
References comphelper::OIdPropertyArrayUsageHelper< class TYPE >::getArrayHelper(), and connectivity::sdbcx::ODescriptor::isNew().
|
overrideprotectedvirtual |
Returns always "RENAME TABLE " even for views.
Reimplemented from connectivity::OTableHelper.
Definition at line 311 of file YTable.cxx.
|
overridevirtual |
Reimplemented from connectivity::OTableHelper.
Definition at line 265 of file YTable.cxx.
Referenced by alterColumnByName(), and alterColumnType().
|
private |
Definition at line 37 of file YTable.hxx.
Referenced by construct().