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

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


                    UUID    formerUUID,
                    int[]    colsToSet,
                    TransactionController tc)
    throws StandardException
  {
    ExecIndexRow        keyRow1 = null;
    ExecRow              row;
    DataValueDescriptor      IDOrderable;
    DataValueDescriptor      columnNameOrderable;
    TabInfoImpl            ti = getNonCoreTI(SYSCONSTRAINTS_CATALOG_NUM);
    SYSCONSTRAINTSRowFactory    rf = (SYSCONSTRAINTSRowFactory) ti.getCatalogRowFactory();

    /* Use objectID/columnName in both start
     * and stop position for index 1 scan.
     */
    IDOrderable = getIDValueAsCHAR(formerUUID);

    /* Set up the start/stop position for the scan */
    keyRow1 = (ExecIndexRow) exFactory.getIndexableRow(1);
    keyRow1.setColumn(1, IDOrderable);

    // build the row to be stuffed into SYSCONSTRAINTS.
    row = rf.makeRow(cd, null);

    /*
 
View Full Code Here


  public void  dropConstraintDescriptor(
      ConstraintDescriptor descriptor,
      TransactionController tc)
    throws StandardException
  {
    ExecIndexRow      keyRow = null;
    DataValueDescriptor    schemaIDOrderable;
    DataValueDescriptor    constraintNameOrderable;
    TabInfoImpl          ti = getNonCoreTI(SYSCONSTRAINTS_CATALOG_NUM);

    switch (descriptor.getConstraintType())
    {
      case DataDictionary.PRIMARYKEY_CONSTRAINT:
      case DataDictionary.FOREIGNKEY_CONSTRAINT:
      case DataDictionary.UNIQUE_CONSTRAINT:
        dropSubKeyConstraint(
              descriptor,
              tc);
        break;

      case DataDictionary.CHECK_CONSTRAINT:
        dropSubCheckConstraint(
              descriptor.getUUID(),
              tc);
        break;
    }

    /* Use constraintNameOrderable and schemaIdOrderable in both start
     * and stop position for index 2 scan.
     */
    constraintNameOrderable = new SQLVarchar(descriptor.getConstraintName());
    schemaIDOrderable = getIDValueAsCHAR(descriptor.getSchemaDescriptor().getUUID());

    /* Set up the start/stop position for the scan */
    keyRow = (ExecIndexRow) exFactory.getIndexableRow(2);
    keyRow.setColumn(1, constraintNameOrderable);
    keyRow.setColumn(2, schemaIDOrderable);

    ti.deleteRow( tc, keyRow, SYSCONSTRAINTSRowFactory.SYSCONSTRAINTS_INDEX2_ID );
  }
View Full Code Here

    /* Use constraintIDOrderable in both start and stop positions for scan */
    constraintIDOrderable = getIDValueAsCHAR(constraintId);

    /* Set up the start/stop position for the scan */
    ExecIndexRow keyRow = (ExecIndexRow) exFactory.getIndexableRow(1);
    keyRow.setColumn(1, constraintIDOrderable);

    return (SubKeyConstraintDescriptor)
          getDescriptorViaIndex(
            indexNum,
            keyRow,
View Full Code Here

   * @exception StandardException    Thrown on failure
   */
  private void dropSubKeyConstraint(ConstraintDescriptor constraint, TransactionController tc)
    throws StandardException
  {
    ExecIndexRow      keyRow1 = null;
    DataValueDescriptor    constraintIdOrderable;
    TabInfoImpl          ti;
    int            baseNum;
    int            indexNum;

    if (constraint.getConstraintType()
        == DataDictionary.FOREIGNKEY_CONSTRAINT)
    {
      baseNum = SYSFOREIGNKEYS_CATALOG_NUM;
      indexNum = SYSFOREIGNKEYSRowFactory.SYSFOREIGNKEYS_INDEX1_ID;

      /*
      ** If we have a foreign key, we need to decrement the
      ** reference count of the contraint that this FK references.
      ** We need to do this *before* we drop the foreign key
      ** because of the way FK.getReferencedConstraint() works. 
      */
      if (constraint.getConstraintType()
          == DataDictionary.FOREIGNKEY_CONSTRAINT)
      {
        ReferencedKeyConstraintDescriptor refDescriptor =
            (ReferencedKeyConstraintDescriptor)
                getConstraintDescriptor(
                  ((ForeignKeyConstraintDescriptor)constraint).
                      getReferencedConstraintId());

        if (refDescriptor != null)
        {
          refDescriptor.decrementReferenceCount();
 
          int[] colsToSet = new int[1];
          colsToSet[0] = SYSCONSTRAINTSRowFactory.SYSCONSTRAINTS_REFERENCECOUNT;
   
          updateConstraintDescriptor(refDescriptor,
                        refDescriptor.getUUID(),
                        colsToSet,
                        tc);
        }
      }
    }
    else
    {
      baseNum = SYSKEYS_CATALOG_NUM;
      indexNum = SYSKEYSRowFactory.SYSKEYS_INDEX1_ID;
    }

    ti = getNonCoreTI(baseNum);

    /* Use constraintIdOrderable in both start
     * and stop position for index 1 scan.
     */
    constraintIdOrderable = getIDValueAsCHAR(constraint.getUUID());

    /* Set up the start/stop position for the scan */
    keyRow1 = (ExecIndexRow) exFactory.getIndexableRow(1);
    keyRow1.setColumn(1, constraintIdOrderable);

    ti.deleteRow( tc, keyRow1, indexNum);
  }
View Full Code Here

    /* Use constraintIDOrderable in both start and stop positions for scan */
    constraintIDOrderable = getIDValueAsCHAR(constraintId);

    /* Set up the start/stop position for the scan */
    ExecIndexRow keyRow = (ExecIndexRow) exFactory.getIndexableRow(1);
    keyRow.setColumn(1, constraintIDOrderable);

    return (SubCheckConstraintDescriptor)
          getDescriptorViaIndex(
            SYSCHECKSRowFactory.SYSCHECKS_INDEX1_ID,
            keyRow,
View Full Code Here

   * @exception StandardException    Thrown on failure
   */
  private void dropSubCheckConstraint(UUID constraintId, TransactionController tc)
    throws StandardException
  {
    ExecIndexRow      checkRow1 = null;
    DataValueDescriptor    constraintIdOrderable;
    TabInfoImpl          ti = getNonCoreTI(SYSCHECKS_CATALOG_NUM);

    /* Use constraintIdOrderable in both start
     * and stop position for index 1 scan.
     */
    constraintIdOrderable = getIDValueAsCHAR(constraintId);

    /* Set up the start/stop position for the scan */
    checkRow1 = (ExecIndexRow) exFactory.getIndexableRow(1);
    checkRow1.setColumn(1, constraintIdOrderable);

    ti.deleteRow( tc, checkRow1, SYSCHECKSRowFactory.SYSCHECKS_INDEX1_ID );
  }
View Full Code Here

    /* Use UUIDStringOrderable in both start and stop positions for scan */
    UUIDStringOrderable = getIDValueAsCHAR(uuid);

    /* Set up the start/stop position for the scan */
    ExecIndexRow keyRow = exFactory.getIndexableRow(1);
    keyRow.setColumn(1, UUIDStringOrderable);

    List cdl = newSList();

    getDescriptorViaIndex(
            SYSCONGLOMERATESRowFactory.SYSCONGLOMERATES_INDEX1_ID,
View Full Code Here

  private void getConglomerateDescriptorsScan(TableDescriptor td)
      throws StandardException
  {
    ConglomerateDescriptorList cdl = td.getConglomerateDescriptorList();

    ExecIndexRow      keyRow3 = null;
    DataValueDescriptor    tableIDOrderable;
    TabInfoImpl          ti = coreInfo[SYSCONGLOMERATES_CORE_NUM];

    /* Use tableIDOrderable in both start and stop positions for scan */
    tableIDOrderable = getIDValueAsCHAR(td.getUUID());

    /* Set up the start/stop position for the scan */
    keyRow3 = (ExecIndexRow) exFactory.getIndexableRow(1);
    keyRow3.setColumn(1, tableIDOrderable);

    getDescriptorViaIndex(
      SYSCONGLOMERATESRowFactory.SYSCONGLOMERATES_INDEX3_ID,
        keyRow3,
        (ScanQualifier [][]) null,
View Full Code Here

            String indexName,
            SchemaDescriptor sd,
            boolean forUpdate)
            throws StandardException
  {
    ExecIndexRow        keyRow2 = null;
    DataValueDescriptor      nameOrderable;
    DataValueDescriptor      schemaIDOrderable = null;
    TabInfoImpl            ti = coreInfo[SYSCONGLOMERATES_CORE_NUM];

    nameOrderable = new SQLVarchar(indexName);
    schemaIDOrderable = getIDValueAsCHAR(sd.getUUID());

    /* Set up the start/stop position for the scan */
    keyRow2 = exFactory.getIndexableRow(2);
    keyRow2.setColumn(1, nameOrderable);
    keyRow2.setColumn(2, schemaIDOrderable);

    return (ConglomerateDescriptor)
          getDescriptorViaIndex(
            SYSCONGLOMERATESRowFactory.SYSCONGLOMERATES_INDEX2_ID,
            keyRow2,
View Full Code Here

  public void dropConglomerateDescriptor(
            ConglomerateDescriptor conglomerate,
            TransactionController tc)
            throws StandardException
  {
    ExecIndexRow      keyRow2 = null;
    DataValueDescriptor    nameOrderable;
    DataValueDescriptor    schemaIDOrderable = null;
    TabInfoImpl          ti = coreInfo[SYSCONGLOMERATES_CORE_NUM];

    nameOrderable = new SQLVarchar(conglomerate.getConglomerateName());
    schemaIDOrderable = getIDValueAsCHAR(conglomerate.getSchemaID());

    /* Set up the start/stop position for the scan */
    keyRow2 = (ExecIndexRow) exFactory.getIndexableRow(2);
    keyRow2.setColumn(1, nameOrderable);
    keyRow2.setColumn(2, schemaIDOrderable);

    ti.deleteRow( tc, keyRow2, SYSCONGLOMERATESRowFactory.SYSCONGLOMERATES_INDEX2_ID );

  }
View Full Code Here

TOP

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

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.