📄 temporaryrowholderresultset.java
字号:
{ heapCC = tc.openConglomerate( holder.CID, false, 0, TransactionController.MODE_TABLE, TransactionController.ISOLATION_SERIALIZABLE); } currentRow = rowArray[0].getNewNullRow(); indexRow = new DataValueDescriptor[2]; indexRow[0] = new SQLLongint(position); indexRow[1] = heapCC.newRowLocationTemplate(); DataValueDescriptor[] searchRow = new DataValueDescriptor[1]; searchRow[0] = new SQLLongint(position); if(indexsc == null) { indexsc = tc.openScan(positionIndexConglomId, false, // don't hold open across commit 0, // for read TransactionController.MODE_TABLE, TransactionController.ISOLATION_SERIALIZABLE, (FormatableBitSet) null, // all fields as objects searchRow, // start position - first row ScanController.GE, // startSearchOperation null, //scanQualifier, null, // stop position - through last row ScanController.GT); // stopSearchOperation }else { indexsc.reopenScan( searchRow, // startKeyValue ScanController.GE, // startSearchOp null, // qualifier null, // stopKeyValue ScanController.GT // stopSearchOp ); } } //get the next row inserted into the temporary holder private ExecRow getNextAppendedRow() throws StandardException { if (indexsc == null) return null; if (!indexsc.next()) { return null; } indexsc.fetch(indexRow); RowLocation baseRowLocation = (RowLocation) indexRow[1]; boolean base_row_exists = heapCC.fetch( baseRowLocation, currentRow.getRowArray(), (FormatableBitSet) null); if (SanityManager.DEBUG) { SanityManager.ASSERT(base_row_exists, "base row disappeared."); } numRowsOut++; return currentRow; } /** * Return the point of attachment for this subquery. * (Only meaningful for Any and Once ResultSets, which can and will only * be at the top of a ResultSet for a subquery.) * * @return int Point of attachment (result set number) for this * subquery. (-1 if not a subquery - also Sanity violation) */ public int getPointOfAttachment() { return -1; } /** * Return the isolation level of the scan in the result set. * Only expected to be called for those ResultSets that * contain a scan. * * @return The isolation level of the scan (in TransactionController constants). */ public int getScanIsolationLevel() { return TransactionController.ISOLATION_SERIALIZABLE; } /** * Notify a NPRS that it is the source for the specified * TargetResultSet. This is useful when doing bulk insert. * * @param trs The TargetResultSet. * * @return Nothing. */ public void setTargetResultSet(TargetResultSet trs) { } /** * Set whether or not the NPRS need the row location when acting * as a row source. (The target result set determines this.) * * @param boolean needsRowLocation * * @return Nothing. */ public void setNeedsRowLocation(boolean needsRowLocation) { } /** * Get the estimated row count from this result set. * * @return The estimated row count (as a double) from this result set. */ public double getEstimatedRowCount() { return 0d; } /** * Get the number of this ResultSet, which is guaranteed to be unique * within a statement. */ public int resultSetNumber() { return 0; } /** * Set the current row to the row passed in. * * @param row the new current row * */ public void setCurrentRow(ExecRow row) { currentRow = row; } /** * Clear the current row * */ public void clearCurrentRow() { currentRow = null; } /** * This result set has its row from the last fetch done. * If the cursor is closed, a null is returned. * * @see CursorResultSet * * @return the last row returned; * @exception StandardException thrown on failure. */ public ExecRow getCurrentRow() throws StandardException { if (SanityManager.DEBUG) { SanityManager.ASSERT(isOpen, "resultSet expected to be open"); } return currentRow; } /** * Returns the row location of the current base table row of the cursor. * If this cursor's row is composed of multiple base tables' rows, * i.e. due to a join, then a null is returned. For * a temporary row holder, we always return null. * * @return the row location of the current cursor row. */ public RowLocation getRowLocation() { if (SanityManager.DEBUG) { SanityManager.ASSERT(isOpen, "resultSet expected to be open"); } return (RowLocation)null; } /** * Clean up * * @exception StandardException thrown on error */ public void close() throws StandardException { isOpen = false; numRowsOut = 0; currentRow = null; if (scan != null) { scan.close(); scan = null; } } ////////////////////////////////////////////////////////////////////////// // // MISC FROM RESULT SET // ///////////////////////////////////////////////////////////////////////// /** * Returns TRUE if the statement returns rows (i.e. is a SELECT * or FETCH statement), FALSE if it returns no rows. * * @return TRUE if the statement returns rows, FALSE if not. */ public boolean returnsRows() { return true; } public int modifiedRowCount() { return 0;}; /** * Returns a ResultDescription object, which describes the results * of the statement this ResultSet is in. This will *not* be a * description of this particular ResultSet, if this is not the * outermost ResultSet. * * @return A ResultDescription describing the results of the * statement. */ public ResultDescription getResultDescription() { return resultDescription; } /** * Tells the system that there will be calls to getNextRow(). * * @return Nothing * * @exception StandardException Thrown on failure */ public void open() throws StandardException { openCore(); } /** * Returns the row at the absolute position from the query, * and returns NULL when there is no such position. * (Negative position means from the end of the result set.) * Moving the cursor to an invalid position leaves the cursor * positioned either before the first row (negative position) * or after the last row (positive position). * NOTE: An exception will be thrown on 0. * * @param row The position. * @return The row at the absolute position, or NULL if no such position. * * @exception StandardException Thrown on failure * @see Row */ public ExecRow getAbsoluteRow(int row) throws StandardException { if (SanityManager.DEBUG) { SanityManager.THROWASSERT( "getAbsoluteRow() not expected to be called yet."); } return null; } /** * Returns the row at the relative position from the current * cursor position, and returns NULL when there is no such position. * (Negative position means toward the beginning of the result set.) * Moving the cursor to an invalid position leaves the cursor * positioned either before the first row (negative position) * or after the last row (positive position). * NOTE: 0 is valid. * NOTE: An exception is thrown if the cursor is not currently * positioned on a row. * * @param row The position. * @return The row at the relative position, or NULL if no such position. * * @exception StandardException Thrown on failure * @see Row */ public ExecRow getRelativeRow(int row) throws StandardException { if (SanityManager.DEBUG) { SanityManager.THROWASSERT( "getRelativeRow() not expected to be called yet."); } return null; } /** * Sets the current position to before the first row and returns NULL * because there is no current row. * * @return NULL. * * @exception StandardException Thrown on failure * @see Row */ public ExecRow setBeforeFirstRow() throws StandardException { if (SanityManager.DEBUG) { SanityManager.THROWASSERT( "setBeforeFirstRow() not expected to be called yet."); } return null; } /** * Returns the first row from the query, and returns NULL when there * are no rows. * * @return The first row, or NULL if no rows. * * @exception StandardException Thrown on failure * @see Row */ public ExecRow getFirstRow() throws StandardException { if (SanityManager.DEBUG) { SanityManager.THROWASSERT( "getFirstRow() not expected to be called yet."); } return null; } /** * Returns the next row from the query, and returns NULL when there * are no more rows. * * @return The next row, or NULL if no more rows. * * @exception StandardException Thrown on failure * @see Row */ public ExecRow getNextRow() throws StandardException { return getNextRowCore(); } /** * Returns the previous row from the query, and returns NULL when there * are no more previous rows. * * @return The previous row, or NULL if no more previous rows. * * @exception StandardException Thrown on failure * @see Row */ public ExecRow getPreviousRow() throws StandardException { if (SanityManager.DEBUG) { SanityManager.THROWASSERT(
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -