merge the formfield patch from ooo-build
[ooovba.git] / connectivity / source / inc / adabas / BTable.hxx
blob8357d96bfd694323f2b2824be4a872fb1ad25537
1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 *
5 * Copyright 2008 by Sun Microsystems, Inc.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * $RCSfile: BTable.hxx,v $
10 * $Revision: 1.16 $
12 * This file is part of OpenOffice.org.
14 * OpenOffice.org is free software: you can redistribute it and/or modify
15 * it under the terms of the GNU Lesser General Public License version 3
16 * only, as published by the Free Software Foundation.
18 * OpenOffice.org is distributed in the hope that it will be useful,
19 * but WITHOUT ANY WARRANTY; without even the implied warranty of
20 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 * GNU Lesser General Public License version 3 for more details
22 * (a copy is included in the LICENSE file that accompanied this code).
24 * You should have received a copy of the GNU Lesser General Public License
25 * version 3 along with OpenOffice.org. If not, see
26 * <http://www.openoffice.org/license.html>
27 * for a copy of the LGPLv3 License.
29 ************************************************************************/
31 #ifndef _CONNECTIVITY_ADABAS_TABLE_HXX_
32 #define _CONNECTIVITY_ADABAS_TABLE_HXX_
34 #include "connectivity/sdbcx/VTable.hxx"
35 #include <com/sun/star/sdbc/XDatabaseMetaData.hpp>
36 #include "adabas/BConnection.hxx"
37 #include "connectivity/TTableHelper.hxx"
39 namespace connectivity
41 namespace adabas
43 typedef connectivity::OTableHelper OTable_TYPEDEF;
45 ::rtl::OUString getTypeString(const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet >& xColProp);
47 class OAdabasTable : public OTableHelper
49 OAdabasConnection* m_pConnection;
50 protected:
51 /** creates the column collection for the table
52 @param _rNames
53 The column names.
55 virtual sdbcx::OCollection* createColumns(const TStringVector& _rNames);
57 /** creates the key collection for the table
58 @param _rNames
59 The key names.
61 virtual sdbcx::OCollection* createKeys(const TStringVector& _rNames);
63 /** creates the index collection for the table
64 @param _rNames
65 The index names.
67 virtual sdbcx::OCollection* createIndexes(const TStringVector& _rNames);
69 public:
70 OAdabasTable( sdbcx::OCollection* _pTables,
71 OAdabasConnection* _pConnection);
72 OAdabasTable( sdbcx::OCollection* _pTables,
73 OAdabasConnection* _pConnection,
74 const ::rtl::OUString& _Name,
75 const ::rtl::OUString& _Type,
76 const ::rtl::OUString& _Description = ::rtl::OUString(),
77 const ::rtl::OUString& _SchemaName = ::rtl::OUString(),
78 const ::rtl::OUString& _CatalogName = ::rtl::OUString()
81 ::rtl::OUString getTableName() const { return m_Name; }
82 ::rtl::OUString getSchema() const { return m_SchemaName; }
84 // com::sun::star::lang::XUnoTunnel
85 virtual sal_Int64 SAL_CALL getSomething( const ::com::sun::star::uno::Sequence< sal_Int8 >& aIdentifier ) throw(::com::sun::star::uno::RuntimeException);
86 static ::com::sun::star::uno::Sequence< sal_Int8 > getUnoTunnelImplementationId();
88 // XAlterTable
89 virtual void SAL_CALL alterColumnByName( const ::rtl::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);
90 // XNamed
91 virtual ::rtl::OUString SAL_CALL getName() throw(::com::sun::star::uno::RuntimeException);
92 /**
93 returns the ALTER TABLE XXX COLUMN statement
95 ::rtl::OUString getAlterTableColumnPart(const ::rtl::OUString& _rsColumnName );
97 // starts a sql transaaction
98 void beginTransAction();
99 // rolls back a sql transaaction
100 void rollbackTransAction();
101 // ends a sql transaaction
102 void endTransAction();
103 // some methods to alter table structures
104 void alterColumnType(const ::rtl::OUString& _rColName,const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet >& _xDescriptor);
105 void alterNotNullValue(sal_Int32 _nNewNullable,const ::rtl::OUString& _rColName);
106 void alterDefaultValue(const ::rtl::OUString& _sNewDefault,const ::rtl::OUString& _rColName);
107 void dropDefaultValue(const ::rtl::OUString& _sNewDefault);
108 void addDefaultValue(const ::rtl::OUString& _sNewDefault,const ::rtl::OUString& _rColName);
112 #endif // _CONNECTIVITY_ADABAS_TABLE_HXX_