1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5 * Copyright 2008 by Sun Microsystems, Inc.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * $RCSfile: BTable.hxx,v $
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
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
;
51 /** creates the column collection for the table
55 virtual sdbcx::OCollection
* createColumns(const TStringVector
& _rNames
);
57 /** creates the key collection for the table
61 virtual sdbcx::OCollection
* createKeys(const TStringVector
& _rNames
);
63 /** creates the index collection for the table
67 virtual sdbcx::OCollection
* createIndexes(const TStringVector
& _rNames
);
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();
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
);
91 virtual ::rtl::OUString SAL_CALL
getName() throw(::com::sun::star::uno::RuntimeException
);
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_