1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*************************************************************************
4 * Effective License of whole file:
6 * This library is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU Lesser General Public
8 * License version 2.1, as published by the Free Software Foundation.
10 * This library is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 * Lesser General Public License for more details.
15 * You should have received a copy of the GNU Lesser General Public
16 * License along with this library; if not, write to the Free Software
17 * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
20 * Parts "Copyright by Sun Microsystems, Inc" prior to August 2011:
22 * The Contents of this file are made available subject to the terms of
23 * the GNU Lesser General Public License Version 2.1
25 * Copyright: 2000 by Sun Microsystems, Inc.
27 * Contributor(s): Joerg Budischewski
29 * All parts contributed on or after August 2011:
31 * Version: MPL 1.1 / GPLv3+ / LGPLv2.1+
33 * The contents of this file are subject to the Mozilla Public License Version
34 * 1.1 (the "License"); you may not use this file except in compliance with
35 * the License or as specified alternatively below. You may obtain a copy of
36 * the License at http://www.mozilla.org/MPL/
38 * Software distributed under the License is distributed on an "AS IS" basis,
39 * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
40 * for the specific language governing rights and limitations under the
43 * Major Contributor(s):
44 * [ Copyright (C) 2011 Lionel Elie Mamane <lionel@mamane.lu> ]
46 * All Rights Reserved.
48 * For minor contributions see the git repository.
50 * Alternatively, the contents of this file may be used under the terms of
51 * either the GNU General Public License Version 3 or later (the "GPLv3+"), or
52 * the GNU Lesser General Public License Version 2.1 or later (the "LGPLv2.1+"),
53 * in which case the provisions of the GPLv3+ or the LGPLv2.1+ are applicable
54 * instead of those above.
56 ************************************************************************/
58 #include <cppuhelper/typeprovider.hxx>
60 #include "pq_xkeycolumn.hxx"
62 using com::sun::star::uno::Any
;
63 using com::sun::star::uno::Reference
;
64 using com::sun::star::uno::RuntimeException
;
65 using com::sun::star::uno::Type
;
66 using com::sun::star::uno::Sequence
;
68 using com::sun::star::beans::XPropertySet
;
70 namespace pq_sdbc_driver
72 KeyColumn::KeyColumn( const ::rtl::Reference
< RefCountedMutex
> & refMutex
,
73 const Reference
< com::sun::star::sdbc::XConnection
> & connection
,
74 ConnectionSettings
*pSettings
)
76 getStatics().refl
.keycolumn
.implName
,
77 getStatics().refl
.keycolumn
.serviceNames
,
81 * getStatics().refl
.keycolumn
.pProps
)
84 Reference
< XPropertySet
> KeyColumn::createDataDescriptor( ) throw (RuntimeException
)
86 KeyColumnDescriptor
* pKeyColumn
= new KeyColumnDescriptor(
87 m_refMutex
, m_conn
, m_pSettings
);
88 pKeyColumn
->copyValuesFrom( this );
90 return Reference
< XPropertySet
> ( pKeyColumn
);
93 KeyColumnDescriptor::KeyColumnDescriptor(
94 const ::rtl::Reference
< RefCountedMutex
> & refMutex
,
95 const Reference
< com::sun::star::sdbc::XConnection
> & connection
,
96 ConnectionSettings
*pSettings
)
98 getStatics().refl
.keycolumnDescriptor
.implName
,
99 getStatics().refl
.keycolumnDescriptor
.serviceNames
,
103 * getStatics().refl
.keycolumnDescriptor
.pProps
)
106 Reference
< XPropertySet
> KeyColumnDescriptor::createDataDescriptor( ) throw (RuntimeException
)
108 KeyColumnDescriptor
* pKeyColumn
= new KeyColumnDescriptor(
109 m_refMutex
, m_conn
, m_pSettings
);
110 pKeyColumn
->copyValuesFrom( this );
112 return Reference
< XPropertySet
> ( pKeyColumn
);