Tag: cws_src680_qiq User: fs Date: 06/05/10 03:55:58 Modified: /dba/dbaccess/source/core/api/ SingleSelectQueryComposer.cxx
Log: #i51443# +getQueryWithSubstitution File Changes: Directory: /dba/dbaccess/source/core/api/ ========================================= File [changed]: SingleSelectQueryComposer.cxx Url: http://dba.openoffice.org/source/browse/dba/dbaccess/source/core/api/SingleSelectQueryComposer.cxx?r1=1.13&r2=1.13.18.1 Delta lines: +24 -10 --------------------- --- SingleSelectQueryComposer.cxx 7 Apr 2006 14:10:37 -0000 1.13 +++ SingleSelectQueryComposer.cxx 10 May 2006 10:55:55 -0000 1.13.18.1 @@ -4,9 +4,9 @@ * * $RCSfile: SingleSelectQueryComposer.cxx,v $ * - * $Revision: 1.13 $ + * $Revision: 1.13.18.1 $ * - * last change: $Author: vg $ $Date: 2006/04/07 14:10:37 $ + * last change: $Author: fs $ $Date: 2006/05/10 10:55:55 $ * * The Contents of this file are made available subject to * the terms of GNU Lesser General Public License Version 2.1. @@ -230,17 +230,17 @@ DBG_NAME(OSingleSelectQueryComposer) // ------------------------------------------------------------------------- -OSingleSelectQueryComposer::OSingleSelectQueryComposer(const Reference< XNameAccess>& _xTableSupplier, +OSingleSelectQueryComposer::OSingleSelectQueryComposer(const Reference< XNameAccess>& _rxTables, const Reference< XConnection>& _xConnection, const Reference< XMultiServiceFactory >& _xServiceFactory) : OSubComponent(m_aMutex,_xConnection) ,OPropertyContainer(m_aBHelper) , m_xConnection(_xConnection) , m_xMetaData(_xConnection->getMetaData()) - , m_aSqlIterator(_xTableSupplier,_xConnection->getMetaData(),NULL) - , m_aAdditiveIterator(_xTableSupplier,_xConnection->getMetaData(),NULL) - , m_xTableSupplier(_xTableSupplier) , m_aSqlParser(_xServiceFactory) + , m_aSqlIterator( _xConnection, _rxTables, NULL, &m_aSqlParser ) + , m_aAdditiveIterator( _xConnection, _rxTables, NULL, &m_aSqlParser ) + , m_xTables( _rxTables ) ,m_xServiceFactory(_xServiceFactory) ,m_pTables(NULL) ,m_nBoolCompareMode(BOOL_COMPARISON_DEFAULT) @@ -249,7 +249,7 @@ DBG_CTOR(OSingleSelectQueryComposer,NULL); OSL_ENSURE(_xServiceFactory.is()," ServiceFactory cant be null!"); OSL_ENSURE(_xConnection.is()," Connection cant be null!"); - OSL_ENSURE(_xTableSupplier.is(),"TableSupplier cant be null!"); + OSL_ENSURE(_rxTables.is(),"TableSupplier cant be null!"); registerProperty(PROPERTY_ORIGINAL,PROPERTY_ID_ORIGINAL,PropertyAttribute::BOUND|PropertyAttribute::READONLY,&m_sOrignal,::getCppuType(&m_sOrignal)); @@ -312,7 +312,7 @@ resetIterator( m_aSqlIterator, true ); resetIterator( m_aAdditiveIterator, true ); - m_xTableSupplier = NULL; + m_xTables = NULL; m_xConnection = NULL; m_xServiceFactory = NULL; @@ -573,7 +573,7 @@ ::osl::MutexGuard aGuard( m_aMutex ); // parse and verify the statement, building a temporary iterator - OSQLParseTreeIterator aElementaryIterator( m_xTableSupplier, m_xMetaData, NULL ); + OSQLParseTreeIterator aElementaryIterator( m_xConnection, m_xTables, NULL, &m_aSqlParser ); parseAndCheck_throwError( m_aSqlParser, _rElementary, aElementaryIterator, *this ); // remember the 4 current "additive" clauses @@ -1296,6 +1296,20 @@ Reference< XIndexAccess > SAL_CALL OSingleSelectQueryComposer::getOrderColumns( ) throw(RuntimeException) { return setCurrentColumns( OrderColumns, m_aAdditiveIterator.getOrderColumns() ); +} +// ----------------------------------------------------------------------------- +::rtl::OUString SAL_CALL OSingleSelectQueryComposer::getQueryWithSubstitution( ) throw (::com::sun::star::uno::RuntimeException) +{ + ::osl::MutexGuard aGuard( m_aMutex ); + ::connectivity::checkDisposed(OSubComponent::rBHelper.bDisposed); + + ::rtl::OUString sSqlStatement( getQuery() ); + + const OSQLParseNode* pStatementNode = m_aSqlIterator.getParseTree(); + if ( pStatementNode ) + pStatementNode->parseNodeToExecutableStatement( sSqlStatement, m_xConnection ); + + return sSqlStatement; } // ----------------------------------------------------------------------------- ::rtl::OUString OSingleSelectQueryComposer::getStatementPart( TGetParseNode& _aGetFunctor, OSQLParseTreeIterator& _rIterator ) --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
