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

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


   */
  public SchemaDescriptor  getSchemaDescriptor(UUID schemaId,
                  TransactionController tc)
    throws StandardException
  {
    SchemaDescriptor    sd = null;
   
    if ( tc == null )
    {
        tc = getTransactionCompile();
        }

    /*
    ** Check for APP and SYS schemas before going any
    ** further.
    */
    if (schemaId != null)
    {
      if (getSystemSchemaDescriptor().getUUID().equals(schemaId))
      {
        return getSystemSchemaDescriptor();
      }
      else if (getSysIBMSchemaDescriptor().getUUID().equals(schemaId))
      {
        return getSysIBMSchemaDescriptor();
      }
    }

    /*
    ** If we aren't booting, lets see if we already
    ** have the descriptor.  If we are in the middle
    ** of booting we cannot get the LanguageConnectionContext.
    */
    if (!booting)
    {

      LanguageConnectionContext  lcc = getLCC();

      if (lcc != null)
      {
        sd = lcc.getDefaultSchema();

        if ((sd != null) &&
            ((schemaId == null) ||
              schemaId.equals(sd.getUUID())))
        {
          return sd;
        }
      }
    }
View Full Code Here


    DataValueDescriptor    schemaNameOrderable;
    TabInfoImpl          ti = coreInfo[SYSSCHEMAS_CORE_NUM];

    if (SanityManager.DEBUG)
    {
      SchemaDescriptor sd = getSchemaDescriptor(schemaName, getTransactionCompile(), true);
      if (!isSchemaEmpty(sd))
      {
        SanityManager.THROWASSERT("Attempt to drop schema "+schemaName+" that is not empty");
      }
    }
View Full Code Here

      {
        SanityManager.THROWASSERT("null schema for non system table "+tableName);
      }
    }

    SchemaDescriptor sd = (schema == null) ?
        getSystemSchemaDescriptor()
        : schema;

    UUID schemaUUID = sd.getUUID();
   
    if (SchemaDescriptor.STD_SYSTEM_DIAG_SCHEMA_NAME.equals(
        sd.getSchemaName()))
    {
      TableDescriptor td =
        new TableDescriptor(this, tableName, sd,
            TableDescriptor.VTI_TYPE,
            TableDescriptor.DEFAULT_LOCK_GRANULARITY);
View Full Code Here

        addSystemSchema(
            SchemaDescriptor.STD_SYSTEM_UTIL_SCHEMA_NAME,
            SchemaDescriptor.SYSCS_UTIL_SCHEMA_UUID, tc);

      //Add the APP schema
      SchemaDescriptor appSchemaDesc = new SchemaDescriptor(this,
                                        SchemaDescriptor.STD_DEFAULT_SCHEMA_NAME,
                                        SchemaDescriptor.DEFAULT_USER_NAME,
                                        uuidFactory.recreateUUID( SchemaDescriptor.DEFAULT_SCHEMA_UUID),
                                        false);
 
View Full Code Here

    String                  schema_uuid,
    TransactionController   tc)
    throws StandardException
    {
    // create the descriptor
    SchemaDescriptor schema_desc =
            new SchemaDescriptor(
                this,
                schema_name,
                authorizationDatabaseOwner,
                uuidFactory.recreateUUID(schema_uuid),
                true);
View Full Code Here

                     TransactionController tc)
    throws StandardException
  {
    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
View Full Code Here

    ColumnDescriptor  cd;

    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 );
View Full Code Here

    TransactionController  tc
    )
    throws StandardException
  {
    ExecRow        templateRow = rowFactory.makeEmptyRow();
    SchemaDescriptor  sd = getSystemSchemaDescriptor( );
    long        conglomID = getTableDescriptor( rowFactory.getCatalogName(), sd ).getHeapConglomerateId();

    widenConglomerate( templateRow, newColumnIDs, conglomID, tc );
  }
View Full Code Here

    int            indexNumber,
    long          heapConglomerateNumber
    )
    throws StandardException
  {
    SchemaDescriptor    sd = getSystemSchemaDescriptor( );
    DataDescriptorGenerator ddg = getDataDescriptorGenerator();
    long          indexConglomerateNumber;

    ConglomerateDescriptor  conglomerateDescriptor = bootstrapOneIndex
      ( sd, tc, ddg, ti, indexNumber, heapConglomerateNumber );
View Full Code Here

    private SchemaDescriptor newSystemSchemaDesc(
    String  name,
    String  uuid)
    {
        return new SchemaDescriptor(
                this,
                name,
                authorizationDatabaseOwner,
                uuidFactory.recreateUUID(uuid),
                true);
View Full Code Here

TOP

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

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.