28#include <core_resource.hxx>
32#include <com/sun/star/sdbc/ColumnValue.hpp>
33#include <com/sun/star/sdbc/ResultSetConcurrency.hpp>
34#include <com/sun/star/sdbc/ResultSetType.hpp>
35#include <com/sun/star/sdbcx/CompareBookmark.hpp>
36#include <com/sun/star/sdbcx/Privilege.hpp>
37#include <com/sun/star/sdbcx/XColumnsSupplier.hpp>
38#include <com/sun/star/sdbcx/XTablesSupplier.hpp>
47#include <sqlbison.hxx>
50#include <osl/diagnose.h>
64using namespace ::
cppu;
76ORowSetCache::ORowSetCache(
const Reference< XResultSet >& _xRs,
77 const Reference< XSingleSelectQueryAnalyzer >& _xAnalyzer,
78 const Reference<XComponentContext>& _rContext,
79 const OUString& _rUpdateTableName,
83 const OUString& i_sRowSetFilter,
86 ,m_xMetaData(
Reference< XResultSetMetaDataSupplier >(_xRs,UNO_QUERY_THROW)->getMetaData())
90 ,m_nPrivileges( Privilege::
SELECT )
94 ,m_bRowCountFinal(false)
96 ,m_bAfterLast( false )
97 ,m_bModified(_bModified)
102 Reference< XPropertySet> xProp(_xRs,UNO_QUERY);
103 Reference< XPropertySetInfo > xPropInfo = xProp->getPropertySetInfo();
104 bool bBookmarkable =
false;
107 Reference< XResultSetUpdate> xUp(_xRs,UNO_QUERY_THROW);
112 xUp->moveToInsertRow();
113 xUp->cancelRowUpdates();
115 m_nPrivileges = Privilege::SELECT|Privilege::DELETE|Privilege::INSERT|Privilege::UPDATE;
131 catch(
const SQLException&)
137 bool bAllKeysFound =
false;
138 sal_Int32 nTablesCount = 0;
143 OUString aUpdateTableName = _rUpdateTableName;
144 Reference< XConnection> xConnection;
146 Reference< XStatement> xStmt(_xRs->getStatement(),UNO_QUERY);
148 xConnection = xStmt->getConnection();
151 Reference< XPreparedStatement> xPrepStmt(_xRs->getStatement(),UNO_QUERY);
152 xConnection = xPrepStmt->getConnection();
154 OSL_ENSURE(xConnection.is(),
"No connection!");
159 Reference<XTablesSupplier> xTabSup(_xAnalyzer,UNO_QUERY);
160 OSL_ENSURE(xTabSup.is(),
"ORowSet::execute composer isn't a tablesupplier!");
161 Reference<XNameAccess> xTables = xTabSup->getTables();
162 Sequence< OUString> aTableNames = xTables->getElementNames();
163 if ( aTableNames.getLength() > 1 && _rUpdateTableName.isEmpty() && bNeedKeySet )
165 m_nPrivileges = Privilege::SELECT|Privilege::DELETE|Privilege::INSERT|Privilege::UPDATE;
171 if ( pCursor->isReadOnly() )
184 if(!_rUpdateTableName.isEmpty() && xTables->hasByName(_rUpdateTableName))
186 else if(xTables->getElementNames().hasElements())
188 aUpdateTableName = xTables->getElementNames()[0];
191 Reference<XIndexAccess> xIndexAccess(xTables,UNO_QUERY);
192 if(xIndexAccess.is())
193 nTablesCount = xIndexAccess->getCount();
195 nTablesCount = xTables->getElementNames().getLength();
201 if ( xPrimaryKeyColumns.is() )
203 Reference<XColumnsSupplier> xColSup(_xAnalyzer,UNO_QUERY);
206 Reference<XNameAccess> xSelColumns = xColSup->getColumns();
207 Reference<XDatabaseMetaData> xMeta = xConnection->getMetaData();
210 bAllKeysFound = !aColumnNames.empty() && aColumnNames.size() ==
o3tl::make_unsigned(xPrimaryKeyColumns->getElementNames().getLength());
232 if(Reference<XResultSetUpdate>(_xRs,UNO_QUERY).is())
244 catch (
const SQLException&)
254 bAllKeysFound = bAllKeysFound && (nTablesCount == 1 ||
checkJoin(xConnection,_xAnalyzer,aUpdateTableName));
273 Reference<XDatabaseMetaData> xMeta = xConnection->getMetaData();
275 Reference<XColumnsSupplier> xColSup(_xAnalyzer,UNO_QUERY);
276 Reference<XNameAccess> xSelColumns = xColSup->getColumns();
282 bool bNoInsert =
false;
284 Sequence< OUString> aNames(xColumns->getElementNames());
285 const OUString* pIter = aNames.getConstArray();
286 const OUString* pEnd = pIter + aNames.getLength();
287 for(;pIter != pEnd;++pIter)
289 Reference<XPropertySet>
xColumn(xColumns->getByName(*pIter),UNO_QUERY);
290 OSL_ENSURE(
xColumn.is(),
"Column in table is null!");
295 if(
nNullable == ColumnValue::NO_NULLS && aColumnNames.find(*pIter) == aColumnNames.end())
307 pKeySet->construct(_xRs,i_sRowSetFilter);
309 if(Reference<XResultSetUpdate>(_xRs,UNO_QUERY).is())
323 catch (
const SQLException&)
354 m_xSet = WeakReference< XResultSet>();
377 std::vector<sal_Int32> aPositions;
378 std::map<sal_Int32,bool> aCacheIterToChange;
382 aCacheIterToChange[rIndex] =
false;
383 if ( !rHelper.pRowSet->isInsertRow()
386 ptrdiff_t nDist = rHelper.aIterator -
m_pMatrix->begin();
387 aPositions.push_back(nDist);
388 aCacheIterToChange[rIndex] =
true;
394 if ( nKeyPos < _nSize )
401 std::vector<sal_Int32>::const_iterator aIter = aPositions.begin();
403 for(
const auto& rPosChange : aCacheIterToChange)
405 if ( rPosChange.second )
407 OSL_ENSURE((*aIter >=
static_cast<ORowSetMatrix::difference_type
>(0)) && (*aIter <
static_cast<sal_Int32
>(
m_pMatrix->size())),
"Position is invalid!");
408 if ( *aIter < _nSize )
409 aCacheIter->second.aIterator =
m_pMatrix->begin() + *aIter++;
411 aCacheIter->second.aIterator =
m_pMatrix->end();
418 sal_Int32 nNewSt = 0;
420 OSL_ENSURE(nNewSt == 0,
"fillMatrix set new start to unexpected value");
426 sal_Int32 nNewSt = -1;
442 OSL_FAIL(
"m_nPosition not between m_nStartPos and m_nEndpos");
455 case DataType::TINYINT:
456 case DataType::SMALLINT:
457 case DataType::INTEGER:
460 if ( i_pCacheSet && i_aValue.
isNull())
496 OSL_ENSURE(
m_aMatrixIter->is(),
"Iterator after moveToBookmark not valid");
526 return (!_first.hasValue() || !_second.hasValue()) ? CompareBookmark::NOT_COMPARABLE :
m_xCacheSet->compareBookmarks(_first,_second);
541 ,std::vector<sal_Int32>& o_ChangedColumns
547 if ( !rInsert[columnIndex].isNull() )
549 rInsert[columnIndex].setBound(
true);
550 rInsert[columnIndex].setNull();
551 rInsert[columnIndex].setModified(
true);
552 io_aRow[columnIndex].setNull();
554 m_xCacheSet->mergeColumnValues(columnIndex,rInsert,io_aRow,o_ChangedColumns);
561 ,std::vector<sal_Int32>& o_ChangedColumns
567 if ( rInsert[columnIndex] !=
x )
569 rInsert[columnIndex].setBound(
true);
570 rInsert[columnIndex] =
x;
571 rInsert[columnIndex].setModified(
true);
572 io_aRow[columnIndex] = rInsert[columnIndex];
574 m_xCacheSet->mergeColumnValues(columnIndex,rInsert,io_aRow,o_ChangedColumns);
581 ,std::vector<sal_Int32>& o_ChangedColumns
586 Sequence<sal_Int8>
aSeq;
591 rInsert[columnIndex].setBound(
true);
592 rInsert[columnIndex] =
aSeq;
593 rInsert[columnIndex].setModified(
true);
594 io_aRow[columnIndex] =
Any(
x);
596 m_xCacheSet->mergeColumnValues(columnIndex,rInsert,io_aRow,o_ChangedColumns);
602 ,std::vector<sal_Int32>& o_ChangedColumns
610 if ( rInsert[columnIndex] != aTemp )
612 rInsert[columnIndex].setBound(
true);
613 rInsert[columnIndex] = aTemp;
615 io_aRow[columnIndex] = rInsert[columnIndex];
617 m_xCacheSet->mergeColumnValues(columnIndex,rInsert,io_aRow,o_ChangedColumns);
624 ,std::vector<sal_Int32>& o_ChangedColumns
632 if ( rInsert[columnIndex] != aTemp )
634 rInsert[columnIndex].setBound(
true);
635 rInsert[columnIndex] = aTemp;
637 io_aRow[columnIndex] = rInsert[columnIndex];
639 m_xCacheSet->mergeColumnValues(columnIndex,rInsert,io_aRow,o_ChangedColumns);
713 OSL_ENSURE((_nNewStartPos != _nNewEndPos) || (_nNewStartPos == 0 && _nNewEndPos == 0 &&
m_nRowCount == 0),
714 "ORowSetCache::fillMatrix: StartPos and EndPos can not be equal (unless the recordset is empty)!");
718 OSL_ENSURE( _nNewStartPos >= -1,
"ORowSetCache::fillMatrix: invalid _nNewStartPos" );
720 ORowSetMatrix::iterator aIter;
723 sal_Int32 requestedStartPos;
724 if ( _nNewStartPos == -1 )
733 i = _nNewStartPos + 1;
734 requestedStartPos = _nNewStartPos;
739 for(;
i <= _nNewEndPos; ++
i,++aIter)
758 const ORowSetMatrix::iterator aEnd = aIter;
759 ORowSetMatrix::const_iterator aRealEnd =
m_pMatrix->end();
769 _nNewStartPos =
nPos;
774 for(;bCheck &&
nPos <= requestedStartPos && aIter != aRealEnd; ++aIter, ++
nPos)
782 std::rotate(
m_pMatrix->begin(),aEnd,aIter);
809 OSL_ENSURE(
m_nStartPos >= 0,
"ORowSetCache::moveWindow: m_nStartPos is less than 0!");
810 OSL_ENSURE(
m_nEndPos >=
m_nStartPos,
"ORowSetCache::moveWindow: m_nStartPos not smaller than m_nEndPos");
847 sal_Int32 nNewStartPos = (
m_nPosition - nDiff) - 1;
850 if ( nNewStartPos < 0 )
854 nNewEndPos -= nNewStartPos;
873 const sal_Int32 nStartPosOffset =
m_nStartPos - nNewStartPos;
878 ORowSetMatrix::iterator aEnd (
m_pMatrix->begin() + nOverlapSize);
880 ORowSetMatrix::iterator aNewEnd (aEnd + nStartPosOffset);
894 ORowSetMatrix::iterator aIter(aEnd);
899 std::rotate(
m_pMatrix->begin(), aEnd, aNewEnd);
906 if ( !rCacheIter.second.pRowSet->isInsertRow()
907 && rCacheIter.second.aIterator !=
m_pMatrix->end() )
909 const ptrdiff_t nDist = rCacheIter.second.aIterator -
m_pMatrix->begin();
910 if ( nDist >= nOverlapSize )
913 rCacheIter.second.aIterator =
m_pMatrix->end();
918 OSL_ENSURE(((nDist + nStartPosOffset) >=
static_cast<ORowSetMatrix::difference_type
>(0)) &&
919 ((nDist + nStartPosOffset) <
static_cast<sal_Int32
>(
m_pMatrix->size())),
"Position is invalid!");
920 rCacheIter.second.aIterator += nStartPosOffset;
921 OSL_ENSURE(rCacheIter.second.aIterator >=
m_pMatrix->begin()
922 && rCacheIter.second.aIterator <
m_pMatrix->end(),
"Iterator out of area!");
930 OSL_FAIL(
"What the hell is happen here!");
940 OSL_ENSURE(nNewStartPos >=
m_nStartPos,
"ORowSetCache::moveWindow internal error: new start pos before current start pos");
949 OSL_ENSURE((nRowsInCache >=
static_cast<ORowSetMatrix::difference_type
>(0)) && (
o3tl::make_unsigned(nRowsInCache) <
m_pMatrix->size()),
"Position is invalid!");
952 ORowSetMatrix::iterator aIter =
m_pMatrix->begin() + nRowsInCache;
954 const ORowSetMatrix::const_iterator aEnd = aIter + nRowsToFetch;
955 bCheck =
fill(aIter, aEnd,
nPos, bCheck);
957 OSL_ENSURE( (!bCheck &&
m_nEndPos <= nNewEndPos ) ||
959 "ORowSetCache::moveWindow opportunistic fetch-after-current-end went badly");
965 ORowSetMatrix::iterator aIter =
m_pMatrix->begin();
966 const sal_Int32 nNewStartPosInMatrix = nNewStartPos -
m_nStartPos;
967 OSL_ENSURE((nNewStartPosInMatrix >=
static_cast<ORowSetMatrix::difference_type
>(0)) && (
o3tl::make_unsigned(nNewStartPosInMatrix) <
m_pMatrix->size()),
"Position is invalid!");
969 const ORowSetMatrix::const_iterator aEnd =
m_pMatrix->begin() + nNewStartPosInMatrix;
975 bCheck =
fill(aIter, aEnd,
nPos, bCheck);
981 OSL_ENSURE(aIter == aEnd,
"fill() said went till end, but did not.");
983 std::rotate(
m_pMatrix->begin(), aIter, aDataEnd);
1004 OSL_ENSURE(
m_nRowCount >=
nPos,
"Final m_nRowCount is smaller than row I moved to!");
1009 const ORowSetMatrix::const_iterator::difference_type nFetchedRows = aIter -
m_pMatrix->begin();
1017 std::rotate(
m_pMatrix->begin(), aIter, aDataEnd);
1037 for(; !aIter->is() && bCheck;++aIter, ++
nPos)
1039 OSL_ENSURE(aIter !=
m_pMatrix->end(),
"Invalid iterator");
1054 OSL_ENSURE(
m_nStartPos >= 0,
"ORowSetCache::moveWindow: m_nStartPos is less than 0!");
1055 OSL_ENSURE(
m_nEndPos >
m_nStartPos,
"ORowSetCache::moveWindow: m_nStartPos not smaller than m_nEndPos");
1078 OSL_ENSURE(
m_bBeforeFirst ||
m_bNew,
"ORowSetCache::first return false and BeforeFirst isn't true");
1106 OSL_ENSURE(
m_bBeforeFirst,
"ORowSetCache::last return false and BeforeFirst isn't true");
1109#if OSL_DEBUG_LEVEL > 0
1112 assert((*m_aMatrixIter).is() &&
"ORowSetCache::last: Row not valid!");
1185 nNewPosition = rows;
1229 bRet = (*m_aMatrixIter).is();
1271 Any aBookmark = (**m_aInsertRow)[0].makeAny();
1273 if(aBookmark.hasValue())
1278 ORowSetMatrix::const_iterator aIter =
m_pMatrix->begin();
1289 OSL_FAIL(
"There must be a bookmark after the row was inserted!");
1297 if ( _bClearInsertRow )
1308 if ( rCacheIter.second.pRowSet->isInsertRow() && rCacheIter.second.aIterator ==
m_aInsertRow )
1309 rCacheIter.second.aIterator =
m_pMatrix->end();
1319 Any aBookmark = (**_rUpdateRow)[0].makeAny();
1320 OSL_ENSURE(aBookmark.hasValue(),
"Bookmark must have a value!");
1326 (*m_aMatrixIter) =
nullptr;
1332 ORowSetMatrix::const_iterator aIter =
m_pMatrix->begin();
1359 ORowSetMatrix::const_iterator aEnd =
m_pMatrix->end();
1360 for(++aPos;aPos != aEnd && aPos->is();++aPos)
1376 OSL_FAIL(
"cancelRowUpdates:Invalid positions pos == 0");
1377 ::dbtools::throwFunctionSequenceException(
nullptr);
1384 OSL_FAIL(
"cancelRowUpdates couldn't position right with absolute");
1385 ::dbtools::throwFunctionSequenceException(
nullptr);
1399 ORowSetValueVector::Vector::iterator aIter = (*m_aInsertRow)->begin()+1;
1400 ORowSetValueVector::Vector::const_iterator aEnd = (*m_aInsertRow)->end();
1401 for(sal_Int32
i = 1;aIter != aEnd;++aIter,++
i)
1403 aIter->setBound(
false);
1404 aIter->setModified(
false);
1423 if ( aCacheIter->second.pRowSet == _pRowSet )
1443 if ( !rCacheIter.second.pRowSet->isInsertRow()
1444 && rCacheIter.second.aIterator !=
m_pMatrix->end())
1446 ptrdiff_t nDist = rCacheIter.second.aIterator -
m_pMatrix->begin();
1449 rCacheIter.second.aIterator =
m_pMatrix->end();
1453 OSL_ENSURE((rCacheIter.second.aIterator -
m_pMatrix->begin()) >= _nDist,
"Invalid Dist value!");
1454 rCacheIter.second.aIterator -= _nDist;
1455 OSL_ENSURE(rCacheIter.second.aIterator >=
m_pMatrix->begin()
1456 && rCacheIter.second.aIterator <
m_pMatrix->end(),
"Iterator out of area!");
1470 if (!rCacheIter.second.pRowSet->isInsertRow())
1472 rCacheIter.second.aIterator =
m_pMatrix->end();
1483 (*(*m_aInsertRow)) = *(*_rOriginalRow);
1486 rItem.setModified(
false);
1501 if(
m_bAfterLast || columnIndex >=
static_cast<sal_Int32
>((*m_aInsertRow)->size()))
1508 if (pNode->count() == 3 &&
1512 bOk =
checkInnerJoin(pNode->getChild(1),_xConnection,_sUpdateTableName);
1515 pNode->count() == 3)
1519 bOk =
checkInnerJoin(pNode->getChild(0),_xConnection,_sUpdateTableName)
1520 &&
checkInnerJoin(pNode->getChild(2),_xConnection,_sUpdateTableName);
1522 else if (
SQL_ISRULE(pNode,comparison_predicate))
1525 OSL_ENSURE(pNode->count() == 3,
"checkInnerJoin: Error in Parse Tree");
1526 if (!(
SQL_ISRULE(pNode->getChild(0),column_ref) &&
1534 OUString sColumnName,sTableRange;
1536 bOk = sTableRange == _sUpdateTableName;
1540 bOk = sTableRange == _sUpdateTableName;
1548 const Reference< XSingleSelectQueryAnalyzer >& _xAnalyzer,
1549 const OUString& _sUpdateTableName )
1552 OUString sSql = _xAnalyzer->getQuery();
1555 std::unique_ptr< ::connectivity::OSQLParseNode> pSqlParseNode( aSqlParser.
parseTree(sErrorMsg,sSql));
1556 if ( pSqlParseNode &&
SQL_ISRULE(pSqlParseNode, select_statement) )
1559 OSL_ENSURE(pTableRefCommalist,
"NO tables why!?");
1560 if(pTableRefCommalist && pTableRefCommalist->
count() == 1)
1569 pOuterType = pJoinType->
getChild(0);
1570 else if(
SQL_ISRULE(pJoinType,outer_join_type))
1571 pOuterType = pJoinType;
1573 bool bCheck =
false;
1574 bool bLeftSide =
false;
1588 OSL_ENSURE(
SQL_ISRULE(pTableRef,table_ref),
"Must be a tableref here!");
1591 if(sTableRange.isEmpty())
1593 bOk = sTableRange == _sUpdateTableName;
1600 if ( pWhereOpt && !pWhereOpt->
isLeaf() )
1612 ORowSetValueVector::Vector::iterator aIter = (*m_aInsertRow)->begin()+1;
1613 ORowSetValueVector::Vector::const_iterator aEnd = (*m_aInsertRow)->end();
1614 for(;aIter != aEnd;++aIter)
1616 aIter->setBound(
false);
1617 aIter->setModified(
false);
1649 if ( rxOldRow.is() && rxOldRow->getRow().is() )
1652 sal_Int32 nNewSt = _nNewStartPos;
1660bool ORowSetCache::fill(ORowSetMatrix::iterator& _aIter,
const ORowSetMatrix::const_iterator& _aEnd, sal_Int32& _nPos,
bool _bCheck)
1662 const sal_Int32 nColumnCount =
m_xMetaData->getColumnCount();
1663 for (; _bCheck && _aIter != _aEnd; ++_aIter, ++
_nPos)
1665 if ( !_aIter->is() )
1671 if ( rxOldRow->getRow() == *_aIter )
1698 ,std::vector<sal_Int32>
const & o_ChangedColumns)
1700 if ( o_ChangedColumns.size() > 1 )
1704 if ( elem.is() &&
m_xCacheSet->updateColumnValues(*elem,io_aRow,o_ChangedColumns))
static Any lcl_getBookmark(ORowSetValue &i_aValue, OCacheSet *i_pCacheSet)
std::vector< VectorVal > Vector
sal_Int32 getInt32() const
sal_Int32 getTypeKind() const
void setModified(bool _bMod)
void fill(sal_Int32 _nPos, sal_Int32 _nType, const css::uno::Reference< css::sdbc::XRow > &_xRow)
const css::uno::Any & getAny() const
void parseNodeToStr(OUString &rString, const css::uno::Reference< css::sdbc::XConnection > &_rxConnection, const IParseContext *pContext=nullptr, bool _bIntl=false, bool _bQuote=true) const
static OUString getTableRange(const OSQLParseNode *_pTableRef)
OSQLParseNode * getChild(sal_uInt32 nPos) const
OSQLParseNode * getByRule(OSQLParseNode::Rule eRule) const
void getColumnRange(const OSQLParseNode *_pColumnRef, OUString &_rColumnName, OUString &_rTableRange) const
std::unique_ptr< OSQLParseNode > parseTree(OUString &rErrorMessage, const OUString &rStatement, bool bInternational=false)
virtual css::uno::Any getBookmark()=0
std::unique_ptr< ORowSetMatrix > m_pMatrix
const css::uno::Reference< css::sdbc::XResultSetMetaData > & getMetaData() const
bool relative(sal_Int32 rows)
connectivity::OSQLTable m_aUpdateTable
css::uno::Any getBookmark()
sal_Int32 compareBookmarks(const css::uno::Any &first, const css::uno::Any &second)
void reset(const css::uno::Reference< css::sdbc::XResultSet > &_xDriverSet)
void checkPositionFlags()
void resetInsertRow(bool _bClearInsertRow)
bool absolute(sal_Int32 row)
std::map< sal_Int32, sal_Int32 > m_aKeyColumns
void updateValue(sal_Int32 columnIndex, const connectivity::ORowSetValue &x, ORowSetValueVector::Vector &io_aRow, std::vector< sal_Int32 > &o_ChangedColumns)
css::uno::WeakReference< css::sdbc::XResultSet > m_xSet
ORowSetCacheMap m_aCacheIterators
void setUpdateIterator(const ORowSetMatrix::iterator &_rOriginalRow)
bool moveRelativeToBookmark(const css::uno::Any &bookmark, sal_Int32 rows)
void rotateCacheIterator(ORowSetMatrix::difference_type _nDist)
void updateRow(ORowSetMatrix::iterator const &_rUpdateRow, std::vector< css::uno::Any > &o_aBookmarks)
void updateObject(sal_Int32 columnIndex, const css::uno::Any &x, ORowSetValueVector::Vector &io_aRow, std::vector< sal_Int32 > &o_ChangedColumns)
rtl::Reference< OCacheSet > m_xCacheSet
bool moveToBookmark(const css::uno::Any &bookmark)
ORowSetMatrix::iterator m_aMatrixIter
bool isResultSetChanged() const
bool checkJoin(const css::uno::Reference< css::sdbc::XConnection > &_xConnection, const css::uno::Reference< css::sdb::XSingleSelectQueryAnalyzer > &_xComposer, const OUString &_sUpdateTableName)
ORowSetCacheIterator createIterator(ORowSetBase *_pRowSet)
sal_Int32 hashBookmark(const css::uno::Any &bookmark)
void rotateAllCacheIterators()
bool fill(ORowSetMatrix::iterator &_aIter, const ORowSetMatrix::const_iterator &_aEnd, sal_Int32 &_nPos, bool _bCheck)
ORowSetMatrix::iterator m_aInsertRow
bool insertRow(std::vector< css::uno::Any > &o_aBookmarks)
ORowSetMatrix::iterator calcPosition() const
bool checkInnerJoin(const ::connectivity::OSQLParseNode *pNode, const css::uno::Reference< css::sdbc::XConnection > &_xConnection, const OUString &_sUpdateTableName)
TOldRowSetRows m_aOldRows
void impl_updateRowFromCache_throw(ORowSetValueVector::Vector &io_aRow, std::vector< sal_Int32 > const &o_ChangedColumns)
TORowSetOldRowHelperRef registerOldRow()
bool fillMatrix(sal_Int32 &_nNewStartPos, sal_Int32 &_nNewEndPos)
void deregisterOldRow(const TORowSetOldRowHelperRef &_rRow)
bool isBeforeFirst() const
void updateNumericObject(sal_Int32 columnIndex, const css::uno::Any &x, ORowSetValueVector::Vector &io_aRow, std::vector< sal_Int32 > &o_ChangedColumns)
bool hasOrderedBookmarks()
friend class ORowSetCacheIterator
void updateCharacterStream(sal_Int32 columnIndex, const css::uno::Reference< css::io::XInputStream > &x, sal_Int32 length, ORowSetValueVector::Vector &io_aRow, std::vector< sal_Int32 > &o_ChangedColumns)
void setFetchSize(sal_Int32 _nSize)
void checkUpdateConditions(sal_Int32 columnIndex)
css::uno::Reference< css::uno::XComponentContext > m_aContext
ORowSetMatrix::iterator m_aMatrixEnd
void updateNull(sal_Int32 columnIndex, ORowSetValueVector::Vector &io_aRow, std::vector< sal_Int32 > &o_ChangedColumns)
css::uno::Reference< css::sdbc::XResultSetMetaData > m_xMetaData
void deleteIterator(const ORowSetBase *_pRowSet)
void cancelRowModification()
bool reFillMatrix(sal_Int32 _nNewStartPos, sal_Int32 nNewEndPos)
std::unique_ptr< ORowSetMatrix > m_pInsertMatrix
Reference< XComponentContext > m_aContext
#define TOOLS_WARN_EXCEPTION(area, stream)
#define DBG_UNHANDLED_EXCEPTION(...)
Sequence< sal_Int8 > aSeq
bool any2bool(const css::uno::Any &rAny)
std::map< OUString, SelectColumnDescription, ::comphelper::UStringMixLess > SelectColumnsMetaData
::rtl::Reference< ORowSetValueVector > ORowSetRow
connectivity::ORowVector< connectivity::ORowSetValue > ORowSetValueVector
void getColumnPositions(const Reference< XNameAccess > &_rxQueryColumns, const css::uno::Sequence< OUString > &_aColumnNames, std::u16string_view _rsUpdateTableName, SelectColumnsMetaData &o_rColumnNames, bool i_bAppendTableName)
std::vector< ORowSetRow > ORowSetMatrix
constexpr std::enable_if_t< std::is_signed_v< T >, std::make_unsigned_t< T > > make_unsigned(T value)
enumrange< T >::Iterator begin(enumrange< T >)
#define SQL_ISRULE(pParseNode, eRule)
#define SQL_ISPUNCTUATION(pParseNode, aString)
#define SQL_ISTOKEN(pParseNode, token)
constexpr OUStringLiteral PROPERTY_RESULTSETCONCURRENCY(u"ResultSetConcurrency")
constexpr OUStringLiteral PROPERTY_RESULTSETTYPE(u"ResultSetType")
constexpr OUStringLiteral PROPERTY_ISNULLABLE(u"IsNullable")
constexpr OUStringLiteral PROPERTY_ISBOOKMARKABLE(u"IsBookmarkable")
constexpr OUStringLiteral SQLSTATE_GENERAL
constexpr OUStringLiteral PROPERTY_PRIVILEGES(u"Privileges")