2010-10-12 15:53:47 +02:00
|
|
|
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
|
2012-06-12 22:04:38 +01:00
|
|
|
/*
|
|
|
|
* This file is part of the LibreOffice project.
|
|
|
|
*
|
|
|
|
* 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/.
|
|
|
|
*
|
|
|
|
* This file incorporates work covered by the following license notice:
|
|
|
|
*
|
|
|
|
* Licensed to the Apache Software Foundation (ASF) under one or more
|
|
|
|
* contributor license agreements. See the NOTICE file distributed
|
|
|
|
* with this work for additional information regarding copyright
|
|
|
|
* ownership. The ASF licenses this file to you under the Apache
|
|
|
|
* License, Version 2.0 (the "License"); you may not use this file
|
|
|
|
* except in compliance with the License. You may obtain a copy of
|
|
|
|
* the License at http://www.apache.org/licenses/LICENSE-2.0 .
|
|
|
|
*/
|
2006-02-28 09:32:54 +00:00
|
|
|
|
2006-09-17 01:28:47 +00:00
|
|
|
|
2006-02-28 09:32:54 +00:00
|
|
|
#include "NColumns.hxx"
|
|
|
|
#include "NTable.hxx"
|
|
|
|
#include "NTables.hxx"
|
|
|
|
#include "NCatalog.hxx"
|
2014-06-04 15:29:58 +02:00
|
|
|
#include <connectivity/sdbcx/VColumn.hxx>
|
2006-02-28 09:32:54 +00:00
|
|
|
|
|
|
|
using namespace connectivity::sdbcx;
|
|
|
|
using namespace connectivity;
|
|
|
|
using namespace ::comphelper;
|
|
|
|
using namespace ::com::sun::star::uno;
|
|
|
|
using namespace ::com::sun::star::beans;
|
|
|
|
using namespace ::com::sun::star::sdbc;
|
|
|
|
using namespace ::com::sun::star::container;
|
|
|
|
using namespace ::com::sun::star::lang;
|
|
|
|
using namespace connectivity::evoab;
|
|
|
|
|
2014-02-22 21:20:15 +01:00
|
|
|
|
2013-04-07 12:06:47 +02:00
|
|
|
sdbcx::ObjectType OEvoabColumns::createObject(const OUString& _rName)
|
2006-02-28 09:32:54 +00:00
|
|
|
{
|
2012-11-01 14:19:14 +01:00
|
|
|
const Any aCatalog;
|
2013-04-07 12:06:47 +02:00
|
|
|
const OUString sCatalogName;
|
|
|
|
const OUString sSchemaName(m_pTable->getSchema());
|
|
|
|
const OUString sTableName(m_pTable->getTableName());
|
2006-02-28 09:32:54 +00:00
|
|
|
Reference< XResultSet > xResult = m_pTable->getConnection()->getMetaData()->getColumns(
|
2012-11-01 14:19:14 +01:00
|
|
|
aCatalog,
|
|
|
|
sSchemaName,
|
|
|
|
sTableName,
|
2006-02-28 09:32:54 +00:00
|
|
|
_rName);
|
|
|
|
|
2015-11-10 10:12:07 +01:00
|
|
|
sdbcx::ObjectType xRet = nullptr;
|
2006-02-28 09:32:54 +00:00
|
|
|
if (xResult.is())
|
|
|
|
{
|
|
|
|
Reference< XRow > xRow(xResult,UNO_QUERY);
|
|
|
|
|
|
|
|
while (xResult->next())
|
|
|
|
{
|
|
|
|
if (xRow->getString(4) == _rName)
|
|
|
|
{
|
|
|
|
OColumn* pRet = new OColumn(
|
|
|
|
_rName,
|
|
|
|
xRow->getString(6),
|
|
|
|
xRow->getString(13),
|
2010-01-13 08:44:34 +01:00
|
|
|
xRow->getString(12),
|
2006-02-28 09:32:54 +00:00
|
|
|
xRow->getInt(11),
|
|
|
|
xRow->getInt(7),
|
|
|
|
xRow->getInt(9),
|
|
|
|
xRow->getInt(5),
|
2014-04-01 08:40:10 +02:00
|
|
|
false,
|
|
|
|
false,
|
|
|
|
false,
|
|
|
|
true,
|
2012-11-01 14:19:14 +01:00
|
|
|
sCatalogName,
|
|
|
|
sSchemaName,
|
|
|
|
sTableName);
|
2006-02-28 09:32:54 +00:00
|
|
|
xRet = pRet;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
return xRet;
|
|
|
|
}
|
2014-02-22 21:20:15 +01:00
|
|
|
|
2006-02-28 09:32:54 +00:00
|
|
|
void OEvoabColumns::impl_refresh() throw(RuntimeException)
|
|
|
|
{
|
|
|
|
m_pTable->refreshColumns();
|
|
|
|
}
|
2010-10-12 15:53:47 +02:00
|
|
|
|
|
|
|
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|