diff options
author | Ocke Janssen <oj@openoffice.org> | 2001-07-24 12:25:26 +0000 |
---|---|---|
committer | Ocke Janssen <oj@openoffice.org> | 2001-07-24 12:25:26 +0000 |
commit | 526eee8e20cd4d32811ac7a0a8ddc10b492804e3 (patch) | |
tree | 9ca690483c5a726a66d436b58827a2500457be21 | |
parent | 6d2872c111d2907eea15e0cc73bb0e3006d92c32 (diff) |
#89430# move ORowSetValue into dbtools
-rw-r--r-- | dbaccess/source/core/api/BookmarkSet.cxx | 11 | ||||
-rw-r--r-- | dbaccess/source/core/api/BookmarkSet.hxx | 9 | ||||
-rw-r--r-- | dbaccess/source/core/api/CacheSet.cxx | 99 | ||||
-rw-r--r-- | dbaccess/source/core/api/CacheSet.hxx | 9 | ||||
-rw-r--r-- | dbaccess/source/core/api/KeySet.cxx | 23 | ||||
-rw-r--r-- | dbaccess/source/core/api/KeySet.hxx | 11 | ||||
-rw-r--r-- | dbaccess/source/core/api/RowSet.cxx | 8 | ||||
-rw-r--r-- | dbaccess/source/core/api/RowSet.hxx | 21 | ||||
-rw-r--r-- | dbaccess/source/core/api/RowSetBase.cxx | 6 | ||||
-rw-r--r-- | dbaccess/source/core/api/RowSetBase.hxx | 6 | ||||
-rw-r--r-- | dbaccess/source/core/api/RowSetCache.cxx | 5 | ||||
-rw-r--r-- | dbaccess/source/core/api/RowSetCache.hxx | 13 | ||||
-rw-r--r-- | dbaccess/source/core/api/RowSetRow.hxx | 13 | ||||
-rw-r--r-- | dbaccess/source/core/api/StaticSet.cxx | 11 | ||||
-rw-r--r-- | dbaccess/source/core/api/makefile.mk | 5 | ||||
-rw-r--r-- | dbaccess/source/core/api/querycomposer.cxx | 90 |
16 files changed, 154 insertions, 186 deletions
diff --git a/dbaccess/source/core/api/BookmarkSet.cxx b/dbaccess/source/core/api/BookmarkSet.cxx index b93cd34521a6..dfd75ab2495b 100644 --- a/dbaccess/source/core/api/BookmarkSet.cxx +++ b/dbaccess/source/core/api/BookmarkSet.cxx @@ -2,9 +2,9 @@ * * $RCSfile: BookmarkSet.cxx,v $ * - * $Revision: 1.5 $ + * $Revision: 1.6 $ * - * last change: $Author: oj $ $Date: 2001-05-03 07:15:56 $ + * last change: $Author: oj $ $Date: 2001-07-24 13:25:26 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -178,8 +178,10 @@ void OBookmarkSet::updateColumn(sal_Int32 nPos,Reference< XRowUpdate > _xParamet case DataType::INTEGER: _xParameter->updateInt(nPos,_rValue); break; - case DataType::DOUBLE: case DataType::FLOAT: + _xParameter->updateFloat(nPos,_rValue); + break; + case DataType::DOUBLE: case DataType::REAL: _xParameter->updateDouble(nPos,_rValue); break; @@ -207,6 +209,9 @@ void OBookmarkSet::updateColumn(sal_Int32 nPos,Reference< XRowUpdate > _xParamet /*------------------------------------------------------------------------ $Log: not supported by cvs2svn $ + Revision 1.5 2001/05/03 07:15:56 oj + #86526# fetch decimal and numeric as string + Revision 1.4 2000/11/14 13:28:20 oj change for rowset when getRow returns 0 diff --git a/dbaccess/source/core/api/BookmarkSet.hxx b/dbaccess/source/core/api/BookmarkSet.hxx index bd69bd81b671..768efb252e02 100644 --- a/dbaccess/source/core/api/BookmarkSet.hxx +++ b/dbaccess/source/core/api/BookmarkSet.hxx @@ -2,9 +2,9 @@ * * $RCSfile: BookmarkSet.hxx,v $ * - * $Revision: 1.5 $ + * $Revision: 1.6 $ * - * last change: $Author: oj $ $Date: 2000-11-14 13:28:20 $ + * last change: $Author: oj $ $Date: 2001-07-24 13:25:26 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -76,7 +76,7 @@ namespace dbaccess { ::com::sun::star::uno::Reference< ::com::sun::star::sdbcx::XRowLocate> m_xRowLocate; - void updateColumn(sal_Int32 nPos,::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XRowUpdate > _xParameter,const ORowSetValue& _rValue); + void updateColumn(sal_Int32 nPos,::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XRowUpdate > _xParameter,const connectivity::ORowSetValue& _rValue); public: OBookmarkSet(const ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XResultSet>& _xDriverSet) : OCacheSet(_xDriverSet) @@ -142,6 +142,9 @@ namespace dbaccess /*------------------------------------------------------------------------ $Log: not supported by cvs2svn $ + Revision 1.5 2000/11/14 13:28:20 oj + change for rowset when getRow returns 0 + Revision 1.4 2000/11/03 14:40:45 oj some problems with refcount resolved diff --git a/dbaccess/source/core/api/CacheSet.cxx b/dbaccess/source/core/api/CacheSet.cxx index ad4a1811d234..596beaba952f 100644 --- a/dbaccess/source/core/api/CacheSet.cxx +++ b/dbaccess/source/core/api/CacheSet.cxx @@ -2,9 +2,9 @@ * * $RCSfile: CacheSet.cxx,v $ * - * $Revision: 1.24 $ + * $Revision: 1.25 $ * - * last change: $Author: oj $ $Date: 2001-07-19 09:29:22 $ + * last change: $Author: oj $ $Date: 2001-07-24 13:25:25 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -489,8 +489,10 @@ void OCacheSet::setParameter(sal_Int32 nPos,Reference< XParameters > _xParameter case DataType::INTEGER: _xParameter->setInt(nPos,_rValue); break; - case DataType::DOUBLE: case DataType::FLOAT: + _xParameter->setFloat(nPos,_rValue); + break; + case DataType::DOUBLE: case DataType::REAL: _xParameter->setDouble(nPos,_rValue); break; @@ -549,8 +551,10 @@ void OCacheSet::fillValueRow(ORowSetRow& _rRow,sal_Int32 _nPosition) case DataType::NUMERIC: (*aIter) = getString(i); break; - case DataType::DOUBLE: case DataType::FLOAT: + (*aIter) = getFloat(i); + break; + case DataType::DOUBLE: case DataType::REAL: (*aIter) = getDouble(i); break; @@ -573,10 +577,10 @@ void OCacheSet::fillValueRow(ORowSetRow& _rRow,sal_Int32 _nPosition) (*aIter) = getBoolean(i); break; case DataType::TINYINT: - (*aIter) = (sal_Int32)getByte(i); + (*aIter) = getByte(i); break; case DataType::SMALLINT: - (*aIter) = (sal_Int32)getShort(i); + (*aIter) = getShort(i); break; case DataType::INTEGER: (*aIter) = getInt(i); @@ -593,87 +597,6 @@ void OCacheSet::fillValueRow(ORowSetRow& _rRow,sal_Int32 _nPosition) } } -/*------------------------------------------------------------------------ - - $Log: not supported by cvs2svn $ - Revision 1.23 2001/07/18 14:01:34 oj - #89837# check types - - Revision 1.22 2001/05/22 13:08:22 oj - #87199# check column names - - Revision 1.21 2001/05/18 11:48:25 oj - #86528# size changes - - Revision 1.20 2001/05/03 07:15:56 oj - #86526# fetch decimal and numeric as string - - Revision 1.19 2001/04/02 11:24:49 oj - changes for character stream - - Revision 1.18 2001/03/15 08:19:18 fs - cppuhelper/extract -> comphelper/extract - - Revision 1.17 2001/02/14 13:18:24 oj - impl sql stmt - - Revision 1.16 2001/01/31 12:27:18 oj - use of qouteName - - Revision 1.15 2001/01/24 09:50:49 oj - #82628# rowset modifications - - Revision 1.14 2001/01/22 07:38:23 oj - #82632# change member - - Revision 1.13 2000/12/12 12:15:41 oj - use paramter instead of member and set member to ull - - Revision 1.12 2000/12/07 12:35:21 oj - #81424# valueof(bool) has no opposite conversion - - Revision 1.11 2000/12/06 09:48:48 oj - #80219# check wasNull() - - Revision 1.10 2000/12/01 13:04:36 oj - #80932# update and insert corrected - - Revision 1.9 2000/11/30 15:58:20 oj - #80934# standarddate is no longer public - - Revision 1.8 2000/11/29 10:23:32 oj - #80219# wrong use of keys - - Revision 1.7 2000/11/14 13:28:20 oj - change for rowset when getRow returns 0 - - Revision 1.6 2000/11/03 14:32:31 oj - some problems with refcount resolved - - Revision 1.5 2000/10/25 07:30:24 oj - make strings unique for lib's - - Revision 1.4 2000/10/17 10:18:12 oj - some changes for the rowset - - Revision 1.3 2000/10/11 11:18:10 fs - replace unotools with comphelper - - Revision 1.2 2000/09/29 15:20:51 oj - rowset impl - - Revision 1.1.1.1 2000/09/19 00:15:38 hr - initial import - - Revision 1.3 2000/09/18 14:52:46 willem.vandorp - OpenOffice header added. - - Revision 1.2 2000/09/05 13:36:15 rt - #65293# exception specification added, as in .hxx - - Revision 1.1 2000/09/01 15:24:25 oj - rowset addon +// ----------------------------------------------------------------------------- - Revision 1.0 27.07.2000 12:14:22 oj -------------------------------------------------------------------------*/ diff --git a/dbaccess/source/core/api/CacheSet.hxx b/dbaccess/source/core/api/CacheSet.hxx index 23c7f32eb8ab..3141cdad0405 100644 --- a/dbaccess/source/core/api/CacheSet.hxx +++ b/dbaccess/source/core/api/CacheSet.hxx @@ -2,9 +2,9 @@ * * $RCSfile: CacheSet.hxx,v $ * - * $Revision: 1.7 $ + * $Revision: 1.8 $ * - * last change: $Author: oj $ $Date: 2001-01-22 07:38:23 $ + * last change: $Author: oj $ $Date: 2001-07-24 13:25:25 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -132,7 +132,7 @@ namespace dbaccess } } - void setParameter(sal_Int32 nPos,::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XParameters > _xParameter,const ORowSetValue& _rValue) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException); + void setParameter(sal_Int32 nPos,::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XParameters > _xParameter,const connectivity::ORowSetValue& _rValue) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException); void fillTableName(const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet>& _xTable) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException); public: virtual ~OCacheSet(); @@ -360,6 +360,9 @@ namespace dbaccess /*------------------------------------------------------------------------ $Log: not supported by cvs2svn $ + Revision 1.7 2001/01/22 07:38:23 oj + #82632# change member + Revision 1.6 2000/12/12 12:15:41 oj use paramter instead of member and set member to ull diff --git a/dbaccess/source/core/api/KeySet.cxx b/dbaccess/source/core/api/KeySet.cxx index 5d576e21684b..d9c245506ead 100644 --- a/dbaccess/source/core/api/KeySet.cxx +++ b/dbaccess/source/core/api/KeySet.cxx @@ -2,9 +2,9 @@ * * $RCSfile: KeySet.cxx,v $ * - * $Revision: 1.22 $ + * $Revision: 1.23 $ * - * last change: $Author: oj $ $Date: 2001-07-19 09:29:22 $ + * last change: $Author: oj $ $Date: 2001-07-24 13:25:25 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -171,10 +171,11 @@ void OKeySet::construct() xTableProp->getPropertyValue(PROPERTY_SCHEMANAME) >>= aSchema; xTableProp->getPropertyValue(PROPERTY_NAME) >>= aTable; - ::dbtools::composeTableName(m_xConnection->getMetaData(),aCatalog,aSchema,aTable,aComposedName,sal_True); + Reference<XDatabaseMetaData> xMetaData = m_xConnection->getMetaData(); - if(m_xConnection->getMetaData()->supportsTableCorrelationNames()) + if(xMetaData->supportsTableCorrelationNames()) { + ::dbtools::composeTableName(xMetaData,aCatalog,aSchema,aTable,aComposedName,sal_False); // first we have to check if the composed tablename is in the select clause or if an alias is used Reference<XTablesSupplier> xTabSup(m_xComposer,UNO_QUERY); Reference<XNameAccess> xSelectTables = xTabSup->getTables(); @@ -183,10 +184,15 @@ void OKeySet::construct() { if(!xSelectTables->hasByName(aComposedName)) { // the composed name isn't used in the select clause so we have to find out which name is used instead - aComposedName = ::dbtools::quoteName( aQuote,m_sUpdateTableName); + ::dbtools::qualifiedNameComponents(xMetaData,m_sUpdateTableName,aCatalog,aSchema,aTable); + ::dbtools::composeTableName(xMetaData,aCatalog,aSchema,aTable,aComposedName,sal_True); } + else + ::dbtools::composeTableName(xMetaData,aCatalog,aSchema,aTable,aComposedName,sal_True); } } + else + ::dbtools::composeTableName(xMetaData,aCatalog,aSchema,aTable,aComposedName,sal_True); // create the where clause OColumnNamePos::const_iterator aIter; @@ -972,8 +978,10 @@ sal_Bool OKeySet::fetchRow() case DataType::NUMERIC: (*aIter) = m_xDriverRow->getString(aPosIter->second); break; - case DataType::DOUBLE: case DataType::FLOAT: + (*aIter) = m_xDriverRow->getFloat(aPosIter->second); + break; + case DataType::DOUBLE: case DataType::REAL: (*aIter) = m_xDriverRow->getDouble(aPosIter->second); break; @@ -1219,6 +1227,9 @@ namespace dbaccess /*------------------------------------------------------------------------ $Log: not supported by cvs2svn $ + Revision 1.22 2001/07/19 09:29:22 oj + #86186# check parsetree for joins + Revision 1.21 2001/07/09 07:00:18 oj #89364# provide the parameter row to the keyset diff --git a/dbaccess/source/core/api/KeySet.hxx b/dbaccess/source/core/api/KeySet.hxx index 601a3faccda0..10c2b2ca30ff 100644 --- a/dbaccess/source/core/api/KeySet.hxx +++ b/dbaccess/source/core/api/KeySet.hxx @@ -2,9 +2,9 @@ * * $RCSfile: KeySet.hxx,v $ * - * $Revision: 1.10 $ + * $Revision: 1.11 $ * - * last change: $Author: oj $ $Date: 2001-07-19 09:29:22 $ + * last change: $Author: oj $ $Date: 2001-07-24 13:25:25 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -101,7 +101,7 @@ namespace dbaccess OKeySetMatrix::iterator m_aKeyIter; OColumnNamePos m_aKeyColumnNames; // contains all key column names OColumnNamePos m_aColumnNames; // contains all column names - connectivity::ORowVector< ORowSetValue > m_aParameterRow; // conazins the parameters from rowset + connectivity::ORowVector< connectivity::ORowSetValue > m_aParameterRow; // conazins the parameters from rowset connectivity::OSQLTable m_xTable; // reference to our table ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XPreparedStatement> m_xStatement; @@ -124,7 +124,7 @@ namespace dbaccess // late ctor which can throw exceptions void construct(); - void setExternParameters(const connectivity::ORowVector< ORowSetValue >& _rParameterRow); + void setExternParameters(const connectivity::ORowVector< connectivity::ORowSetValue >& _rParameterRow); // ::com::sun::star::sdbc::XRow virtual sal_Bool SAL_CALL wasNull( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException); @@ -195,6 +195,9 @@ namespace dbaccess /*------------------------------------------------------------------------ $Log: not supported by cvs2svn $ + Revision 1.10 2001/07/19 09:29:22 oj + #86186# check parsetree for joins + Revision 1.9 2001/07/09 07:00:18 oj #89364# provide the parameter row to the keyset diff --git a/dbaccess/source/core/api/RowSet.cxx b/dbaccess/source/core/api/RowSet.cxx index 30728a4127f2..f49dfbf8de61 100644 --- a/dbaccess/source/core/api/RowSet.cxx +++ b/dbaccess/source/core/api/RowSet.cxx @@ -2,9 +2,9 @@ * * $RCSfile: RowSet.cxx,v $ * - * $Revision: 1.80 $ + * $Revision: 1.81 $ * - * last change: $Author: oj $ $Date: 2001-07-19 09:29:22 $ + * last change: $Author: oj $ $Date: 2001-07-24 13:25:25 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -768,7 +768,7 @@ void SAL_CALL ORowSet::updateInt( sal_Int32 columnIndex, sal_Int32 x ) throw(SQL // ------------------------------------------------------------------------- void SAL_CALL ORowSet::updateLong( sal_Int32 columnIndex, sal_Int64 x ) throw(SQLException, RuntimeException) { - updateValue(columnIndex,x); + updateValue(columnIndex,(double)x); } // ------------------------------------------------------------------------- void SAL_CALL ORowSet::updateFloat( sal_Int32 columnIndex, float x ) throw(SQLException, RuntimeException) @@ -1974,7 +1974,7 @@ void SAL_CALL ORowSet::setInt( sal_Int32 parameterIndex, sal_Int32 x ) throw(SQL // ------------------------------------------------------------------------- void SAL_CALL ORowSet::setLong( sal_Int32 parameterIndex, sal_Int64 x ) throw(SQLException, RuntimeException) { - setParameter(parameterIndex,x); + setParameter(parameterIndex,(double)x); } // ------------------------------------------------------------------------- void SAL_CALL ORowSet::setFloat( sal_Int32 parameterIndex, float x ) throw(SQLException, RuntimeException) diff --git a/dbaccess/source/core/api/RowSet.hxx b/dbaccess/source/core/api/RowSet.hxx index a73aad043b2d..d36a3524cf65 100644 --- a/dbaccess/source/core/api/RowSet.hxx +++ b/dbaccess/source/core/api/RowSet.hxx @@ -2,9 +2,9 @@ * * $RCSfile: RowSet.hxx,v $ * - * $Revision: 1.23 $ + * $Revision: 1.24 $ * - * last change: $Author: oj $ $Date: 2001-06-26 10:12:40 $ + * last change: $Author: oj $ $Date: 2001-07-24 13:25:25 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -107,8 +107,8 @@ #ifndef _CPPUHELPER_COMPBASE9_HXX_ #include <cppuhelper/compbase9.hxx> #endif -#ifndef DBACCESS_CORE_API_ROWSETVALUE_HXX -#include "RowSetValue.hxx" +#ifndef _CONNECTIVITY_FILE_VALUE_HXX_ +#include "connectivity/FValue.hxx" #endif #ifndef _DBASHARED_APITOOLS_HXX_ #include "apitools.hxx" @@ -146,8 +146,8 @@ namespace dbaccess ::com::sun::star::uno::Reference< ::com::sun::star::sdb::XSQLQueryComposer > m_xComposer; ::com::sun::star::uno::Reference< ::com::sun::star::container::XNameAccess > m_xColumns; // the columns from a table or query - connectivity::OWeakRefArray m_aClones; - connectivity::ORowVector< ORowSetValue > m_aParameterRow; // hold all parameters + connectivity::OWeakRefArray m_aClones; + connectivity::ORowVector< connectivity::ORowSetValue > m_aParameterRow; // hold all parameters OTableContainer* m_pTables; @@ -206,11 +206,11 @@ namespace dbaccess // inform the clones that we will delete some records void notifyClonesRowDelete(const ::com::sun::star::uno::Any& _rBookmark); void checkUpdateIterator(); - ORowSetValue getInsertValue(sal_Int32 columnIndex); - void setParameter(sal_Int32 parameterIndex, const ORowSetValue& x); + connectivity::ORowSetValue getInsertValue(sal_Int32 columnIndex); + void setParameter(sal_Int32 parameterIndex, const connectivity::ORowSetValue& x); // resizes the parameter vector if nescessary void checkAndResizeParameters(sal_Int32 parameterIndex); - void updateValue(sal_Int32 columnIndex,const ORowSetValue& x); + void updateValue(sal_Int32 columnIndex,const connectivity::ORowSetValue& x); void checkUpdateConditions(sal_Int32 columnIndex); protected: @@ -461,6 +461,9 @@ namespace dbaccess /*------------------------------------------------------------------------ $Log: not supported by cvs2svn $ + Revision 1.23 2001/06/26 10:12:40 oj + #87808# setObject corrected and some more + Revision 1.22 2001/05/07 11:11:15 oj #86483# set columns only null diff --git a/dbaccess/source/core/api/RowSetBase.cxx b/dbaccess/source/core/api/RowSetBase.cxx index 56ca5e4d418d..08c826d0b622 100644 --- a/dbaccess/source/core/api/RowSetBase.cxx +++ b/dbaccess/source/core/api/RowSetBase.cxx @@ -2,9 +2,9 @@ * * $RCSfile: RowSetBase.cxx,v $ * - * $Revision: 1.39 $ + * $Revision: 1.40 $ * - * last change: $Author: oj $ $Date: 2001-07-18 10:39:14 $ + * last change: $Author: oj $ $Date: 2001-07-24 13:25:25 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -922,8 +922,10 @@ void ORowSetBase::setCurrentRow(sal_Bool _bMoved,const ORowSetMatrix::iterator& if(!(m_bBeforeFirst || m_bAfterLast)) { m_aBookmark = m_pCache->getBookmark(); + OSL_ENSURE(m_aBookmark.hasValue(),"Bookamrk has no value!"); m_aCurrentRow = m_pCache->m_aMatrixIter; m_aCurrentRow.setBookmark(m_aBookmark); + OSL_ENSURE((*(*m_aCurrentRow))[0].makeAny().hasValue(),"Bookamrk has no value!"); OSL_ENSURE(!m_aCurrentRow.isNull() && m_aCurrentRow != m_pCache->getEnd(),"Position of matrix iterator isn't valid!"); OSL_ENSURE(m_aCurrentRow->isValid(),"Currentrow isn't valid"); diff --git a/dbaccess/source/core/api/RowSetBase.hxx b/dbaccess/source/core/api/RowSetBase.hxx index 29e6be5b2ab1..23b79871a6e7 100644 --- a/dbaccess/source/core/api/RowSetBase.hxx +++ b/dbaccess/source/core/api/RowSetBase.hxx @@ -2,9 +2,9 @@ * * $RCSfile: RowSetBase.hxx,v $ * - * $Revision: 1.20 $ + * $Revision: 1.21 $ * - * last change: $Author: oj $ $Date: 2001-07-12 07:56:32 $ + * last change: $Author: oj $ $Date: 2001-07-24 13:25:25 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -203,7 +203,7 @@ namespace dbaccess // postions the cache which the currently bookmark m_aBookmark void positionCache(); // returns a value of a column of the current row - ORowSetValue getValue(sal_Int32 columnIndex); + connectivity::ORowSetValue getValue(sal_Int32 columnIndex); // sets the current and the bookmark void setCurrentRow(sal_Bool _bMoved,const ORowSetMatrix::iterator& _rOldValues); void checkPositioningAllowed() throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException); diff --git a/dbaccess/source/core/api/RowSetCache.cxx b/dbaccess/source/core/api/RowSetCache.cxx index e213e456029c..4a79b2be6a64 100644 --- a/dbaccess/source/core/api/RowSetCache.cxx +++ b/dbaccess/source/core/api/RowSetCache.cxx @@ -2,9 +2,9 @@ * * $RCSfile: RowSetCache.cxx,v $ * - * $Revision: 1.42 $ + * $Revision: 1.43 $ * - * last change: $Author: oj $ $Date: 2001-07-23 07:54:41 $ + * last change: $Author: oj $ $Date: 2001-07-24 13:25:25 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -1419,6 +1419,7 @@ void SAL_CALL ORowSetCache::updateRow( ORowSetMatrix::iterator& _rUpdateRow ) th throw SQLException(); Any aBookmark = (*(*_rUpdateRow))[0].makeAny(); + OSL_ENSURE(aBookmark.hasValue(),"Bookmark must have a value!"); moveToBookmark(aBookmark); m_pCacheSet->updateRow(*_rUpdateRow,*m_aMatrixIter,m_aUpdateTable); // *(*m_aMatrixIter) = *(*_rUpdateRow); diff --git a/dbaccess/source/core/api/RowSetCache.hxx b/dbaccess/source/core/api/RowSetCache.hxx index 5a8776831206..1d3cda1384fa 100644 --- a/dbaccess/source/core/api/RowSetCache.hxx +++ b/dbaccess/source/core/api/RowSetCache.hxx @@ -2,9 +2,9 @@ * * $RCSfile: RowSetCache.hxx,v $ * - * $Revision: 1.12 $ + * $Revision: 1.13 $ * - * last change: $Author: oj $ $Date: 2001-07-19 09:29:22 $ + * last change: $Author: oj $ $Date: 2001-07-24 13:25:25 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -200,8 +200,8 @@ namespace dbaccess void firePropertyChange(sal_Int32 _nColumnIndex,const ::com::sun::star::uno::Any& _rOldValue); void rotateCacheIterator(sal_Int16 _nDist); - void updateValue(sal_Int32 columnIndex,const ORowSetValue& x); - ORowSetValue getValue(sal_Int32 columnIndex); + void updateValue(sal_Int32 columnIndex,const connectivity::ORowSetValue& x); + connectivity::ORowSetValue getValue(sal_Int32 columnIndex); // checks and set the flags isAfterLast isLast and position when afterlast is true void checkPositionFlags(); void checkUpdateConditions(sal_Int32 columnIndex); @@ -218,7 +218,7 @@ namespace dbaccess ORowSetCache(const ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XResultSet >&, const ::com::sun::star::uno::Reference< ::com::sun::star::sdb::XSQLQueryComposer >& _xComposer, const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& _xServiceFactory, - const connectivity::ORowVector< ORowSetValue >& _rParameterRow, + const connectivity::ORowVector< connectivity::ORowSetValue >& _rParameterRow, const ::rtl::OUString& _rUpdateTableName, sal_Bool& _bModified, sal_Bool& _bNew); @@ -329,6 +329,9 @@ namespace dbaccess /*------------------------------------------------------------------------ $Log: not supported by cvs2svn $ + Revision 1.12 2001/07/19 09:29:22 oj + #86186# check parsetree for joins + Revision 1.11 2001/07/12 07:56:32 oj #89437# positioning cache when standing on a row outside the cache diff --git a/dbaccess/source/core/api/RowSetRow.hxx b/dbaccess/source/core/api/RowSetRow.hxx index 076dda3aa961..3a007662f501 100644 --- a/dbaccess/source/core/api/RowSetRow.hxx +++ b/dbaccess/source/core/api/RowSetRow.hxx @@ -2,9 +2,9 @@ * * $RCSfile: RowSetRow.hxx,v $ * - * $Revision: 1.3 $ + * $Revision: 1.4 $ * - * last change: $Author: oj $ $Date: 2001-05-18 11:48:25 $ + * last change: $Author: oj $ $Date: 2001-07-24 13:25:25 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -67,8 +67,8 @@ #ifndef _CONNECTIVITY_COMMONTOOLS_HXX_ #include <connectivity/CommonTools.hxx> #endif -#ifndef DBACCESS_CORE_API_ROWSETVALUE_HXX -#include "RowSetValue.hxx" +#ifndef _CONNECTIVITY_FILE_VALUE_HXX_ +#include "connectivity/FValue.hxx" #endif #ifndef _COMPHELPER_TYPES_HXX_ #include <comphelper/types.hxx> @@ -76,7 +76,7 @@ namespace dbaccess { - typedef ::vos::ORef< connectivity::ORowVector< ORowSetValue > > ORowSetRow; + typedef ::vos::ORef< connectivity::ORowVector< connectivity::ORowSetValue > > ORowSetRow; typedef ::std::vector< ORowSetRow > ORowSetMatrix; class ORowSetValueCompare @@ -108,6 +108,9 @@ namespace dbaccess /*------------------------------------------------------------------------ $Log: not supported by cvs2svn $ + Revision 1.3 2001/05/18 11:48:25 oj + #86528# size changes + Revision 1.2 2000/10/11 11:18:11 fs replace unotools with comphelper diff --git a/dbaccess/source/core/api/StaticSet.cxx b/dbaccess/source/core/api/StaticSet.cxx index 1884eceedf30..98ca1f94ed10 100644 --- a/dbaccess/source/core/api/StaticSet.cxx +++ b/dbaccess/source/core/api/StaticSet.cxx @@ -2,9 +2,9 @@ * * $RCSfile: StaticSet.cxx,v $ * - * $Revision: 1.10 $ + * $Revision: 1.11 $ * - * last change: $Author: oj $ $Date: 2001-05-21 11:24:49 $ + * last change: $Author: oj $ $Date: 2001-07-24 13:25:25 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -146,7 +146,7 @@ sal_Bool OStaticSet::fetchRow() sal_Bool bRet; if(!m_bEnd && (bRet = m_xDriverSet->next())) { - m_aSet.push_back(new connectivity::ORowVector< ORowSetValue >(m_xSetMetaData->getColumnCount())); + m_aSet.push_back(new connectivity::ORowVector< connectivity::ORowSetValue >(m_xSetMetaData->getColumnCount())); m_aSetIter = m_aSet.end() - 1; (*(*m_aSetIter))[0] = (sal_Int32)(m_aSet.size()); OCacheSet::fillValueRow(*m_aSetIter,(*(*m_aSetIter))[0]); @@ -162,7 +162,7 @@ void OStaticSet::fillAllRows() { while(m_xDriverSet->next()) { - ORowSetRow pRow = new connectivity::ORowVector< ORowSetValue >(m_xSetMetaData->getColumnCount()); + ORowSetRow pRow = new connectivity::ORowVector< connectivity::ORowSetValue >(m_xSetMetaData->getColumnCount()); m_aSet.push_back(pRow); m_aSetIter = m_aSet.end() - 1; (*pRow)[0] = (sal_Int32)(m_aSet.size()); @@ -386,6 +386,9 @@ void SAL_CALL OStaticSet::moveToCurrentRow( ) throw(SQLException, RuntimeExcept /*------------------------------------------------------------------------ $Log: not supported by cvs2svn $ + Revision 1.10 2001/05/21 11:24:49 oj + #87082# check if type need literals + Revision 1.9 2001/05/18 12:02:50 oj #86528# size changes diff --git a/dbaccess/source/core/api/makefile.mk b/dbaccess/source/core/api/makefile.mk index ea5b7358d9d7..a79287b7a761 100644 --- a/dbaccess/source/core/api/makefile.mk +++ b/dbaccess/source/core/api/makefile.mk @@ -2,9 +2,9 @@ # # $RCSfile: makefile.mk,v $ # -# $Revision: 1.7 $ +# $Revision: 1.8 $ # -# last change: $Author: oj $ $Date: 2001-04-20 13:09:11 $ +# last change: $Author: oj $ $Date: 2001-07-24 13:25:25 $ # # The Contents of this file are made available subject to the terms of # either of the following licenses @@ -93,7 +93,6 @@ SLOFILES= \ $(SLO)$/StaticSet.obj \ $(SLO)$/CacheSet.obj \ $(SLO)$/RowSetCache.obj \ - $(SLO)$/RowSetValue.obj \ $(SLO)$/definitioncolumn.obj \ $(SLO)$/resultcolumn.obj \ $(SLO)$/datacolumn.obj \ diff --git a/dbaccess/source/core/api/querycomposer.cxx b/dbaccess/source/core/api/querycomposer.cxx index 8d8b40fca5b0..3ae16f55b64c 100644 --- a/dbaccess/source/core/api/querycomposer.cxx +++ b/dbaccess/source/core/api/querycomposer.cxx @@ -2,9 +2,9 @@ * * $RCSfile: querycomposer.cxx,v $ * - * $Revision: 1.36 $ + * $Revision: 1.37 $ * - * last change: $Author: oj $ $Date: 2001-07-12 06:01:09 $ + * last change: $Author: oj $ $Date: 2001-07-24 13:25:25 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -658,53 +658,59 @@ void SAL_CALL OQueryComposer::appendFilterByColumn( const Reference< XPropertySe aSql = getTableAlias(column) + ::dbtools::quoteName(aQuote,aName); // ::rtl::OUString aSql = getTableAlias(column) + aName; - - switch(nType) + if(aValue.hasValue()) { - case DataType::VARCHAR: - case DataType::CHAR: - case DataType::LONGVARCHAR: - aSql += STR_LIKE; - aSql += ::rtl::OUString::createFromAscii("\'"); - aSql += toString(aValue).getStr(); - aSql += ::rtl::OUString::createFromAscii("\'"); - break; - case DataType::VARBINARY: - case DataType::BINARY: - case DataType::LONGVARBINARY: - { - Sequence<sal_Int8> aSeq; - if(aValue >>= aSeq) + + switch(nType) + { + case DataType::VARCHAR: + case DataType::CHAR: + case DataType::LONGVARCHAR: + aSql += STR_LIKE; + aSql += ::rtl::OUString::createFromAscii("\'"); + aSql += toString(aValue).getStr(); + aSql += ::rtl::OUString::createFromAscii("\'"); + break; + case DataType::VARBINARY: + case DataType::BINARY: + case DataType::LONGVARBINARY: { - if(nSearchable == ColumnSearch::CHAR) + Sequence<sal_Int8> aSeq; + if(aValue >>= aSeq) { - aSql += STR_LIKE; - aSql += ::rtl::OUString::createFromAscii("\'"); + if(nSearchable == ColumnSearch::CHAR) + { + aSql += STR_LIKE; + aSql += ::rtl::OUString::createFromAscii("\'"); + } + else + aSql += STR_EQUAL; + aSql += ::rtl::OUString::createFromAscii("0x"); + const sal_Int8* pBegin = aSeq.getConstArray(); + const sal_Int8* pEnd = pBegin + aSeq.getLength(); + for(;pBegin != pEnd;++pBegin) + { + aSql += ::rtl::OUString::valueOf((sal_Int32)*pBegin,16).getStr(); + } + if(nSearchable == ColumnSearch::NONE) + aSql += ::rtl::OUString::createFromAscii("\'"); } else - aSql += STR_EQUAL; - aSql += ::rtl::OUString::createFromAscii("0x"); - const sal_Int8* pBegin = aSeq.getConstArray(); - const sal_Int8* pEnd = pBegin + aSeq.getLength(); - for(;pBegin != pEnd;++pBegin) - { - aSql += ::rtl::OUString::valueOf((sal_Int32)*pBegin,16).getStr(); - } - if(nSearchable == ColumnSearch::NONE) - aSql += ::rtl::OUString::createFromAscii("\'"); + throw SQLException(::rtl::OUString::createFromAscii("Column value isn't from type Sequence<sal_Int8>!"),*this,::rtl::OUString::createFromAscii("HY000"),1000,Any()); } - else - throw SQLException(::rtl::OUString::createFromAscii("Column value isn't from type Sequence<sal_Int8>!"),*this,::rtl::OUString::createFromAscii("HY000"),1000,Any()); - } - break; - default: - { - ::rtl::OUString aValueStr(toString(aValue)); - aSql += STR_EQUAL; - aSql += ::rtl::OUString::createFromAscii(" "); - aSql += aValueStr.getStr(); - } + break; + default: + { + ::rtl::OUString aValueStr(toString(aValue)); + aSql += STR_EQUAL; + aSql += ::rtl::OUString::createFromAscii(" "); + aSql += aValueStr.getStr(); + } + } } + else + aSql += ::rtl::OUString::createFromAscii(" IS NULL") ; + // filter anhaengen // select ohne where und order by aufbauen |