Line data Source code
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 : #ifndef INCLUDED_CONNECTIVITY_SOURCE_INC_FDATABASEMETADATARESULTSETMETADATA_HXX
21 : #define INCLUDED_CONNECTIVITY_SOURCE_INC_FDATABASEMETADATARESULTSETMETADATA_HXX
22 :
23 : #include <com/sun/star/sdbc/XResultSetMetaData.hpp>
24 : #include <cppuhelper/implbase1.hxx>
25 : #include <vector>
26 : #include "FDatabaseMetaDataResultSet.hxx"
27 : #include "OColumn.hxx"
28 : #include <connectivity/StdTypeDefs.hxx>
29 : #include <connectivity/dbtoolsdllapi.hxx>
30 :
31 : namespace connectivity
32 : {
33 :
34 : //************ Class: ODatabaseMetaDataResultSetMetaData
35 :
36 : typedef ::cppu::WeakImplHelper1< ::com::sun::star::sdbc::XResultSetMetaData> ODatabaseMetaResultSetMetaData_BASE;
37 :
38 : class OOO_DLLPUBLIC_DBTOOLS ODatabaseMetaDataResultSetMetaData : public ODatabaseMetaResultSetMetaData_BASE
39 : {
40 : TIntVector m_vMapping; // when not every column is needed
41 : ::std::map<sal_Int32,connectivity::OColumn> m_mColumns;
42 : ::std::map<sal_Int32,connectivity::OColumn>::const_iterator m_mColumnsIter;
43 :
44 : protected:
45 : virtual ~ODatabaseMetaDataResultSetMetaData();
46 : public:
47 : // a Constructor, that is needed for when Returning the Object is needed:
48 : // ein Konstruktor, der fuer das Returnen des Objektes benoetigt wird:
49 244 : ODatabaseMetaDataResultSetMetaData( )
50 244 : {
51 244 : }
52 : /// Avoid ambigous cast error from the compiler.
53 : inline operator ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XResultSetMetaData > () throw()
54 : { return this; }
55 :
56 : virtual sal_Int32 SAL_CALL getColumnCount( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
57 : virtual sal_Bool SAL_CALL isAutoIncrement( sal_Int32 column ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
58 : virtual sal_Bool SAL_CALL isCaseSensitive( sal_Int32 column ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
59 : virtual sal_Bool SAL_CALL isSearchable( sal_Int32 column ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
60 : virtual sal_Bool SAL_CALL isCurrency( sal_Int32 column ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
61 : virtual sal_Int32 SAL_CALL isNullable( sal_Int32 column ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
62 : virtual sal_Bool SAL_CALL isSigned( sal_Int32 column ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
63 : virtual sal_Int32 SAL_CALL getColumnDisplaySize( sal_Int32 column ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
64 : virtual OUString SAL_CALL getColumnLabel( sal_Int32 column ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
65 : virtual OUString SAL_CALL getColumnName( sal_Int32 column ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
66 : virtual OUString SAL_CALL getSchemaName( sal_Int32 column ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
67 : virtual sal_Int32 SAL_CALL getPrecision( sal_Int32 column ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
68 : virtual sal_Int32 SAL_CALL getScale( sal_Int32 column ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
69 : virtual OUString SAL_CALL getTableName( sal_Int32 column ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
70 : virtual OUString SAL_CALL getCatalogName( sal_Int32 column ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
71 : virtual sal_Int32 SAL_CALL getColumnType( sal_Int32 column ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
72 : virtual OUString SAL_CALL getColumnTypeName( sal_Int32 column ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
73 : virtual sal_Bool SAL_CALL isReadOnly( sal_Int32 column ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
74 : virtual sal_Bool SAL_CALL isWritable( sal_Int32 column ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
75 : virtual sal_Bool SAL_CALL isDefinitelyWritable( sal_Int32 column ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
76 : virtual OUString SAL_CALL getColumnServiceName( sal_Int32 column ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
77 :
78 : // methods to set the right column mapping
79 : void setColumnPrivilegesMap();
80 : void setColumnMap();
81 : void setColumnsMap();
82 : void setTableNameMap();
83 : void setTablesMap();
84 : void setProcedureColumnsMap();
85 : void setPrimaryKeysMap();
86 : void setIndexInfoMap();
87 : void setTablePrivilegesMap();
88 : void setCrossReferenceMap();
89 : void setTypeInfoMap();
90 : void setProcedureNameMap();
91 : void setProceduresMap();
92 : void setTableTypes();
93 0 : void setBestRowIdentifierMap() { setVersionColumnsMap();}
94 : void setVersionColumnsMap();
95 0 : void setExportedKeysMap() { setCrossReferenceMap(); }
96 0 : void setImportedKeysMap() { setCrossReferenceMap(); }
97 : void setCatalogsMap();
98 : void setSchemasMap();
99 : void setUDTsMap();
100 : };
101 : }
102 : #endif // _CONNECTIVITY_FILE_ADATABASEMETARESULTSETMETADATA_HXX_
103 :
104 :
105 : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|