bump product version to 5.0.4.1
[LibreOffice.git] / connectivity / source / inc / mysql / YTable.hxx
blob434132890cc641aea0c3462e13b2ae9b0db3eae8
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
3 * This file is part of the LibreOffice project.
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/.
9 * This file incorporates work covered by the following license notice:
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 .
20 #ifndef INCLUDED_CONNECTIVITY_SOURCE_INC_MYSQL_YTABLE_HXX
21 #define INCLUDED_CONNECTIVITY_SOURCE_INC_MYSQL_YTABLE_HXX
23 #include <connectivity/TTableHelper.hxx>
24 #include <com/sun/star/sdbc/XDatabaseMetaData.hpp>
25 #include <comphelper/IdPropArrayHelper.hxx>
27 namespace connectivity
29 namespace mysql
32 OUString getTypeString(const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet >& xColProp);
34 class OMySQLTable;
35 typedef ::comphelper::OIdPropertyArrayUsageHelper< OMySQLTable > OMySQLTable_PROP;
36 class OMySQLTable : public OTableHelper
37 ,public OMySQLTable_PROP
39 sal_Int32 m_nPrivileges; // we have to set our privileges by our own
41 /** executes the statmenmt.
42 @param _rStatement
43 The statement to execute.
45 void executeStatement(const OUString& _rStatement );
46 protected:
48 /** creates the column collection for the table
49 @param _rNames
50 The column names.
52 virtual sdbcx::OCollection* createColumns(const TStringVector& _rNames) SAL_OVERRIDE;
54 /** creates the key collection for the table
55 @param _rNames
56 The key names.
58 virtual sdbcx::OCollection* createKeys(const TStringVector& _rNames) SAL_OVERRIDE;
60 /** creates the index collection for the table
61 @param _rNames
62 The index names.
64 virtual sdbcx::OCollection* createIndexes(const TStringVector& _rNames) SAL_OVERRIDE;
66 /** Returns always "RENAME TABLE " even for views.
68 * \return The start of the rename statement.
69 * @see http://dev.mysql.com/doc/refman/5.1/de/rename-table.html
71 virtual OUString getRenameStart() const SAL_OVERRIDE;
73 /** used to implement the creation of the array helper which is shared amongst all instances of the class.
74 This method needs to be implemented in derived classes.
75 <BR>
76 The method gets called with s_aMutex acquired.
77 <BR>
78 as long as IPropertyArrayHelper has no virtual destructor, the implementation of ~OPropertyArrayUsageHelper
79 assumes that you created an ::cppu::OPropertyArrayHelper when deleting s_pProps.
80 @return an pointer to the newly created array helper. Must not be NULL.
82 virtual ::cppu::IPropertyArrayHelper* createArrayHelper(sal_Int32 nId) const SAL_OVERRIDE;
83 virtual ::cppu::IPropertyArrayHelper & SAL_CALL getInfoHelper() SAL_OVERRIDE;
85 public:
86 OMySQLTable( sdbcx::OCollection* _pTables,
87 const ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XConnection >& _xConnection);
88 OMySQLTable( sdbcx::OCollection* _pTables,
89 const ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XConnection >& _xConnection,
90 const OUString& _Name,
91 const OUString& _Type,
92 const OUString& _Description = OUString(),
93 const OUString& _SchemaName = OUString(),
94 const OUString& _CatalogName = OUString(),
95 sal_Int32 _nPrivileges = 0
98 // ODescriptor
99 virtual void construct() SAL_OVERRIDE;
100 // com::sun::star::lang::XUnoTunnel
101 virtual sal_Int64 SAL_CALL getSomething( const ::com::sun::star::uno::Sequence< sal_Int8 >& aIdentifier ) throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
102 static ::com::sun::star::uno::Sequence< sal_Int8 > getUnoTunnelImplementationId();
104 // XAlterTable
105 virtual void SAL_CALL alterColumnByName( const OUString& colName, const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet >& descriptor ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::container::NoSuchElementException, ::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
106 /** returns the ALTER TABLE XXX statement
108 OUString getAlterTableColumnPart();
110 // some methods to alter table structures
111 void alterColumnType(sal_Int32 nNewType,const OUString& _rColName,const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet >& _xDescriptor);
112 void alterDefaultValue(const OUString& _sNewDefault,const OUString& _rColName);
113 void dropDefaultValue(const OUString& _sNewDefault);
115 virtual OUString getTypeCreatePattern() const SAL_OVERRIDE;
119 #endif // INCLUDED_CONNECTIVITY_SOURCE_INC_MYSQL_YTABLE_HXX
121 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */