1 /*************************************************************************
2  *
3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4  *
5  * Copyright 2000, 2010 Oracle and/or its affiliates.
6  *
7  * OpenOffice.org - a multi-platform office productivity suite
8  *
9  * This file is part of OpenOffice.org.
10  *
11  * OpenOffice.org is free software: you can redistribute it and/or modify
12  * it under the terms of the GNU Lesser General Public License version 3
13  * only, as published by the Free Software Foundation.
14  *
15  * OpenOffice.org is distributed in the hope that it will be useful,
16  * but WITHOUT ANY WARRANTY; without even the implied warranty of
17  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
18  * GNU Lesser General Public License version 3 for more details
19  * (a copy is included in the LICENSE file that accompanied this code).
20  *
21  * You should have received a copy of the GNU Lesser General Public License
22  * version 3 along with OpenOffice.org.  If not, see
23  * <http://www.openoffice.org/license.html>
24  * for a copy of the LGPLv3 License.
25  *
26  ************************************************************************/
27 
28 // MARKER(update_precomp.py): autogen include statement, do not remove
29 #include "precompiled_connectivity.hxx"
30 #include "hsqldb/HColumns.hxx"
31 #include "TConnection.hxx"
32 
33 
34 using namespace ::comphelper;
35 using namespace connectivity::hsqldb;
36 using namespace connectivity::sdbcx;
37 using namespace connectivity;
38 using namespace ::com::sun::star::uno;
39 using namespace ::com::sun::star::beans;
40 using namespace ::com::sun::star::sdbcx;
41 using namespace ::com::sun::star::sdbc;
42 using namespace ::com::sun::star::container;
43 using namespace ::com::sun::star::lang;
44 
45 OHSQLColumns::OHSQLColumns(	::cppu::OWeakObject& _rParent
46 								,sal_Bool _bCase
47 								,::osl::Mutex& _rMutex
48 								,const TStringVector &_rVector
49 								,sal_Bool _bUseHardRef
50 			) : OColumnsHelper(_rParent,_bCase,_rMutex,_rVector,_bUseHardRef)
51 {
52 }
53 // -----------------------------------------------------------------------------
54 Reference< XPropertySet > OHSQLColumns::createDescriptor()
55 {
56 	return new OHSQLColumn(sal_True);
57 }
58 // -----------------------------------------------------------------------------
59 // -----------------------------------------------------------------------------
60 OHSQLColumn::OHSQLColumn(	sal_Bool	_bCase)
61 	: connectivity::sdbcx::OColumn(	_bCase )
62 {
63 	construct();
64 }
65 // -------------------------------------------------------------------------
66 void OHSQLColumn::construct()
67 {
68 	m_sAutoIncrement = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("IDENTITY"));
69 	registerProperty(OMetaConnection::getPropMap().getNameByIndex(PROPERTY_ID_AUTOINCREMENTCREATION),PROPERTY_ID_AUTOINCREMENTCREATION,0,&m_sAutoIncrement,	::getCppuType(&m_sAutoIncrement));
70 }
71 // -----------------------------------------------------------------------------
72 ::cppu::IPropertyArrayHelper* OHSQLColumn::createArrayHelper( sal_Int32 /*_nId*/ ) const
73 {
74     return doCreateArrayHelper();
75 }
76 // -----------------------------------------------------------------------------
77 ::cppu::IPropertyArrayHelper & SAL_CALL OHSQLColumn::getInfoHelper()
78 {
79 	return *OHSQLColumn_PROP::getArrayHelper(isNew() ? 1 : 0);
80 }
81 // -----------------------------------------------------------------------------
82 Sequence< ::rtl::OUString > SAL_CALL OHSQLColumn::getSupportedServiceNames(  ) throw(RuntimeException)
83 {
84 	Sequence< ::rtl::OUString > aSupported(1);
85 	aSupported[0] = ::rtl::OUString::createFromAscii("com.sun.star.sdbcx.Column");
86 
87 	return aSupported;
88 }
89 // -----------------------------------------------------------------------------
90