Version 7.6.3.2-android, tag libreoffice-7.6.3.2-android
[LibreOffice.git] / connectivity / source / drivers / ado / AGroups.cxx
blob6f7c8b2da8d0c5e533848b4394bb5eb8ba3d563e
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
3 * This file is part of the LibreOffice project.
5 * This Source Code Form is subject to the terms of the Mozilla Public
6 * License, v. 2.0. If a copy of the MPL was not distributed with this
7 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
9 * This file incorporates work covered by the following license notice:
11 * Licensed to the Apache Software Foundation (ASF) under one or more
12 * contributor license agreements. See the NOTICE file distributed
13 * with this work for additional information regarding copyright
14 * ownership. The ASF licenses this file to you under the Apache
15 * License, Version 2.0 (the "License"); you may not use this file
16 * except in compliance with the License. You may obtain a copy of
17 * the License at http://www.apache.org/licenses/LICENSE-2.0 .
20 #include <ado/AGroups.hxx>
21 #include <ado/AGroup.hxx>
22 #include <ado/ATable.hxx>
23 #include <ado/AConnection.hxx>
24 #include <com/sun/star/sdbc/XRow.hpp>
25 #include <com/sun/star/sdbc/XResultSet.hpp>
26 #include <connectivity/sdbcx/IRefreshable.hxx>
27 #include <TConnection.hxx>
28 #include <comphelper/servicehelper.hxx>
29 #include <comphelper/types.hxx>
30 #include <connectivity/dbexception.hxx>
31 #include <strings.hrc>
33 using namespace comphelper;
34 using namespace connectivity;
35 using namespace connectivity::ado;
36 using namespace com::sun::star::uno;
37 using namespace com::sun::star::lang;
38 using namespace com::sun::star::beans;
39 using namespace com::sun::star::sdbc;
40 using namespace com::sun::star::container;
43 sdbcx::ObjectType OGroups::createObject(const OUString& _rName)
45 return new OAdoGroup(m_pCatalog,isCaseSensitive(),_rName);
48 void OGroups::impl_refresh()
50 m_aCollection.Refresh();
53 Reference< XPropertySet > OGroups::createDescriptor()
55 return new OAdoGroup(m_pCatalog,isCaseSensitive());
58 // XAppend
59 sdbcx::ObjectType OGroups::appendObject( const OUString& _rForName, const Reference< XPropertySet >& descriptor )
61 OAdoGroup* pGroup = dynamic_cast<OAdoGroup*>(descriptor.get());
62 if ( pGroup == nullptr )
63 m_pCatalog->getConnection()->throwGenericSQLException( STR_INVALID_GROUP_DESCRIPTOR_ERROR,static_cast<XTypeProvider*>(this) );
65 m_aCollection.Append( pGroup->getImpl() );
66 return createObject( _rForName );
69 // XDrop
70 void OGroups::dropObject(sal_Int32 /*_nPos*/,const OUString& _sElementName)
72 m_aCollection.Delete(_sElementName);
76 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */