Package org.apache.derby.iapi.sql.dictionary

Examples of org.apache.derby.iapi.sql.dictionary.TableDescriptor


  private TableDescriptor getTableDescriptorIndex2Scan(
                    String tableUUID)
        throws StandardException
  {
    DataValueDescriptor      tableIDOrderable;
    TableDescriptor        td;
    TabInfoImpl            ti = coreInfo[SYSTABLES_CORE_NUM];

    /* Use tableNameOrderable and schemaIdOrderable in both start
     * and stop position for scan.
     */
 
View Full Code Here


   * @exception StandardException    Thrown on error
   */
  public ViewDescriptor  getViewDescriptor(TableDescriptor td)
    throws StandardException
  {
    TableDescriptor  tdi = (TableDescriptor) td;

    /* See if the view info is cached */
    if (tdi.getViewDescriptor() != null)
    {
      return tdi.getViewDescriptor();
    }

    synchronized(tdi)
    {
      /* See if we were waiting on someone who just filled it in */
      if (tdi.getViewDescriptor() != null)
      {
        return tdi.getViewDescriptor();
      }

      tdi.setViewDescriptor((ViewDescriptor) getViewDescriptorScan(tdi));
    }
    return tdi.getViewDescriptor();
  }
View Full Code Here

            (TupleDescriptor) null,
            fkList,
            false);

    SubKeyConstraintDescriptor cd;
    TableDescriptor td;
    ConstraintDescriptorList cdl = new ConstraintDescriptorList();
    ConstraintDescriptorList tmpCdl;

    for (Iterator iterator = fkList.iterator(); iterator.hasNext(); )
    {
View Full Code Here

    ConglomerateController  heapCC = null;
    ScanController      scanController = null;
    TransactionController  tc;
    TabInfoImpl         ti = getNonCoreTI(SYSCONSTRAINTS_CATALOG_NUM);
    SYSCONSTRAINTSRowFactory rf = (SYSCONSTRAINTSRowFactory) ti.getCatalogRowFactory();
    TableDescriptor      td = null;
    List          slist = newSList();

    if (SanityManager.DEBUG)
    {
      SanityManager.ASSERT(indexId == SYSCONSTRAINTSRowFactory.SYSCONSTRAINTS_INDEX1_ID ||
View Full Code Here

        // than fetch, so that the fetch happens while latch is held, otherwise
        // the next() might position the scan on a row, but the subsequent
        // fetch() may find the row deleted or purged from the table.
    while(scanController.fetchNext(outRow.getRowArray()))
    {
      TableDescriptor td = (TableDescriptor)
        rf.buildDescriptor(outRow, (TupleDescriptor)null,
                   this);
      ht.put(td.getUUID(), td);
    }
    scanController.close();
    return ht;
  }
View Full Code Here

    SystemColumn    theColumn;
    SystemColumn[]    columns = rowFactory.buildColumnList();
    SchemaDescriptor  sd = getSystemSchemaDescriptor();
    String columnName;

    TableDescriptor td = getTableDescriptor(rowFactory.getCatalogName(), sd);

    theColumn = columns[columnNumber - 1]// from 1 to 0 based
    ColumnDescriptor cd = makeColumnDescriptor(theColumn, columnNumber, td );
    columnName = cd.getColumnName();
    cd.getType().setNullability(nullability);
    int[] columnNameColArray = new int[1];
    columnNameColArray[0] = SYSCOLUMNSRowFactory.SYSCOLUMNS_COLUMNDATATYPE ;
    updateColumnDescriptor(cd,
                td.getUUID(),
                columnName,
                columnNameColArray,
                tc,
                true);
View Full Code Here

    SystemColumn[]    columns = rowFactory.buildColumnList();
    ExecRow        templateRow = rowFactory.makeEmptyRow();
    int          columnCount = newColumnIDs.length;
    SchemaDescriptor  sd = getSystemSchemaDescriptor();
    TableDescriptor    td;
    long        conglomID;

    // Special case when adding a column to systables or syscolumns,
    // since we can't go to systables/syscolumns to get the
    // table/column descriptor until after we add and populate the new column.
    if (rowFactory instanceof SYSTABLESRowFactory)
    {
      td = dataDescriptorGenerator.newTableDescriptor(
            "SYSTABLES",
            sd,
            TableDescriptor.BASE_TABLE_TYPE,
            TableDescriptor.ROW_LOCK_GRANULARITY);
      td.setUUID(getUUIDForCoreTable("SYSTABLES", sd.getUUID().toString(), tc));
      conglomID = coreInfo[SYSTABLES_CORE_NUM].getHeapConglomerate();
    }
    else if (rowFactory instanceof SYSCOLUMNSRowFactory)
    {
      td = dataDescriptorGenerator.newTableDescriptor(
            "SYSCOLUMNS",
            sd,
            TableDescriptor.BASE_TABLE_TYPE,
            TableDescriptor.ROW_LOCK_GRANULARITY);
      td.setUUID(getUUIDForCoreTable("SYSCOLUMNS", sd.getUUID().toString(), tc));
      conglomID = coreInfo[SYSCOLUMNS_CORE_NUM].getHeapConglomerate();
    }
    else
    {
      td = getTableDescriptor( rowFactory.getCatalogName(), sd );
      conglomID = td.getHeapConglomerateId();
    }

    widenConglomerate( templateRow, newColumnIDs, conglomID, tc );

View Full Code Here

    String        name = ti.getTableName();
    long        conglomId = ti.getHeapConglomerate();
    SystemColumn[]    columnList = crf.buildColumnList();
    UUID        heapUUID = crf.getCanonicalHeapUUID();
    String        heapName = crf.getCanonicalHeapName();
    TableDescriptor    td;
    UUID        toid;
    ColumnDescriptor  cd;
    int          columnCount;
    SystemColumn    column;

    // add table to the data dictionary

    columnCount = columnList.length;
    td = ddg.newTableDescriptor(name, sd, TableDescriptor.SYSTEM_TABLE_TYPE,
                    TableDescriptor.ROW_LOCK_GRANULARITY);
    td.setUUID(crf.getCanonicalTableUUID());
    addDescriptor(td, sd, SYSTABLES_CATALOG_NUM,
            false, tc);
    toid = td.getUUID();
 
    /* Add the conglomerate for the heap */
    ConglomerateDescriptor cgd = ddg.newConglomerateDescriptor(conglomId,
                                  heapName,
                                  false,
                                  null,
                                  false,
                                  heapUUID,
                                    toid,
                                  sd.getUUID());

    addDescriptor(cgd, sd, SYSCONGLOMERATES_CATALOG_NUM, false, tc);

    /* Create the columns */
    ColumnDescriptor[] cdlArray = new ColumnDescriptor[columnCount];

    for (int columnNumber = 0; columnNumber < columnCount; columnNumber++)
    {
      column = columnList[columnNumber];

      if (SanityManager.DEBUG)
      {
        if (column == null)
        {
          SanityManager.THROWASSERT("column "+columnNumber+" for table "+ti.getTableName()+" is null");
        }
      }
      cdlArray[columnNumber] = makeColumnDescriptor( column,
                    columnNumber + 1, td );
    }
    addDescriptorArray(cdlArray, td, SYSCOLUMNS_CATALOG_NUM, false, tc);
   
    // now add the columns to the cdl of the table.
    ColumnDescriptorList cdl = td.getColumnDescriptorList();
    for (int i = 0; i < columnCount; i++)
      cdl.add(cdlArray[i]);
  }
View Full Code Here

     * the compiler context.
     */
    UUID triggerTableId;
    if ((triggerTableId = getSpecialTriggerVTITableName(lcc, newInvocation.getJavaClassName())) != null
    {
      TableDescriptor td = getDataDictionary().getTableDescriptor(triggerTableId);
      resultColumns = genResultColList(td);

      // costing info
      vtiCosted = true;
      estimatedCost = 50d;
View Full Code Here

   *      field set
   */
  Dependable findDependable(DataDictionary dd, UUID dependableObjectID)
    throws StandardException
  {
    TableDescriptor td = dd.getTableDescriptor(dependableObjectID);
    if (td != null// see beetle 4444
      td.setReferencedColumnMap(new FormatableBitSet(columnBitMap));
    return td;
  }
View Full Code Here

TOP

Related Classes of org.apache.derby.iapi.sql.dictionary.TableDescriptor

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.