1 /*************************************************************************
3 * $RCSfile: pq_statics.hxx,v $
7 * last change: $Author: jbu $ $Date: 2006/01/22 15:14:36 $
9 * The Contents of this file are made available subject to the terms of
10 * either of the following licenses
12 * - GNU Lesser General Public License Version 2.1
13 * - Sun Industry Standards Source License Version 1.1
15 * Sun Microsystems Inc., October, 2000
17 * GNU Lesser General Public License Version 2.1
18 * =============================================
19 * Copyright 2000 by Sun Microsystems, Inc.
20 * 901 San Antonio Road, Palo Alto, CA 94303, USA
22 * This library is free software; you can redistribute it and/or
23 * modify it under the terms of the GNU Lesser General Public
24 * License version 2.1, as published by the Free Software Foundation.
26 * This library is distributed in the hope that it will be useful,
27 * but WITHOUT ANY WARRANTY; without even the implied warranty of
28 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
29 * Lesser General Public License for more details.
31 * You should have received a copy of the GNU Lesser General Public
32 * License along with this library; if not, write to the Free Software
33 * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
37 * Sun Industry Standards Source License Version 1.1
38 * =================================================
39 * The contents of this file are subject to the Sun Industry Standards
40 * Source License Version 1.1 (the "License"); You may not use this file
41 * except in compliance with the License. You may obtain a copy of the
42 * License at http://www.openoffice.org/license.html.
44 * Software provided under this License is provided on an "AS IS" basis,
45 * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
46 * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
47 * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
48 * See the License for the specific provisions governing your rights and
49 * obligations concerning the Software.
51 * The Initial Developer of the Original Code is: Joerg Budischewski
53 * Copyright: 2000 by Sun Microsystems, Inc.
55 * All Rights Reserved.
57 * Contributor(s): Joerg Budischewski
60 ************************************************************************/
61 #ifndef _PQ_STATICS_HXX_
62 #define _PQ_STATICS_HXX_
69 #include <com/sun/star/uno/Any.hxx>
70 #include <com/sun/star/uno/Sequence.hxx>
71 #include <com/sun/star/sdbc/DataType.hpp>
73 #include <cppuhelper/propshlp.hxx>
75 #include "pq_allocator.hxx"
77 namespace pq_sdbc_driver
83 const rtl::OUString
&_columnName
,
84 const rtl::OUString
&_tableName
,
85 const rtl::OUString
&_schemaTableName
,
86 const rtl::OUString
&_typeName
,
92 sal_Bool _isAutoIncrement
,
94 sal_Bool _isSigned
) :
95 columnName( _columnName
),
96 tableName( _tableName
),
97 schemaTableName( _schemaTableName
),
98 typeName( _typeName
),
100 precision( _precision
),
102 isCurrency( _isCurrency
),
103 isNullable( _isNullable
),
104 isAutoIncrement( _isAutoIncrement
),
105 isReadOnly( _isReadOnly
),
106 isSigned( _isSigned
)
109 rtl::OUString columnName
;
110 rtl::OUString tableName
;
111 rtl::OUString schemaTableName
;
112 rtl::OUString typeName
;
118 sal_Bool isAutoIncrement
;
123 typedef std::vector
< ColumnMetaData
, Allocator
< ColumnMetaData
> > ColumnMetaDataVector
;
129 sal_Int32 maxScale
; // in case nothing is given in getTypeInfo
130 sal_Bool isAutoIncrement
;
131 sal_Bool isSearchable
;
134 typedef ::std::hash_map
139 ::std::equal_to
< rtl::OUString
>,
140 Allocator
< ::std::pair
< const ::rtl::OUString
, sal_Int32
> >
145 struct ImplementationStatics
147 ImplementationStatics() :
148 implementationId( 16 )
150 rtl_createUuid( (sal_uInt8
*)implementationId
.getArray(), 0 , sal_False
);
153 rtl::OUString implName
;
154 com::sun::star::uno::Sequence
< ::rtl::OUString
> serviceNames
;
155 com::sun::star::uno::Sequence
< sal_Int8
> implementationId
;
156 cppu::IPropertyArrayHelper
*pProps
;
157 com::sun::star::uno::Sequence
< com::sun::star::uno::Type
> types
;
160 struct ReflectionImplementations
162 struct ImplementationStatics table
;
163 struct ImplementationStatics tableDescriptor
;
164 struct ImplementationStatics column
;
165 struct ImplementationStatics columnDescriptor
;
166 struct ImplementationStatics key
;
167 struct ImplementationStatics keyDescriptor
;
168 struct ImplementationStatics keycolumn
;
169 struct ImplementationStatics keycolumnDescriptor
;
170 struct ImplementationStatics user
;
171 struct ImplementationStatics userDescriptor
;
172 struct ImplementationStatics view
;
173 struct ImplementationStatics viewDescriptor
;
174 struct ImplementationStatics index
;
175 struct ImplementationStatics indexDescriptor
;
176 struct ImplementationStatics indexColumn
;
177 struct ImplementationStatics indexColumnDescriptor
;
179 struct ImplementationStatics updateableResultSet
;
180 struct ImplementationStatics resultSet
;
183 static const sal_Int32 TABLE_INDEX_CATALOG
= 0;
184 static const sal_Int32 TABLE_INDEX_SCHEMA
= 1;
185 static const sal_Int32 TABLE_INDEX_NAME
= 2;
186 static const sal_Int32 TABLE_INDEX_TYPE
= 3;
187 static const sal_Int32 TABLE_INDEX_REMARKS
= 4;
191 ::rtl::OUString SYSTEM_TABLE
;
192 ::rtl::OUString TABLE
;
193 ::rtl::OUString VIEW
;
194 ::rtl::OUString UNKNOWN
;
197 ::rtl::OUString NO_NULLS
;
198 ::rtl::OUString NULABLE
;
199 ::rtl::OUString NULLABLE_UNKNOWN
;
200 ::rtl::OUString SELECT
;
201 ::rtl::OUString UPDATE
;
202 ::rtl::OUString INSERT
;
203 ::rtl::OUString DELETE
;
204 ::rtl::OUString RULE
;
205 ::rtl::OUString REFERENCES
;
206 ::rtl::OUString TRIGGER
;
207 ::rtl::OUString EXECUTE
;
208 ::rtl::OUString USAGE
;
209 ::rtl::OUString CREATE
;
210 ::rtl::OUString TEMPORARY
;
211 ::rtl::OUString INDEX
;
212 ::rtl::OUString INDEX_COLUMN
;
214 ::rtl::OUString NAME
;
215 ::rtl::OUString SCHEMA_NAME
;
216 ::rtl::OUString CATALOG_NAME
;
217 ::rtl::OUString DESCRIPTION
;
218 ::rtl::OUString TYPE
;
219 ::rtl::OUString TYPE_NAME
;
220 ::rtl::OUString PRIVILEGES
;
222 ::rtl::OUString DEFAULT_VALUE
;
223 ::rtl::OUString IS_AUTO_INCREMENT
;
224 ::rtl::OUString IS_CURRENCY
;
225 ::rtl::OUString IS_NULLABLE
;
226 ::rtl::OUString IS_ROW_VERSISON
;
227 ::rtl::OUString PRECISION
;
228 ::rtl::OUString SCALE
;
230 ::rtl::OUString cPERCENT
;
232 ::rtl::OUString BEGIN
;
233 ::rtl::OUString ROLLBACK
;
234 ::rtl::OUString COMMIT
;
237 ::rtl::OUString REFERENCED_TABLE
;
238 ::rtl::OUString UPDATE_RULE
;
239 ::rtl::OUString DELETE_RULE
;
240 ::rtl::OUString PRIVATE_COLUMNS
;
241 ::rtl::OUString PRIVATE_FOREIGN_COLUMNS
;
243 ::rtl::OUString KEY_COLUMN
;
244 ::rtl::OUString RELATED_COLUMN
;
246 ::rtl::OUString PASSWORD
;
247 ::rtl::OUString USER
;
249 ::rtl::OUString CURSOR_NAME
;
250 ::rtl::OUString ESCAPE_PROCESSING
;
251 ::rtl::OUString FETCH_DIRECTION
;
252 ::rtl::OUString FETCH_SIZE
;
253 ::rtl::OUString IS_BOOKMARKABLE
;
254 ::rtl::OUString RESULT_SET_CONCURRENCY
;
255 ::rtl::OUString RESULT_SET_TYPE
;
257 ::rtl::OUString COMMAND
;
258 ::rtl::OUString CHECK_OPTION
;
260 ::rtl::OUString TRUE
;
261 ::rtl::OUString FALSE
;
263 ::rtl::OUString IS_PRIMARY_KEY_INDEX
;
264 ::rtl::OUString IS_CLUSTERED
;
265 ::rtl::OUString IS_UNIQUE
;
266 ::rtl::OUString PRIVATE_COLUMN_INDEXES
;
267 ::rtl::OUString HELP_TEXT
;
269 ::rtl::OUString CATALOG
;
270 ::rtl::OUString IS_ASCENDING
;
271 ReflectionImplementations refl
;
273 com::sun::star::uno::Sequence
< ::rtl::OUString
> tablesRowNames
;
274 com::sun::star::uno::Sequence
< ::rtl::OUString
> columnRowNames
;
275 com::sun::star::uno::Sequence
< ::rtl::OUString
> primaryKeyNames
;
276 com::sun::star::uno::Sequence
< ::rtl::OUString
> tablePrivilegesNames
;
277 com::sun::star::uno::Sequence
< ::rtl::OUString
> schemaNames
;
278 com::sun::star::uno::Sequence
< ::rtl::OUString
> tableTypeNames
;
279 com::sun::star::uno::Sequence
< ::rtl::OUString
> typeinfoColumnNames
;
280 com::sun::star::uno::Sequence
< ::rtl::OUString
> indexinfoColumnNames
;
281 com::sun::star::uno::Sequence
< ::rtl::OUString
> importedKeysColumnNames
;
282 com::sun::star::uno::Sequence
< ::rtl::OUString
> resultSetArrayColumnNames
;
283 com::sun::star::uno::Sequence
< com::sun::star::uno::Sequence
< com::sun::star::uno::Any
> > tableTypeData
;
285 ColumnMetaDataVector typeInfoMetaData
;
286 BaseTypeMap baseTypeMap
;
289 Statics( const Statics
& );
290 Statics
& operator = ( const Statics
& );
293 Statics
& getStatics();