1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*************************************************************************
4 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
6 * Copyright 2000, 2010 Oracle and/or its affiliates.
8 * OpenOffice.org - a multi-platform office productivity suite
10 * This file is part of OpenOffice.org.
12 * OpenOffice.org is free software: you can redistribute it and/or modify
13 * it under the terms of the GNU Lesser General Public License version 3
14 * only, as published by the Free Software Foundation.
16 * OpenOffice.org is distributed in the hope that it will be useful,
17 * but WITHOUT ANY WARRANTY; without even the implied warranty of
18 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19 * GNU Lesser General Public License version 3 for more details
20 * (a copy is included in the LICENSE file that accompanied this code).
22 * You should have received a copy of the GNU Lesser General Public License
23 * version 3 along with OpenOffice.org. If not, see
24 * <http://www.openoffice.org/license.html>
25 * for a copy of the LGPLv3 License.
27 ************************************************************************/
29 #ifndef _CONNECTIVITY_ADO_ADATABASEMETADATARESULTSETMETADATA_HXX_
30 #define _CONNECTIVITY_ADO_ADATABASEMETADATARESULTSETMETADATA_HXX_
32 #include <com/sun/star/sdbc/XResultSetMetaData.hpp>
33 #include <cppuhelper/implbase1.hxx>
37 #include "ado/Awrapado.hxx"
38 #include "ado/ADatabaseMetaDataResultSet.hxx"
39 #include "OColumn.hxx"
41 namespace connectivity
45 //**************************************************************
46 //************ Class: ResultSetMetaData
47 //**************************************************************
48 typedef ::cppu::WeakImplHelper1
< ::com::sun::star::sdbc::XResultSetMetaData
> ODatabaseMetaResultSetMetaData_BASE
;
50 class ODatabaseMetaDataResultSetMetaData
: public ODatabaseMetaResultSetMetaData_BASE
52 friend class ODatabaseMetaDataResultSet
;
54 const ::std::vector
<sal_Int32
> &m_vMapping
; // when not every column is needed
55 ::std::map
<sal_Int32
,connectivity::OColumn
> m_mColumns
;
56 ::std::map
<sal_Int32
,connectivity::OColumn
>::const_iterator m_mColumnsIter
;
58 ADORecordset
* m_pRecordSet
;
59 sal_Int32 m_nColCount
;
62 ODatabaseMetaDataResultSetMetaData( const ODatabaseMetaDataResultSetMetaData
& ); // never implemented
63 ODatabaseMetaDataResultSetMetaData
& operator=( const ODatabaseMetaDataResultSetMetaData
& ); // never implemented
66 void setColumnPrivilegesMap();
69 void setProcedureColumnsMap();
70 void setPrimaryKeysMap();
71 void setIndexInfoMap();
72 void setTablePrivilegesMap();
73 void setCrossReferenceMap();
74 void setTypeInfoMap();
75 void setProceduresMap();
77 // a Constructor, that is needed for when Returning the Object is needed:
78 ODatabaseMetaDataResultSetMetaData( ADORecordset
* _pRecordSet
,ODatabaseMetaDataResultSet
* _pRes
)
79 : m_vMapping(_pRes
->getColumnMapping()),
80 m_pRecordSet(_pRecordSet
),
81 m_nColCount(m_vMapping
.size()-1)
84 m_pRecordSet
->AddRef();
86 ~ODatabaseMetaDataResultSetMetaData();
88 /// Avoid ambigous cast error from the compiler.
89 inline operator ::com::sun::star::uno::Reference
< ::com::sun::star::sdbc::XResultSetMetaData
> () throw()
92 virtual sal_Int32 SAL_CALL
getColumnCount( ) throw(::com::sun::star::sdbc::SQLException
, ::com::sun::star::uno::RuntimeException
);
93 virtual sal_Bool SAL_CALL
isAutoIncrement( sal_Int32 column
) throw(::com::sun::star::sdbc::SQLException
, ::com::sun::star::uno::RuntimeException
);
94 virtual sal_Bool SAL_CALL
isCaseSensitive( sal_Int32 column
) throw(::com::sun::star::sdbc::SQLException
, ::com::sun::star::uno::RuntimeException
);
95 virtual sal_Bool SAL_CALL
isSearchable( sal_Int32 column
) throw(::com::sun::star::sdbc::SQLException
, ::com::sun::star::uno::RuntimeException
);
96 virtual sal_Bool SAL_CALL
isCurrency( sal_Int32 column
) throw(::com::sun::star::sdbc::SQLException
, ::com::sun::star::uno::RuntimeException
);
97 virtual sal_Int32 SAL_CALL
isNullable( sal_Int32 column
) throw(::com::sun::star::sdbc::SQLException
, ::com::sun::star::uno::RuntimeException
);
98 virtual sal_Bool SAL_CALL
isSigned( sal_Int32 column
) throw(::com::sun::star::sdbc::SQLException
, ::com::sun::star::uno::RuntimeException
);
99 virtual sal_Int32 SAL_CALL
getColumnDisplaySize( sal_Int32 column
) throw(::com::sun::star::sdbc::SQLException
, ::com::sun::star::uno::RuntimeException
);
100 virtual ::rtl::OUString SAL_CALL
getColumnLabel( sal_Int32 column
) throw(::com::sun::star::sdbc::SQLException
, ::com::sun::star::uno::RuntimeException
);
101 virtual ::rtl::OUString SAL_CALL
getColumnName( sal_Int32 column
) throw(::com::sun::star::sdbc::SQLException
, ::com::sun::star::uno::RuntimeException
);
102 virtual ::rtl::OUString SAL_CALL
getSchemaName( sal_Int32 column
) throw(::com::sun::star::sdbc::SQLException
, ::com::sun::star::uno::RuntimeException
);
103 virtual sal_Int32 SAL_CALL
getPrecision( sal_Int32 column
) throw(::com::sun::star::sdbc::SQLException
, ::com::sun::star::uno::RuntimeException
);
104 virtual sal_Int32 SAL_CALL
getScale( sal_Int32 column
) throw(::com::sun::star::sdbc::SQLException
, ::com::sun::star::uno::RuntimeException
);
105 virtual ::rtl::OUString SAL_CALL
getTableName( sal_Int32 column
) throw(::com::sun::star::sdbc::SQLException
, ::com::sun::star::uno::RuntimeException
);
106 virtual ::rtl::OUString SAL_CALL
getCatalogName( sal_Int32 column
) throw(::com::sun::star::sdbc::SQLException
, ::com::sun::star::uno::RuntimeException
);
107 virtual sal_Int32 SAL_CALL
getColumnType( sal_Int32 column
) throw(::com::sun::star::sdbc::SQLException
, ::com::sun::star::uno::RuntimeException
);
108 virtual ::rtl::OUString SAL_CALL
getColumnTypeName( sal_Int32 column
) throw(::com::sun::star::sdbc::SQLException
, ::com::sun::star::uno::RuntimeException
);
109 virtual sal_Bool SAL_CALL
isReadOnly( sal_Int32 column
) throw(::com::sun::star::sdbc::SQLException
, ::com::sun::star::uno::RuntimeException
);
110 virtual sal_Bool SAL_CALL
isWritable( sal_Int32 column
) throw(::com::sun::star::sdbc::SQLException
, ::com::sun::star::uno::RuntimeException
);
111 virtual sal_Bool SAL_CALL
isDefinitelyWritable( sal_Int32 column
) throw(::com::sun::star::sdbc::SQLException
, ::com::sun::star::uno::RuntimeException
);
112 virtual ::rtl::OUString SAL_CALL
getColumnServiceName( sal_Int32 column
) throw(::com::sun::star::sdbc::SQLException
, ::com::sun::star::uno::RuntimeException
);
116 #endif // _CONNECTIVITY_ADO_ADATABASEMETARESULTSETMETADATA_HXX_
118 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */