Files
libreoffice/dbaccess/source/core/api/query.cxx

437 lines
17 KiB
C++
Raw Normal View History

2000-09-18 23:16:46 +00:00
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
2000-09-18 23:16:46 +00:00
*
* Copyright 2008 by Sun Microsystems, Inc.
2000-09-18 23:16:46 +00:00
*
* OpenOffice.org - a multi-platform office productivity suite
2000-09-18 23:16:46 +00:00
*
* $RCSfile: query.cxx,v $
* $Revision: 1.35 $
2000-09-18 23:16:46 +00:00
*
* This file is part of OpenOffice.org.
2000-09-18 23:16:46 +00:00
*
* OpenOffice.org is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License version 3
* only, as published by the Free Software Foundation.
2000-09-18 23:16:46 +00:00
*
* OpenOffice.org is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License version 3 for more details
* (a copy is included in the LICENSE file that accompanied this code).
2000-09-18 23:16:46 +00:00
*
* You should have received a copy of the GNU Lesser General Public License
* version 3 along with OpenOffice.org. If not, see
* <http://www.openoffice.org/license.html>
* for a copy of the LGPLv3 License.
2000-09-18 23:16:46 +00:00
*
************************************************************************/
// MARKER(update_precomp.py): autogen include statement, do not remove
#include "precompiled_dbaccess.hxx"
2000-09-18 23:16:46 +00:00
#ifndef _DBA_COREAPI_QUERY_HXX_
#include "query.hxx"
#endif
2000-10-25 06:32:52 +00:00
#ifndef DBACCESS_SHARED_DBASTRINGS_HRC
#include "dbastrings.hrc"
2000-09-18 23:16:46 +00:00
#endif
#ifndef DBA_CORE_WARNINGS_HXX
#include "warnings.hxx"
#endif
#ifndef DBA_HELPERCOLLECTIONS_HXX
#include "HelperCollections.hxx"
#endif
#ifndef _DBA_CORE_RESOURCE_HXX_
#include "core_resource.hxx"
#endif
#ifndef _DBA_CORE_RESOURCE_HRC_
#include "core_resource.hrc"
#endif
2000-09-18 23:16:46 +00:00
#ifndef _CPPUHELPER_QUERYINTERFACE_HXX_
#include <cppuhelper/queryinterface.hxx>
#endif
#ifndef _TOOLS_DEBUG_HXX
#include <tools/debug.hxx>
#endif
#ifndef TOOLS_DIAGNOSE_EX_H
#include <tools/diagnose_ex.h>
#endif
2000-10-11 10:21:40 +00:00
#ifndef _COMPHELPER_PROPERTY_AGGREGATION_HXX_
#include <comphelper/propagg.hxx>
2000-09-18 23:16:46 +00:00
#endif
2000-10-11 10:21:40 +00:00
#ifndef _COMPHELPER_SEQUENCE_HXX_
#include <comphelper/sequence.hxx>
2000-09-18 23:16:46 +00:00
#endif
/** === begin UNO includes === **/
2000-09-18 23:16:46 +00:00
#ifndef _COM_SUN_STAR_SDBC_XCONNECTION_HPP_
#include <com/sun/star/sdbc/XConnection.hpp>
#endif
#ifndef _COM_SUN_STAR_LANG_DISPOSEDEXCEPTION_HPP_
#include <com/sun/star/lang/DisposedException.hpp>
#endif
#ifndef _COM_SUN_STAR_SDB_XSINGLESELECTQUERYCOMPOSER_HPP_
#include <com/sun/star/sdb/XSingleSelectQueryComposer.hpp>
#endif
#ifndef _COM_SUN_STAR_SDBC_XRESULTSETMETADATASUPPLIER_HPP_
#include <com/sun/star/sdbc/XResultSetMetaDataSupplier.hpp>
#endif
/** === end UNO includes === **/
2001-01-04 13:26:47 +00:00
#ifndef _COMPHELPER_TYPES_HXX_
#include <comphelper/types.hxx>
#endif
#ifndef _COMPHELPER_PROPERTY_HXX_
#include <comphelper/property.hxx>
#endif
#ifndef UNOTOOLS_INC_SHAREDUNOCOMPONENT_HXX
#include <unotools/sharedunocomponent.hxx>
#endif
2001-02-23 14:22:32 +00:00
#ifndef _DBACORE_DEFINITIONCOLUMN_HXX_
#include "definitioncolumn.hxx"
#endif
2001-08-30 07:07:36 +00:00
2001-08-15 12:05:15 +00:00
#include <functional>
2000-09-18 23:16:46 +00:00
2001-08-30 07:07:36 +00:00
#ifndef DBACORE_SDBCORETOOLS_HXX
#include "sdbcoretools.hxx"
#endif
2001-11-23 10:28:26 +00:00
#ifndef DBACCESS_CORE_API_QUERYCOMPOSER_HXX
#include "querycomposer.hxx"
#endif
#ifndef _COM_SUN_STAR_BEANS_PROPERTYATTRIBUTE_HPP_
#include <com/sun/star/beans/PropertyAttribute.hpp>
#endif
#ifndef DBA_CONTAINERMEDIATOR_HXX
#include "ContainerMediator.hxx"
#endif
2001-08-30 07:07:36 +00:00
2000-09-18 23:16:46 +00:00
using namespace dbaccess;
using namespace ::com::sun::star::uno;
using namespace ::com::sun::star::sdbc;
using namespace ::com::sun::star::sdbcx;
using namespace ::com::sun::star::sdb;
2000-09-18 23:16:46 +00:00
using namespace ::com::sun::star::lang;
using namespace ::com::sun::star::util;
using namespace ::com::sun::star::beans;
using namespace ::com::sun::star::container;
2000-10-11 10:21:40 +00:00
using namespace ::comphelper;
2000-09-18 23:16:46 +00:00
using namespace ::osl;
using namespace ::cppu;
using namespace ::utl;
2000-09-18 23:16:46 +00:00
//........................................................................
namespace dbaccess
{
//........................................................................
2000-09-18 23:16:46 +00:00
//==========================================================================
2001-08-30 07:07:36 +00:00
//= OQuery
2000-09-18 23:16:46 +00:00
//==========================================================================
2001-08-30 07:07:36 +00:00
DBG_NAME(OQuery)
2000-09-18 23:16:46 +00:00
//--------------------------------------------------------------------------
OQuery::OQuery( const Reference< XPropertySet >& _rxCommandDefinition
,const Reference< XConnection >& _rxConn
,const Reference< XMultiServiceFactory >& _xORB)
:OContentHelper(_xORB,NULL,TContentPtr(new OContentHelper_Impl))
,OQueryDescriptor_Base(m_aMutex,*this)
CWS-TOOLING: integrate CWS dba31e 2008-11-19 12:36:23 +0100 msc r263980 : i96104 2008-11-19 12:31:19 +0100 msc r263979 : i96104 2008-11-19 12:21:55 +0100 msc r263977 : i96104 2008-11-19 12:18:53 +0100 msc r263976 : i96104 2008-11-18 09:09:45 +0100 oj r263746 : disable color entry when area is set 2008-11-18 08:37:52 +0100 oj r263741 : #remove sub report entry 2008-11-17 11:20:25 +0100 fs r263708 : #i10000# 2008-11-17 11:06:52 +0100 fs r263706 : minimal version now is 3.1 2008-11-12 22:25:59 +0100 fs r263621 : #i96150# 2008-11-12 22:20:02 +0100 fs r263620 : rebased to m34 2008-11-12 21:39:41 +0100 fs r263618 : MANUAL REBASE: rebase CWS dba31d to DEV300_m34 2008-11-12 13:54:58 +0100 fs r263597 : #i96134# MediaDescriptor.URL is to be preferred over MediaDescriptor.FileName. Nonetheless, ensure both are handled 2008-11-12 13:53:40 +0100 fs r263596 : #i96134# re-enabled the code for #i41897#, a better fix is to come 2008-11-12 12:48:21 +0100 fs r263585 : #i96134# disable saving URLs of file-base databases relatively 2008-11-11 16:11:11 +0100 msc r263566 : #i96104# 2008-11-05 09:09:47 +0100 oj r263342 : #i88727# color noe added 2008-11-05 08:41:43 +0100 oj r263341 : #i77916# zoom added 2008-11-04 21:24:15 +0100 fs r263339 : disposing: call disposeAndClear without own mutex locked - some of our listeners insist on locking the SolarMutex, which sometimes led to deadlocks on the complex test cases 2008-11-04 21:23:15 +0100 fs r263338 : remove SolarMutex locking - this happned in CWS dba31c (in the CVS version), which this CWS was created from, but seems to got lost during resync 2008-11-04 20:49:50 +0100 fs r263335 : docu formatting 2008-11-04 20:06:39 +0100 fs r263334 : #i95826# use m_aMutex, not a DocumentGuard (wrongly resolved merge conflicts) 2008-11-04 17:36:29 +0100 fs r263332 : #i92688# properly revoke as XEventListener from m_xActiveController when disposing 2008-11-04 14:49:34 +0100 fs r263324 : #i92322# enable Input Required if EmptyIsNULL does not exist at the control 2008-10-31 11:10:04 +0100 oj r262857 : merge from cvs to svn 2008-10-31 09:46:45 +0100 oj r262853 : merge from cvs to svn 2008-10-31 08:46:37 +0100 oj r262849 : merge from cvs to svn 2008-10-31 08:44:24 +0100 oj r262848 : merge from cvs to svn 2008-10-31 08:43:33 +0100 oj r262847 : merge from cvs to svn 2008-10-31 08:42:28 +0100 oj r262846 : merge from cvs to svn 2008-10-31 08:41:58 +0100 oj r262845 : merge from cvs to svn 2008-10-31 08:41:32 +0100 oj r262844 : merge from cvs to svn 2008-10-28 12:19:50 +0100 oj r262733 : #iXXXXX#: migrate CWS dba31e to SVN 2008-10-28 12:19:42 +0100 oj r262732 : #iXXXXX#: migrate CWS dba31e to SVN 2008-10-28 12:19:36 +0100 oj r262731 : #iXXXXX#: migrate CWS dba31e to SVN 2008-10-28 12:19:31 +0100 oj r262730 : #iXXXXX#: migrate CWS dba31e to SVN 2008-10-28 12:19:22 +0100 oj r262729 : #iXXXXX#: migrate CWS dba31e to SVN 2008-10-28 12:19:18 +0100 oj r262728 : #iXXXXX#: migrate CWS dba31e to SVN 2008-10-28 12:19:10 +0100 oj r262727 : #iXXXXX#: migrate CWS dba31e to SVN 2008-10-28 12:19:06 +0100 oj r262726 : #iXXXXX#: migrate CWS dba31e to SVN 2008-10-28 12:19:05 +0100 oj r262725 : #iXXXXX#: migrate CWS dba31e to SVN 2008-10-28 12:19:01 +0100 oj r262724 : #iXXXXX#: migrate CWS dba31e to SVN 2008-10-28 12:18:50 +0100 oj r262723 : #iXXXXX#: migrate CWS dba31e to SVN 2008-10-28 12:18:41 +0100 oj r262722 : #iXXXXX#: migrate CWS dba31e to SVN 2008-10-28 12:18:40 +0100 oj r262721 : #iXXXXX#: migrate CWS dba31e to SVN 2008-10-28 12:18:27 +0100 oj r262720 : #iXXXXX#: migrate CWS dba31e to SVN 2008-10-28 12:18:10 +0100 oj r262719 : #iXXXXX#: migrate CWS dba31e to SVN 2008-10-28 12:18:01 +0100 oj r262718 : #iXXXXX#: migrate CWS dba31e to SVN 2008-10-28 12:17:39 +0100 oj r262717 : #iXXXXX#: migrate CWS dba31e to SVN
2008-12-01 12:31:27 +00:00
,ODataSettings(OContentHelper::rBHelper,sal_True)
2000-09-18 23:16:46 +00:00
,m_xCommandDefinition(_rxCommandDefinition)
,m_xConnection(_rxConn)
,m_pColumnMediator( NULL )
,m_pWarnings( NULL )
,m_bCaseSensitiv(sal_True)
,m_eDoingCurrently(NONE)
2000-09-18 23:16:46 +00:00
{
2001-08-30 07:07:36 +00:00
DBG_CTOR(OQuery, NULL);
registerProperties();
ODataSettings::registerPropertiesFor(this);
2000-09-18 23:16:46 +00:00
osl_incrementInterlockedCount(&m_refCount);
2001-08-30 07:07:36 +00:00
DBG_ASSERT(m_xCommandDefinition.is(), "OQuery::OQuery : invalid CommandDefinition object !");
if ( m_xCommandDefinition.is() )
2000-09-18 23:16:46 +00:00
{
try
{
::comphelper::copyProperties(_rxCommandDefinition,this);
}
catch(Exception&)
{
OSL_ENSURE(sal_False, "OQueryDescriptor_Base::OQueryDescriptor_Base: caught an exception!");
}
2000-09-18 23:16:46 +00:00
m_xCommandDefinition->addPropertyChangeListener(::rtl::OUString(), this);
// m_xCommandDefinition->addPropertyChangeListener(PROPERTY_NAME, this);
2001-03-02 09:24:52 +00:00
m_xCommandPropInfo = m_xCommandDefinition->getPropertySetInfo();
2000-09-18 23:16:46 +00:00
}
2001-08-30 07:07:36 +00:00
DBG_ASSERT(m_xConnection.is(), "OQuery::OQuery : invalid connection !");
osl_decrementInterlockedCount(&m_refCount);
2001-08-30 07:07:36 +00:00
}
//--------------------------------------------------------------------------
OQuery::~OQuery()
{
DBG_DTOR(OQuery, NULL);
2000-09-18 23:16:46 +00:00
}
// -----------------------------------------------------------------------------
IMPLEMENT_IMPLEMENTATION_ID(OQuery);
IMPLEMENT_GETTYPES3(OQuery,OQueryDescriptor_Base,ODataSettings,OContentHelper);
IMPLEMENT_FORWARD_XINTERFACE3( OQuery,OContentHelper,OQueryDescriptor_Base,ODataSettings)
2000-09-18 23:16:46 +00:00
//--------------------------------------------------------------------------
void OQuery::rebuildColumns()
2000-09-18 23:16:46 +00:00
{
OSL_PRECOND( getColumnCount() == 0, "OQuery::rebuildColumns: column container should be empty!" );
// the base class' definition of rebuildColumns promised that clearColumns is called before rebuildColumns
2001-08-30 07:07:36 +00:00
try
2000-09-18 23:16:46 +00:00
{
m_pColumnMediator = NULL;
Reference<XColumnsSupplier> xColSup(m_xCommandDefinition,UNO_QUERY);
if ( xColSup.is() )
{
Reference< XNameAccess > xColumnDefinitions = xColSup->getColumns();
if ( xColumnDefinitions.is() )
m_pColumnMediator = new OContainerMediator( m_pColumns, xColumnDefinitions, m_xConnection, OContainerMediator::eColumns );
}
2000-09-18 23:16:46 +00:00
2001-08-30 07:07:36 +00:00
// fill the columns with columns from the statement
Reference< XMultiServiceFactory > xFactory( m_xConnection, UNO_QUERY_THROW );
SharedUNOComponent< XSingleSelectQueryComposer, DisposableComponent > xComposer(
Reference< XSingleSelectQueryComposer >( xFactory->createInstance( SERVICE_NAME_SINGLESELECTQUERYCOMPOSER ), UNO_QUERY_THROW ) );
Reference< XNameAccess > xColumns;
Reference< XIndexAccess > xColumnsIndexed;
try
2001-11-23 10:28:26 +00:00
{
xComposer->setQuery( m_sCommand );
Reference< XColumnsSupplier > xCols( xComposer, UNO_QUERY_THROW );
xColumns.set( xCols->getColumns(), UNO_QUERY_THROW );
xColumnsIndexed.set( xColumns, UNO_QUERY_THROW );
}
catch( const SQLException& ) { }
SharedUNOComponent< XPreparedStatement, DisposableComponent > xPreparedStatement;
if ( !xColumns.is() || ( xColumnsIndexed->getCount() == 0 ) )
{ // the QueryComposer could not parse it. Try a lean version.
xPreparedStatement.set( m_xConnection->prepareStatement( m_sCommand ), UNO_QUERY_THROW );
Reference< XResultSetMetaDataSupplier > xResMetaDataSup( xPreparedStatement, UNO_QUERY_THROW );
Reference< XResultSetMetaData > xResultSetMeta( xResMetaDataSup->getMetaData() );
if ( !xResultSetMeta.is() )
2001-11-23 10:28:26 +00:00
{
::rtl::OUString sError( DBA_RES( RID_STR_STATEMENT_WITHOUT_RESULT_SET ) );
::dbtools::throwSQLException( sError, SQL_GENERAL_ERROR, *this );
2001-11-23 10:28:26 +00:00
}
Reference< XDatabaseMetaData > xDBMeta( m_xConnection->getMetaData(), UNO_QUERY_THROW );
::vos::ORef< OSQLColumns > aParseColumns(
::connectivity::parse::OParseColumn::createColumnsForResultSet( xResultSetMeta, xDBMeta ) );
xColumns = OPrivateColumns::createWithIntrinsicNames(
aParseColumns, xDBMeta->storesMixedCaseQuotedIdentifiers(), *this, m_aMutex );
if ( !xColumns.is() )
throw RuntimeException();
2001-11-23 10:28:26 +00:00
}
Sequence< ::rtl::OUString> aNames = xColumns->getElementNames();
const ::rtl::OUString* pBegin = aNames.getConstArray();
const ::rtl::OUString* pEnd = pBegin + aNames.getLength();
for ( ;pBegin != pEnd; ++pBegin)
{
Reference<XPropertySet> xSource(xColumns->getByName( *pBegin ),UNO_QUERY);
OTableColumn* pColumn = new OTableColumn( xSource );
Reference<XChild> xChild(*pColumn,UNO_QUERY);
if ( xChild.is() )
xChild->setParent(*this);
2001-08-30 07:07:36 +00:00
implAppendColumn( *pBegin, pColumn );
Reference<XPropertySet> xDest(*pColumn,UNO_QUERY);
if ( m_pColumnMediator.is() )
m_pColumnMediator->notifyElementCreated( *pBegin, xDest );
}
2000-09-18 23:16:46 +00:00
}
2001-08-30 07:07:36 +00:00
catch( const SQLContext& e )
{
if ( m_pWarnings )
m_pWarnings->appendWarning( e );
}
catch( const SQLWarning& e )
{
if ( m_pWarnings )
m_pWarnings->appendWarning( e );
}
catch( const SQLException& e )
{
if ( m_pWarnings )
m_pWarnings->appendWarning( e );
}
catch( const Exception& )
{
DBG_UNHANDLED_EXCEPTION();
2001-08-30 07:07:36 +00:00
}
}
2000-09-18 23:16:46 +00:00
// XServiceInfo
//--------------------------------------------------------------------------
2001-08-30 07:07:36 +00:00
IMPLEMENT_SERVICE_INFO3(OQuery, "com.sun.star.sdb.dbaccess.OQuery", SERVICE_SDB_DATASETTINGS, SERVICE_SDB_QUERY, SERVICE_SDB_QUERYDEFINITION)
2000-09-18 23:16:46 +00:00
// ::com::sun::star::beans::XPropertyChangeListener
//--------------------------------------------------------------------------
2001-08-30 07:07:36 +00:00
void SAL_CALL OQuery::propertyChange( const PropertyChangeEvent& _rSource ) throw(RuntimeException)
2000-09-18 23:16:46 +00:00
{
sal_Int32 nOwnHandle = -1;
{
MutexGuard aGuard(m_aMutex);
DBG_ASSERT(_rSource.Source.get() == Reference< XInterface >(m_xCommandDefinition, UNO_QUERY).get(),
2001-08-30 07:07:36 +00:00
"OQuery::propertyChange : where did this call come from ?");
2000-09-18 23:16:46 +00:00
if (m_eDoingCurrently == SETTING_PROPERTIES)
// we're setting the property ourself, so we will do the neccessary notifications later
return;
// forward this to our own member holding a copy of the property value
if (getArrayHelper()->hasPropertyByName(_rSource.PropertyName))
{
Property aOwnProp = getArrayHelper()->getPropertyByName(_rSource.PropertyName);
nOwnHandle = aOwnProp.Handle;
ODataSettings::setFastPropertyValue_NoBroadcast(nOwnHandle, _rSource.NewValue);
2000-09-18 23:16:46 +00:00
// don't use our own setFastPropertyValue_NoBroadcast, this would forward it to the CommandSettings,
// again
// and don't use the "real" setPropertyValue, this is to expensive and not sure to succeed
}
else
{
2001-08-30 07:07:36 +00:00
DBG_ERROR("OQuery::propertyChange : my CommandDefinition has more properties than I do !");
2000-09-18 23:16:46 +00:00
}
}
fire(&nOwnHandle, &_rSource.NewValue, &_rSource.OldValue, 1, sal_False);
}
//--------------------------------------------------------------------------
void SAL_CALL OQuery::disposing( const EventObject& _rSource ) throw (RuntimeException)
2000-09-18 23:16:46 +00:00
{
MutexGuard aGuard(m_aMutex);
(void)_rSource;
2000-09-18 23:16:46 +00:00
DBG_ASSERT(_rSource.Source.get() == Reference< XInterface >(m_xCommandDefinition, UNO_QUERY).get(),
2001-08-30 07:07:36 +00:00
"OQuery::disposing : where did this call come from ?");
2000-09-18 23:16:46 +00:00
m_xCommandDefinition->removePropertyChangeListener(::rtl::OUString(), this);
m_xCommandDefinition = NULL;
}
// XDataDescriptorFactory
//--------------------------------------------------------------------------
2001-08-30 07:07:36 +00:00
Reference< XPropertySet > SAL_CALL OQuery::createDataDescriptor( ) throw(RuntimeException)
2000-09-18 23:16:46 +00:00
{
return new OQueryDescriptor(*this);
}
// pseudo-XComponent
//--------------------------------------------------------------------------
void SAL_CALL OQuery::disposing()
2000-09-18 23:16:46 +00:00
{
MutexGuard aGuard(m_aMutex);
if (m_xCommandDefinition.is())
{
m_xCommandDefinition->removePropertyChangeListener(::rtl::OUString(), this);
m_xCommandDefinition = NULL;
}
disposeColumns();
m_pWarnings = NULL;
2000-09-18 23:16:46 +00:00
}
//--------------------------------------------------------------------------
2001-08-30 07:07:36 +00:00
void OQuery::setFastPropertyValue_NoBroadcast( sal_Int32 _nHandle, const Any& _rValue ) throw (Exception)
2000-09-18 23:16:46 +00:00
{
ODataSettings::setFastPropertyValue_NoBroadcast(_nHandle, _rValue);
2000-09-18 23:16:46 +00:00
::rtl::OUString sAggPropName;
2001-01-04 13:26:47 +00:00
sal_Int16 nAttr = 0;
2001-03-02 09:24:52 +00:00
if (getInfoHelper().fillPropertyMembersByHandle(&sAggPropName,&nAttr,_nHandle) &&
m_xCommandPropInfo.is() &&
m_xCommandPropInfo->hasPropertyByName(sAggPropName))
2000-09-18 23:16:46 +00:00
{ // the base class holds the property values itself, but we have to forward this to our CommandDefinition
2001-03-02 09:24:52 +00:00
2000-09-18 23:16:46 +00:00
m_eDoingCurrently = SETTING_PROPERTIES;
OAutoActionReset(this);
m_xCommandDefinition->setPropertyValue(sAggPropName, _rValue);
if ( PROPERTY_ID_COMMAND == _nHandle )
// the columns are out of date if we are based on a new statement ....
// 90573 - 16.08.2001 - frank.schoenheit@sun.com
2001-08-30 07:07:36 +00:00
setColumnsOutOfDate();
2000-09-18 23:16:46 +00:00
}
}
//--------------------------------------------------------------------------
2001-08-30 07:07:36 +00:00
Reference< XPropertySetInfo > SAL_CALL OQuery::getPropertySetInfo( ) throw(RuntimeException)
2000-09-18 23:16:46 +00:00
{
return createPropertySetInfo( getInfoHelper() ) ;
}
//------------------------------------------------------------------------------
2001-08-30 07:07:36 +00:00
::cppu::IPropertyArrayHelper& OQuery::getInfoHelper()
2000-09-18 23:16:46 +00:00
{
return *getArrayHelper();
}
//--------------------------------------------------------------------------
::cppu::IPropertyArrayHelper* OQuery::createArrayHelper( ) const
{
Sequence< Property > aProps;
// our own props
describeProperties(aProps);
return new ::cppu::OPropertyArrayHelper(aProps);
}
2001-02-23 14:22:32 +00:00
// -----------------------------------------------------------------------------
OColumn* OQuery::createColumn(const ::rtl::OUString& /*_rName*/) const
2001-02-23 14:22:32 +00:00
{
2001-08-30 07:07:36 +00:00
return NULL;
2001-02-23 14:22:32 +00:00
}
// -----------------------------------------------------------------------------
void SAL_CALL OQuery::rename( const ::rtl::OUString& newName ) throw (SQLException, ElementExistException, RuntimeException)
{
MutexGuard aGuard(m_aMutex);
Reference<XRename> xRename(m_xCommandDefinition,UNO_QUERY);
OSL_ENSURE(xRename.is(),"No XRename interface!");
if(xRename.is())
xRename->rename(newName);
}
// -----------------------------------------------------------------------------
void OQuery::registerProperties()
{
// the properties which OCommandBase supplies (it has no own registration, as it's not derived from
// a OPropertyStateContainer)
registerProperty(PROPERTY_NAME, PROPERTY_ID_NAME, PropertyAttribute::BOUND|PropertyAttribute::CONSTRAINED,
&m_sElementName, ::getCppuType(&m_sElementName));
registerProperty(PROPERTY_COMMAND, PROPERTY_ID_COMMAND, PropertyAttribute::BOUND,
&m_sCommand, ::getCppuType(&m_sCommand));
registerProperty(PROPERTY_ESCAPE_PROCESSING, PROPERTY_ID_ESCAPE_PROCESSING, PropertyAttribute::BOUND,
&m_bEscapeProcessing, ::getBooleanCppuType());
registerProperty(PROPERTY_UPDATE_TABLENAME, PROPERTY_ID_UPDATE_TABLENAME, PropertyAttribute::BOUND,
&m_sUpdateTableName, ::getCppuType(&m_sUpdateTableName));
registerProperty(PROPERTY_UPDATE_SCHEMANAME, PROPERTY_ID_UPDATE_SCHEMANAME, PropertyAttribute::BOUND,
&m_sUpdateSchemaName, ::getCppuType(&m_sUpdateSchemaName));
registerProperty(PROPERTY_UPDATE_CATALOGNAME, PROPERTY_ID_UPDATE_CATALOGNAME, PropertyAttribute::BOUND,
&m_sUpdateCatalogName, ::getCppuType(&m_sUpdateCatalogName));
registerProperty(PROPERTY_LAYOUTINFORMATION, PROPERTY_ID_LAYOUTINFORMATION, PropertyAttribute::BOUND,
&m_aLayoutInformation, ::getCppuType(&m_aLayoutInformation));
}
2001-08-30 07:07:36 +00:00
2001-07-16 06:38:40 +00:00
// -----------------------------------------------------------------------------
//........................................................................
} // namespace dbaccess
//........................................................................
2000-09-18 23:16:46 +00:00