diff options
Diffstat (limited to 'dbaccess/source/core/api/KeySet.cxx')
-rw-r--r-- | dbaccess/source/core/api/KeySet.cxx | 46 |
1 files changed, 23 insertions, 23 deletions
diff --git a/dbaccess/source/core/api/KeySet.cxx b/dbaccess/source/core/api/KeySet.cxx index 0d4c3147efb6..17ec5dfacdba 100644 --- a/dbaccess/source/core/api/KeySet.cxx +++ b/dbaccess/source/core/api/KeySet.cxx @@ -89,7 +89,7 @@ namespace for(sal_Int32 j = 0 ; j < nCount ; ++j) { xIndexColsSup.set(_xIndexes->getByIndex(j),UNO_QUERY); - if( xIndexColsSup.is() + if( xIndexColsSup.is() && comphelper::getBOOL(xIndexColsSup->getPropertyValue(PROPERTY_ISUNIQUE)) && !comphelper::getBOOL(xIndexColsSup->getPropertyValue(PROPERTY_ISPRIMARYKEYINDEX)) ) @@ -102,7 +102,7 @@ DBG_NAME(OKeySet) OKeySet::OKeySet(const connectivity::OSQLTable& _xTable, const Reference< XIndexAccess>& _xTableKeys, - const ::rtl::OUString& _rUpdateTableName, // this can be the alias or the full qualified name + const ::rtl::OUString& _rUpdateTableName, // this can be the alias or the full qualified name const Reference< XSingleSelectQueryAnalyzer >& _xComposer, const ORowSetValueVector& _aParameterValueForCache) :m_aParameterValueForCache(_aParameterValueForCache) @@ -156,7 +156,7 @@ void OKeySet::findTableColumnsMatching_throw( const Any& i_aTable, { // first ask the database itself for the best columns which can be used Sequence< ::rtl::OUString> aBestColumnNames; - Reference<XNameAccess> xKeyColumns = getPrimaryKeyColumns_throw(i_aTable); + Reference<XNameAccess> xKeyColumns = getPrimaryKeyColumns_throw(i_aTable); if ( xKeyColumns.is() ) aBestColumnNames = xKeyColumns->getElementNames(); @@ -220,7 +220,7 @@ void OKeySet::findTableColumnsMatching_throw( const Any& i_aTable, ::rtl::OUStringBuffer OKeySet::createKeyFilter() { static ::rtl::OUString aAnd(RTL_CONSTASCII_USTRINGPARAM(" AND ")); - const ::rtl::OUString aQuote = getIdentifierQuoteString(); + const ::rtl::OUString aQuote = getIdentifierQuoteString(); ::rtl::OUStringBuffer aFilter; static ::rtl::OUString s_sDot(RTL_CONSTASCII_USTRINGPARAM(".")); static ::rtl::OUString s_sParam(RTL_CONSTASCII_USTRINGPARAM(" = ?")); @@ -246,13 +246,13 @@ void OKeySet::construct(const Reference< XResultSet>& _xDriverSet,const ::rtl::O OCacheSet::construct(_xDriverSet,i_sRowSetFilter); initColumns(); - Reference<XNameAccess> xKeyColumns = getKeyColumns(); + Reference<XNameAccess> xKeyColumns = getKeyColumns(); Reference<XDatabaseMetaData> xMeta = m_xConnection->getMetaData(); Reference<XColumnsSupplier> xQueryColSup(m_xComposer,UNO_QUERY); const Reference<XNameAccess> xQueryColumns = xQueryColSup->getColumns(); findTableColumnsMatching_throw(makeAny(m_xTable),m_sUpdateTableName,xMeta,xQueryColumns,m_pKeyColumnNames); - // the first row is empty because it's now easier for us to distinguish when we are beforefirst or first + // the first row is empty because it's now easier for us to distinguish when we are beforefirst or first // without extra varaible to be set m_aKeyMap.insert(OKeySetMatrix::value_type(0,OKeySetValue(NULL,::std::pair<sal_Int32,Reference<XRow> >(0,NULL)))); m_aKeyIter = m_aKeyMap.begin(); @@ -269,11 +269,11 @@ void OKeySet::construct(const Reference< XResultSet>& _xDriverSet,const ::rtl::O if ( aSeq.getLength() > 1 ) // special handling for join { static ::rtl::OUString aAnd(RTL_CONSTASCII_USTRINGPARAM(" AND ")); - const ::rtl::OUString aQuote = getIdentifierQuoteString(); + const ::rtl::OUString aQuote = getIdentifierQuoteString(); static ::rtl::OUString s_sDot(RTL_CONSTASCII_USTRINGPARAM(".")); static ::rtl::OUString s_sParam(RTL_CONSTASCII_USTRINGPARAM(" = ?")); const ::rtl::OUString* pIter = aSeq.getConstArray(); - const ::rtl::OUString* pEnd = pIter + aSeq.getLength(); + const ::rtl::OUString* pEnd = pIter + aSeq.getLength(); for(;pIter != pEnd;++pIter) { if ( *pIter != m_sUpdateTableName ) @@ -401,7 +401,7 @@ Sequence< sal_Int32 > SAL_CALL OKeySet::deleteRows( const Sequence< Any >& rows aSql.append(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(" WHERE "))); // list all cloumns that should be set - const ::rtl::OUString aQuote = getIdentifierQuoteString(); + const ::rtl::OUString aQuote = getIdentifierQuoteString(); static ::rtl::OUString aAnd(RTL_CONSTASCII_USTRINGPARAM(" AND ")); static ::rtl::OUString aOr(RTL_CONSTASCII_USTRINGPARAM(" OR ")); static ::rtl::OUString aEqual(RTL_CONSTASCII_USTRINGPARAM(" = ?")); @@ -424,8 +424,8 @@ Sequence< sal_Int32 > SAL_CALL OKeySet::deleteRows( const Sequence< Any >& rows aCondition.setLength(aCondition.getLength()-5); const ::rtl::OUString sCon( aCondition.makeStringAndClear() ); - const Any* pBegin = rows.getConstArray(); - const Any* pEnd = pBegin + rows.getLength(); + const Any* pBegin = rows.getConstArray(); + const Any* pEnd = pBegin + rows.getLength(); Sequence< Any > aKeys; for(;pBegin != pEnd;++pBegin) @@ -440,7 +440,7 @@ Sequence< sal_Int32 > SAL_CALL OKeySet::deleteRows( const Sequence< Any >& rows Reference< XPreparedStatement > xPrep(m_xConnection->prepareStatement(aSql.makeStringAndClear())); Reference< XParameters > xParameter(xPrep,UNO_QUERY); - pBegin = rows.getConstArray(); + pBegin = rows.getConstArray(); sal_Int32 i=1; for(;pBegin != pEnd;++pBegin) { @@ -489,7 +489,7 @@ void SAL_CALL OKeySet::updateRow(const ORowSetRow& _rInsertRow ,const ORowSetRow aSql.append(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(" SET "))); // list all cloumns that should be set static ::rtl::OUString aPara(RTL_CONSTASCII_USTRINGPARAM(" = ?,")); - ::rtl::OUString aQuote = getIdentifierQuoteString(); + ::rtl::OUString aQuote = getIdentifierQuoteString(); static ::rtl::OUString aAnd(RTL_CONSTASCII_USTRINGPARAM(" AND ")); ::rtl::OUString sIsNull(RTL_CONSTASCII_USTRINGPARAM(" IS NULL")); ::rtl::OUString sParam(RTL_CONSTASCII_USTRINGPARAM(" = ?")); @@ -950,7 +950,7 @@ void SAL_CALL OKeySet::deleteRow(const ORowSetRow& _rDeleteRow,const connectivit aSql.append(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(" WHERE "))); // list all cloumns that should be set - ::rtl::OUString aQuote = getIdentifierQuoteString(); + ::rtl::OUString aQuote = getIdentifierQuoteString(); static ::rtl::OUString aAnd(RTL_CONSTASCII_USTRINGPARAM(" AND ")); // use keys and indexes for excat postioning @@ -961,7 +961,7 @@ void SAL_CALL OKeySet::deleteRow(const ORowSetRow& _rDeleteRow,const connectivit if ( xIndexSup.is() ) xIndexes.set(xIndexSup->getIndexes(),UNO_QUERY); - // Reference<XColumnsSupplier> + // Reference<XColumnsSupplier> ::std::vector< Reference<XNameAccess> > aAllIndexColumns; lcl_fillIndexColumns(xIndexes,aAllIndexColumns); @@ -1573,11 +1573,11 @@ void getColumnPositions(const Reference<XNameAccess>& _rxQueryColumns, { // get the real name of the columns Sequence< ::rtl::OUString> aSelNames(_rxQueryColumns->getElementNames()); - const ::rtl::OUString* pSelIter = aSelNames.getConstArray(); - const ::rtl::OUString* pSelEnd = pSelIter + aSelNames.getLength(); + const ::rtl::OUString* pSelIter = aSelNames.getConstArray(); + const ::rtl::OUString* pSelEnd = pSelIter + aSelNames.getLength(); - const ::rtl::OUString* pTblColumnIter = _aColumnNames.getConstArray(); - const ::rtl::OUString* pTblColumnEnd = pTblColumnIter + _aColumnNames.getLength(); + const ::rtl::OUString* pTblColumnIter = _aColumnNames.getConstArray(); + const ::rtl::OUString* pTblColumnEnd = pTblColumnIter + _aColumnNames.getLength(); ::comphelper::UStringMixLess aTmp(o_rColumnNames.key_comp()); @@ -1589,17 +1589,17 @@ void getColumnPositions(const Reference<XNameAccess>& _rxQueryColumns, ::rtl::OUString sRealName,sTableName; OSL_ENSURE(xQueryColumnProp->getPropertySetInfo()->hasPropertyByName(PROPERTY_REALNAME),"Property REALNAME not available!"); OSL_ENSURE(xQueryColumnProp->getPropertySetInfo()->hasPropertyByName(PROPERTY_TABLENAME),"Property TABLENAME not available!"); - xQueryColumnProp->getPropertyValue(PROPERTY_REALNAME) >>= sRealName; - xQueryColumnProp->getPropertyValue(PROPERTY_TABLENAME) >>= sTableName; + xQueryColumnProp->getPropertyValue(PROPERTY_REALNAME) >>= sRealName; + xQueryColumnProp->getPropertyValue(PROPERTY_TABLENAME) >>= sTableName; for(;pTblColumnIter != pTblColumnEnd;++pTblColumnIter) { if(bCase(sRealName,*pTblColumnIter) && bCase(_rsUpdateTableName,sTableName) && o_rColumnNames.find(*pTblColumnIter) == o_rColumnNames.end()) { sal_Int32 nType = 0; - xQueryColumnProp->getPropertyValue(PROPERTY_TYPE) >>= nType; + xQueryColumnProp->getPropertyValue(PROPERTY_TYPE) >>= nType; sal_Int32 nScale = 0; - xQueryColumnProp->getPropertyValue(PROPERTY_SCALE) >>= nScale; + xQueryColumnProp->getPropertyValue(PROPERTY_SCALE) >>= nScale; ::rtl::OUString sColumnDefault; if ( xQueryColumnProp->getPropertySetInfo()->hasPropertyByName(PROPERTY_DEFAULTVALUE) ) xQueryColumnProp->getPropertyValue(PROPERTY_DEFAULTVALUE) >>= sColumnDefault; |