2011-11-17 21:29:14 +01:00
|
|
|
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
|
2011-08-02 16:10:00 +02:00
|
|
|
/*************************************************************************
|
|
|
|
*
|
2011-11-21 11:29:03 +01:00
|
|
|
* Effective License of whole file:
|
2011-08-02 16:10:00 +02:00
|
|
|
*
|
2011-11-21 11:29:03 +01:00
|
|
|
* This library is free software; you can redistribute it and/or
|
|
|
|
* modify it under the terms of the GNU Lesser General Public
|
|
|
|
* License version 2.1, as published by the Free Software Foundation.
|
2011-08-02 16:10:00 +02:00
|
|
|
*
|
2011-11-21 11:29:03 +01:00
|
|
|
* This library is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
|
|
* Lesser General Public License for more details.
|
2011-08-02 16:10:00 +02:00
|
|
|
*
|
2011-11-21 11:29:03 +01:00
|
|
|
* You should have received a copy of the GNU Lesser General Public
|
|
|
|
* License along with this library; if not, write to the Free Software
|
|
|
|
* Foundation, Inc., 59 Temple Place, Suite 330, Boston,
|
|
|
|
* MA 02111-1307 USA
|
2011-08-02 16:10:00 +02:00
|
|
|
*
|
2011-11-21 11:29:03 +01:00
|
|
|
* Parts "Copyright by Sun Microsystems, Inc" prior to August 2011:
|
2011-08-02 16:10:00 +02:00
|
|
|
*
|
2011-11-21 11:29:03 +01:00
|
|
|
* The Contents of this file are made available subject to the terms of
|
|
|
|
* the GNU Lesser General Public License Version 2.1
|
2011-08-02 16:10:00 +02:00
|
|
|
*
|
2011-11-21 11:29:03 +01:00
|
|
|
* Copyright: 2000 by Sun Microsystems, Inc.
|
|
|
|
*
|
|
|
|
* Contributor(s): Joerg Budischewski
|
|
|
|
*
|
|
|
|
* All parts contributed on or after August 2011:
|
|
|
|
*
|
2013-04-24 17:14:03 +01:00
|
|
|
* This Source Code Form is subject to the terms of the Mozilla Public
|
|
|
|
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
|
|
|
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
2011-08-02 16:10:00 +02:00
|
|
|
*
|
|
|
|
************************************************************************/
|
2011-11-21 11:29:03 +01:00
|
|
|
|
2014-04-18 18:41:08 +02:00
|
|
|
#ifndef INCLUDED_CONNECTIVITY_SOURCE_DRIVERS_POSTGRESQL_PQ_STATICS_HXX
|
|
|
|
#define INCLUDED_CONNECTIVITY_SOURCE_DRIVERS_POSTGRESQL_PQ_STATICS_HXX
|
2011-08-02 16:10:00 +02:00
|
|
|
|
2011-09-06 23:13:13 +02:00
|
|
|
#include <boost/unordered_map.hpp>
|
2011-08-02 16:10:00 +02:00
|
|
|
#include <vector>
|
|
|
|
|
|
|
|
#include <com/sun/star/uno/Any.hxx>
|
|
|
|
#include <com/sun/star/uno/Sequence.hxx>
|
|
|
|
#include <com/sun/star/sdbc/DataType.hpp>
|
|
|
|
|
|
|
|
#include <cppuhelper/propshlp.hxx>
|
|
|
|
|
|
|
|
#include "pq_allocator.hxx"
|
|
|
|
|
|
|
|
namespace pq_sdbc_driver
|
|
|
|
{
|
|
|
|
|
|
|
|
struct ColumnMetaData
|
|
|
|
{
|
|
|
|
ColumnMetaData(
|
2013-04-07 12:06:47 +02:00
|
|
|
const OUString &_columnName,
|
|
|
|
const OUString &_tableName,
|
|
|
|
const OUString &_schemaTableName,
|
|
|
|
const OUString &_typeName,
|
2011-08-02 16:10:00 +02:00
|
|
|
sal_Int32 _type,
|
|
|
|
sal_Int32 _precision,
|
|
|
|
sal_Int32 _scale,
|
2014-04-16 09:14:24 +02:00
|
|
|
bool _isCurrency,
|
|
|
|
bool _isNullable,
|
|
|
|
bool _isAutoIncrement,
|
|
|
|
bool _isReadOnly,
|
|
|
|
bool _isSigned ) :
|
2011-08-02 16:10:00 +02:00
|
|
|
columnName( _columnName ),
|
|
|
|
tableName( _tableName ),
|
|
|
|
schemaTableName( _schemaTableName ),
|
|
|
|
typeName( _typeName ),
|
|
|
|
type( _type ),
|
|
|
|
precision( _precision ),
|
|
|
|
scale( _scale ),
|
|
|
|
isCurrency( _isCurrency ),
|
|
|
|
isNullable( _isNullable ),
|
|
|
|
isAutoIncrement( _isAutoIncrement ),
|
|
|
|
isReadOnly( _isReadOnly ),
|
|
|
|
isSigned( _isSigned )
|
|
|
|
{}
|
|
|
|
|
2013-04-07 12:06:47 +02:00
|
|
|
OUString columnName;
|
|
|
|
OUString tableName;
|
|
|
|
OUString schemaTableName;
|
|
|
|
OUString typeName;
|
2011-08-02 16:10:00 +02:00
|
|
|
sal_Int32 type;
|
|
|
|
sal_Int32 precision;
|
|
|
|
sal_Int32 scale;
|
2014-04-16 09:14:24 +02:00
|
|
|
bool isCurrency;
|
|
|
|
bool isNullable;
|
|
|
|
bool isAutoIncrement;
|
|
|
|
bool isReadOnly;
|
|
|
|
bool isSigned;
|
2011-08-02 16:10:00 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
typedef std::vector< ColumnMetaData, Allocator< ColumnMetaData > > ColumnMetaDataVector;
|
|
|
|
|
|
|
|
struct TypeDetails
|
|
|
|
{
|
|
|
|
sal_Int32 dataType;
|
|
|
|
sal_Int32 minScale;
|
|
|
|
sal_Int32 maxScale; // in case nothing is given in getTypeInfo
|
2014-04-16 09:14:24 +02:00
|
|
|
bool isAutoIncrement;
|
|
|
|
bool isSearchable;
|
2011-08-02 16:10:00 +02:00
|
|
|
};
|
|
|
|
|
2011-09-06 23:13:13 +02:00
|
|
|
typedef ::boost::unordered_map
|
2011-08-02 16:10:00 +02:00
|
|
|
<
|
2013-04-07 12:06:47 +02:00
|
|
|
OUString,
|
2011-08-02 16:10:00 +02:00
|
|
|
sal_Int32,
|
2013-04-07 12:06:47 +02:00
|
|
|
OUStringHash,
|
|
|
|
::std::equal_to< OUString >,
|
|
|
|
Allocator< ::std::pair< const OUString , sal_Int32 > >
|
2011-08-02 16:10:00 +02:00
|
|
|
> BaseTypeMap;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
struct ImplementationStatics
|
|
|
|
{
|
|
|
|
ImplementationStatics() :
|
2013-06-16 21:39:19 +02:00
|
|
|
pProps(0)
|
2014-03-10 11:41:06 +01:00
|
|
|
{}
|
2011-08-02 16:10:00 +02:00
|
|
|
|
2013-04-07 12:06:47 +02:00
|
|
|
OUString implName;
|
|
|
|
com::sun::star::uno::Sequence< OUString > serviceNames;
|
2011-08-02 16:10:00 +02:00
|
|
|
cppu::IPropertyArrayHelper *pProps;
|
|
|
|
com::sun::star::uno::Sequence< com::sun::star::uno::Type > types;
|
|
|
|
};
|
|
|
|
|
|
|
|
struct ReflectionImplementations
|
|
|
|
{
|
|
|
|
struct ImplementationStatics table;
|
|
|
|
struct ImplementationStatics tableDescriptor;
|
|
|
|
struct ImplementationStatics column;
|
|
|
|
struct ImplementationStatics columnDescriptor;
|
|
|
|
struct ImplementationStatics key;
|
|
|
|
struct ImplementationStatics keyDescriptor;
|
|
|
|
struct ImplementationStatics keycolumn;
|
|
|
|
struct ImplementationStatics keycolumnDescriptor;
|
|
|
|
struct ImplementationStatics user;
|
|
|
|
struct ImplementationStatics userDescriptor;
|
|
|
|
struct ImplementationStatics view;
|
|
|
|
struct ImplementationStatics viewDescriptor;
|
|
|
|
struct ImplementationStatics index;
|
|
|
|
struct ImplementationStatics indexDescriptor;
|
|
|
|
struct ImplementationStatics indexColumn;
|
|
|
|
struct ImplementationStatics indexColumnDescriptor;
|
|
|
|
|
|
|
|
struct ImplementationStatics updateableResultSet;
|
|
|
|
struct ImplementationStatics resultSet;
|
|
|
|
};
|
|
|
|
|
|
|
|
static const sal_Int32 TABLE_INDEX_CATALOG = 0;
|
|
|
|
static const sal_Int32 TABLE_INDEX_SCHEMA = 1;
|
|
|
|
static const sal_Int32 TABLE_INDEX_NAME = 2;
|
|
|
|
static const sal_Int32 TABLE_INDEX_TYPE = 3;
|
|
|
|
static const sal_Int32 TABLE_INDEX_REMARKS = 4;
|
|
|
|
|
|
|
|
struct Statics
|
|
|
|
{
|
2013-04-07 12:06:47 +02:00
|
|
|
OUString SYSTEM_TABLE;
|
|
|
|
OUString TABLE;
|
|
|
|
OUString VIEW;
|
|
|
|
OUString UNKNOWN;
|
|
|
|
OUString YES;
|
|
|
|
OUString NO;
|
|
|
|
OUString NO_NULLS;
|
|
|
|
OUString NULABLE;
|
|
|
|
OUString NULLABLE_UNKNOWN;
|
|
|
|
OUString SELECT;
|
|
|
|
OUString UPDATE;
|
|
|
|
OUString INSERT;
|
|
|
|
OUString DELETE;
|
|
|
|
OUString RULE;
|
|
|
|
OUString REFERENCES;
|
|
|
|
OUString TRIGGER;
|
|
|
|
OUString EXECUTE;
|
|
|
|
OUString USAGE;
|
|
|
|
OUString CREATE;
|
|
|
|
OUString TEMPORARY;
|
|
|
|
OUString INDEX;
|
|
|
|
OUString INDEX_COLUMN;
|
|
|
|
|
|
|
|
OUString NAME;
|
|
|
|
OUString SCHEMA_NAME;
|
|
|
|
OUString CATALOG_NAME;
|
|
|
|
OUString DESCRIPTION;
|
|
|
|
OUString TYPE;
|
|
|
|
OUString TYPE_NAME;
|
|
|
|
OUString PRIVILEGES;
|
|
|
|
|
|
|
|
OUString DEFAULT_VALUE;
|
|
|
|
OUString IS_AUTO_INCREMENT;
|
|
|
|
OUString IS_CURRENCY;
|
|
|
|
OUString IS_NULLABLE;
|
|
|
|
OUString IS_ROW_VERSISON;
|
|
|
|
OUString PRECISION;
|
|
|
|
OUString SCALE;
|
|
|
|
|
|
|
|
OUString cPERCENT;
|
|
|
|
|
|
|
|
OUString BEGIN;
|
|
|
|
OUString ROLLBACK;
|
|
|
|
OUString COMMIT;
|
|
|
|
|
|
|
|
OUString KEY;
|
|
|
|
OUString REFERENCED_TABLE;
|
|
|
|
OUString UPDATE_RULE;
|
|
|
|
OUString DELETE_RULE;
|
|
|
|
OUString PRIVATE_COLUMNS;
|
|
|
|
OUString PRIVATE_FOREIGN_COLUMNS;
|
|
|
|
|
|
|
|
OUString KEY_COLUMN;
|
|
|
|
OUString RELATED_COLUMN;
|
|
|
|
|
|
|
|
OUString PASSWORD;
|
|
|
|
OUString USER;
|
|
|
|
|
|
|
|
OUString CURSOR_NAME;
|
|
|
|
OUString ESCAPE_PROCESSING;
|
|
|
|
OUString FETCH_DIRECTION;
|
|
|
|
OUString FETCH_SIZE;
|
|
|
|
OUString IS_BOOKMARKABLE;
|
|
|
|
OUString RESULT_SET_CONCURRENCY;
|
|
|
|
OUString RESULT_SET_TYPE;
|
|
|
|
|
|
|
|
OUString COMMAND;
|
|
|
|
OUString CHECK_OPTION;
|
|
|
|
|
|
|
|
OUString TRUE;
|
|
|
|
OUString FALSE;
|
|
|
|
|
|
|
|
OUString IS_PRIMARY_KEY_INDEX;
|
|
|
|
OUString IS_CLUSTERED;
|
|
|
|
OUString IS_UNIQUE;
|
|
|
|
OUString PRIVATE_COLUMN_INDEXES;
|
|
|
|
OUString HELP_TEXT;
|
|
|
|
|
|
|
|
OUString CATALOG;
|
|
|
|
OUString IS_ASCENDING;
|
2011-08-02 16:10:00 +02:00
|
|
|
ReflectionImplementations refl;
|
|
|
|
|
2013-04-07 12:06:47 +02:00
|
|
|
com::sun::star::uno::Sequence< OUString > tablesRowNames;
|
|
|
|
com::sun::star::uno::Sequence< OUString > columnRowNames;
|
|
|
|
com::sun::star::uno::Sequence< OUString > primaryKeyNames;
|
|
|
|
com::sun::star::uno::Sequence< OUString > tablePrivilegesNames;
|
|
|
|
com::sun::star::uno::Sequence< OUString > schemaNames;
|
|
|
|
com::sun::star::uno::Sequence< OUString > tableTypeNames;
|
|
|
|
com::sun::star::uno::Sequence< OUString > typeinfoColumnNames;
|
|
|
|
com::sun::star::uno::Sequence< OUString > indexinfoColumnNames;
|
|
|
|
com::sun::star::uno::Sequence< OUString > importedKeysColumnNames;
|
|
|
|
com::sun::star::uno::Sequence< OUString > resultSetArrayColumnNames;
|
2011-08-02 16:10:00 +02:00
|
|
|
com::sun::star::uno::Sequence< com::sun::star::uno::Sequence< com::sun::star::uno::Any > > tableTypeData;
|
|
|
|
|
|
|
|
ColumnMetaDataVector typeInfoMetaData;
|
|
|
|
BaseTypeMap baseTypeMap;
|
|
|
|
Statics(){}
|
|
|
|
private:
|
|
|
|
Statics( const Statics & );
|
|
|
|
Statics & operator = ( const Statics & );
|
|
|
|
};
|
|
|
|
|
|
|
|
Statics & getStatics();
|
|
|
|
|
|
|
|
}
|
|
|
|
#endif
|
2014-02-18 12:11:15 +00:00
|
|
|
|
|
|
|
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|