1 /**************************************************************
2  *
3  * Licensed to the Apache Software Foundation (ASF) under one
4  * or more contributor license agreements.  See the NOTICE file
5  * distributed with this work for additional information
6  * regarding copyright ownership.  The ASF licenses this file
7  * to you under the Apache License, Version 2.0 (the
8  * "License"); you may not use this file except in compliance
9  * with the License.  You may obtain a copy of the License at
10  *
11  *   http://www.apache.org/licenses/LICENSE-2.0
12  *
13  * Unless required by applicable law or agreed to in writing,
14  * software distributed under the License is distributed on an
15  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16  * KIND, either express or implied.  See the License for the
17  * specific language governing permissions and limitations
18  * under the License.
19  *
20  *************************************************************/
21 
22 
23 
24 // MARKER(update_precomp.py): autogen include statement, do not remove
25 #include "precompiled_connectivity.hxx"
26 #include "hsqldb/HColumns.hxx"
27 #include "TConnection.hxx"
28 
29 
30 using namespace ::comphelper;
31 using namespace connectivity::hsqldb;
32 using namespace connectivity::sdbcx;
33 using namespace connectivity;
34 using namespace ::com::sun::star::uno;
35 using namespace ::com::sun::star::beans;
36 using namespace ::com::sun::star::sdbcx;
37 using namespace ::com::sun::star::sdbc;
38 using namespace ::com::sun::star::container;
39 using namespace ::com::sun::star::lang;
40 
OHSQLColumns(::cppu::OWeakObject & _rParent,sal_Bool _bCase,::osl::Mutex & _rMutex,const TStringVector & _rVector,sal_Bool _bUseHardRef)41 OHSQLColumns::OHSQLColumns(	::cppu::OWeakObject& _rParent
42 								,sal_Bool _bCase
43 								,::osl::Mutex& _rMutex
44 								,const TStringVector &_rVector
45 								,sal_Bool _bUseHardRef
46 			) : OColumnsHelper(_rParent,_bCase,_rMutex,_rVector,_bUseHardRef)
47 {
48 }
49 // -----------------------------------------------------------------------------
createDescriptor()50 Reference< XPropertySet > OHSQLColumns::createDescriptor()
51 {
52 	return new OHSQLColumn(sal_True);
53 }
54 // -----------------------------------------------------------------------------
55 // -----------------------------------------------------------------------------
OHSQLColumn(sal_Bool _bCase)56 OHSQLColumn::OHSQLColumn(	sal_Bool	_bCase)
57 	: connectivity::sdbcx::OColumn(	_bCase )
58 {
59 	construct();
60 }
61 // -------------------------------------------------------------------------
construct()62 void OHSQLColumn::construct()
63 {
64 	m_sAutoIncrement = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("IDENTITY"));
65 	registerProperty(OMetaConnection::getPropMap().getNameByIndex(PROPERTY_ID_AUTOINCREMENTCREATION),PROPERTY_ID_AUTOINCREMENTCREATION,0,&m_sAutoIncrement,	::getCppuType(&m_sAutoIncrement));
66 }
67 // -----------------------------------------------------------------------------
createArrayHelper(sal_Int32) const68 ::cppu::IPropertyArrayHelper* OHSQLColumn::createArrayHelper( sal_Int32 /*_nId*/ ) const
69 {
70     return doCreateArrayHelper();
71 }
72 // -----------------------------------------------------------------------------
getInfoHelper()73 ::cppu::IPropertyArrayHelper & SAL_CALL OHSQLColumn::getInfoHelper()
74 {
75 	return *OHSQLColumn_PROP::getArrayHelper(isNew() ? 1 : 0);
76 }
77 // -----------------------------------------------------------------------------
getSupportedServiceNames()78 Sequence< ::rtl::OUString > SAL_CALL OHSQLColumn::getSupportedServiceNames(  ) throw(RuntimeException)
79 {
80 	Sequence< ::rtl::OUString > aSupported(1);
81 	aSupported[0] = ::rtl::OUString::createFromAscii("com.sun.star.sdbcx.Column");
82 
83 	return aSupported;
84 }
85 // -----------------------------------------------------------------------------
86