Package org.apache.derby.iapi.sql.execute

Examples of org.apache.derby.iapi.sql.execute.ExecRow


        ** read.  We need to shift our 1-based bit
        ** set to a zero based bit set like the store
        ** expects.
        */
        FormatableBitSet readBitSet = RowUtil.shift(baseRowReadList, 1);
        ExecRow deferredTempRow2;

        rs.open();
        while ((deferredTempRow2 = rs.getNextRow()) != null)
        {
          /*
          ** Check the constraint now if we have triggers.
          ** Otherwise we evaluated them as we read the
          ** rows in from the source.
          */
          if (triggerInfo != null)
          {
            source.setCurrentRow(deferredTempRow);
            evaluateCheckConstraints(checkGM, activation);
          }

          /*
          ** The last column is a Ref, which contains a
          ** RowLocation.
          */
          DataValueDescriptor rlColumn = deferredTempRow2.getColumn(numberOfBaseColumns + 1);
          RowLocation baseRowLocation =
              (RowLocation) (rlColumn).getObject();
 
          /* Get the base row at the given RowLocation */
          boolean row_exists =
View Full Code Here


    ** aren't any primary keys that were removed which
    ** are referenced. 
    */
    if (deferred && updatingReferencedKey)
    {
      ExecRow  deletedRow;
      CursorResultSet deletedRows;

      /*
      ** For each referenced key that was modified
      */
      for (int i = 0; i < fkInfoArray.length; i++)
      {
        if (fkInfoArray[i].type == FKInfo.FOREIGN_KEY)
        {
          continue;
        }

        deletedRows = deletedRowHolder.getResultSet();
        try
        {
          /*
          ** For each delete row
          */ 
          deletedRows.open();
          while ((deletedRow = deletedRows.getNextRow()) != null)
          {
            if (!foundRow(deletedRow,
                    fkInfoArray[i].colArray,
                    insertedRowHolder))
            {
              riChecker.doRICheck(i, deletedRow, restrictCheckOnly);
            }
          } 
        }
        finally
        {
          deletedRows.close();
        }
      }
    }

    /*
    ** For a deferred update, make sure that there
    ** aren't any foreign keys that were added that
     ** aren't referenced. 
    */
    if (deferred && updatingForeignKey)
    {
      ExecRow  insertedRow;
      CursorResultSet insertedRows;

      /*
      ** For each foreign key that was modified
      */
 
View Full Code Here

    int[]          colsToCheck,
    TemporaryRowHolderImpl  rowHolder
  )
    throws StandardException
  {
    ExecRow        scanRow;
    boolean        foundMatch = false;
    Object[]       checkRowArray = checkRow.getRowArray();
    DataValueDescriptor  checkCol;
    DataValueDescriptor  scanCol;

    CursorResultSet rs = rowHolder.getResultSet();
    try
   
      /*
      ** For each inserted row
      */ 
      rs.open();
      while ((scanRow = rs.getNextRow()) != null)
      {
        Object[] scanRowArray = scanRow.getRowArray();
        int i;
        for (i = 0; i < colsToCheck.length; i++)
        {
          checkCol = (DataValueDescriptor)checkRowArray[colsToCheck[i]-1];
          scanCol = (DataValueDescriptor)scanRowArray[colsToCheck[i]-1];
View Full Code Here

     
      /* We haven't seen the row yet, scan until we find
       * it or we get to the end.
       */
      int diff = row - positionInSource;
      ExecRow result = null;
      while (diff > 0)
      {
        if ((result = getNextRowFromSource()) != null)
        {
          diff--;
View Full Code Here

   *
    * @exception StandardException thrown on failure
   */
  public ExecRow  getNextRowCore() throws StandardException
  {
    ExecRow result = null;

    beginTime = getCurrentTimeMillis();
    if (!isOpen)
      throw StandardException.newException(SQLState.LANG_RESULT_SET_NOT_OPEN, "next");

View Full Code Here

      }
     
      /* Scroll to the end, filling the hash table as
       * we scroll, and return the last row that we find.
       */
      ExecRow result = null;
      while ((result = getNextRowFromSource()) != null);
    }
   
    if (SanityManager.DEBUG && !seenLast)
    {
View Full Code Here

      {
        return true;
      }
      else
      {
        ExecRow firstRow = getFirstRow();
        if (firstRow == null)
        {
          // ResultSet is empty
          return false;
        }
View Full Code Here

  }

  /* Get the next row from the source ResultSet tree and insert into the hash table */
  private ExecRow getNextRowFromSource() throws StandardException
  {
    ExecRow    sourceRow = null;
    ExecRow    result = null;

    /* Don't give back more rows than requested */
    if (maxRows > 0 && maxRows == positionInSource)
    {
      seenLast = true;
View Full Code Here

   *
   * Sets the updated column of the hash table to true and updates the row
   * in the hash table with the new values for the row.
   */
  public void updateRow(ExecRow row) throws StandardException {
    ExecRow newRow = row;
    boolean undoProjection = false;
   
    if (source instanceof ProjectRestrictResultSet) {
      newRow = ((ProjectRestrictResultSet)source).
        doBaseRowProjection(row);
      undoProjection = true;
    }
    positionInHashTable.setValue(currentPosition);
    DataValueDescriptor[] hashRowArray = (DataValueDescriptor[])
        ht.get(positionInHashTable);
    RowLocation rowLoc = (RowLocation) hashRowArray[POS_ROWLOCATION];
    ht.remove(new SQLInteger(currentPosition));
    addRowToHashTable(newRow, currentPosition, rowLoc, true);
   
    // Modify row to refer to data in the BackingStoreHashtable.
    // This allows reading of data which goes over multiple pages
    // when doing the actual update (LOBs). Putting columns of
    // type SQLBinary to disk, has destructive effect on the columns,
    // and they need to be re-read. That is the reason this is needed.
    if (undoProjection) {
     
      final DataValueDescriptor[] newRowData = newRow.getRowArray();
     
      // Array of original position in row
      final int[] origPos =((ProjectRestrictResultSet)source).
        getBaseProjectMapping();
     
View Full Code Here

   * @exception StandardException    ResultSetNotOpen thrown if closed
   * @return the next row in the join result
   */
  public ExecRow  getNextRowCore() throws StandardException
  {
      ExecRow result = null;
    boolean haveRow = false;
      boolean restrict = false;
      DataValueDescriptor restrictBoolean;

    beginTime = getCurrentTimeMillis();
View Full Code Here

TOP

Related Classes of org.apache.derby.iapi.sql.execute.ExecRow

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.