Examples of ViewDescriptor


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

          FormatableBitSet providingCols = td.getReferencedColumnMap();
          if (providingCols == null)
          {
            if (dep instanceof ViewDescriptor)
            {
              ViewDescriptor vd = (ViewDescriptor) dep;
              DataDictionary dd = getDataDictionary();
              SchemaDescriptor compSchema;
              compSchema = dd.getSchemaDescriptor(vd.getCompSchemaId(), null);
              CompilerContext newCC = lcc.pushCompilerContext(compSchema);
              Parser  pa = newCC.getParser();
              LanguageConnectionFactory  lcf = lcc.getLanguageConnectionFactory();

              // Since this is always nested inside another SQL
              // statement, so topLevel flag should be false
              CreateViewNode cvn = (CreateViewNode)pa.parseStatement(
                        vd.getViewText());

              // need a current dependent for bind
              newCC.setCurrentDependent(dep);
              cvn = (CreateViewNode) cvn.bind();
              ProviderInfo[] providerInfos = cvn.getProviderInfo();
View Full Code Here

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

  {
    TableDescriptor       td;
    UUID             toid;
    SchemaDescriptor      schemaDescriptor;
    ColumnDescriptor      columnDescriptor;
    ViewDescriptor        vd;

    LanguageConnectionContext lcc = activation.getLanguageConnectionContext();
    DataDictionary dd = lcc.getDataDictionary();
    DependencyManager dm = dd.getDependencyManager();
    TransactionController tc = lcc.getTransactionExecute();
View Full Code Here

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

    int               checkIType;

    if (td != null)
    {
      UUID  tableUUID;
      ViewDescriptor vd = (ViewDescriptor)td;

      /*
      ** We only allocate a new UUID if the descriptor doesn't already have one.
      ** For descriptors replicated from a Source system, we already have an UUID.
      */
      tableUUID = vd.getUUID();
      if ( tableUUID == null )
        {
        tableUUID = getUUIDFactory().createUUID();
        vd.setUUID(tableUUID);
      }
      tableID = tableUUID.toString();
      viewText = vd.getViewText();

      /* RESOLVE - check constraints not supported yet */
      checkIType = vd.getCheckOptionType();

      if (SanityManager.DEBUG)
      {
        if (checkIType != ViewDescriptor.NO_CHECK_OPTION)
        {
          SanityManager.THROWASSERT("checkIType expected to be " +
            ViewDescriptor.NO_CHECK_OPTION +
            ", not " + checkIType);
        }
      }
      checkSType = "N";

      UUID tmpId = vd.getCompSchemaId();
      compSchemaId = (tmpId == null) ? null : tmpId.toString();
    }

    /* Insert info into sysviews */

 
View Full Code Here

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

    ExecRow          row,
    TupleDescriptor      parentTupleDescriptor,
    DataDictionary       dd )
          throws StandardException
  {
    ViewDescriptor vd = null;

    if (SanityManager.DEBUG)
    {
      SanityManager.ASSERT(
        row.nColumns() == SYSVIEWS_COLUMN_COUNT,
View Full Code Here

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

   */
  public void  executeConstantAction( Activation activation )
            throws StandardException
  {
    TableDescriptor td;
    ViewDescriptor vd;

    LanguageConnectionContext lcc = activation.getLanguageConnectionContext();
    DataDictionary dd = lcc.getDataDictionary();
    DependencyManager dm = dd.getDependencyManager();
    TransactionController tc = lcc.getTransactionExecute();

    /*
    ** Inform the data dictionary that we are about to write to it.
    ** There are several calls to data dictionary "get" methods here
    ** that might be done in "read" mode in the data dictionary, but
    ** it seemed safer to do this whole operation in "write" mode.
    **
    ** We tell the data dictionary we're done writing at the end of
    ** the transaction.
    */
    dd.startWriting(lcc);

    /* Get the table descriptor.  We're responsible for raising
     * the error if it isn't found
     */
    td = dd.getTableDescriptor(tableName, sd);

    if (td == null)
    {
      throw StandardException.newException(SQLState.LANG_TABLE_NOT_FOUND_DURING_EXECUTION, fullTableName);
    }

    /* Verify that TableDescriptor represents a view */
    if (td.getTableType() != TableDescriptor.VIEW_TYPE)
    {
      throw StandardException.newException(SQLState.LANG_DROP_VIEW_ON_NON_VIEW, fullTableName);
    }

    vd = dd.getViewDescriptor(td);

    vd.dropViewWork(dd, dm, lcc, tc, sd, td, false);
  }
View Full Code Here

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

            TableDescriptor t = (TableDescriptor)p;
            s = t.getSchemaDescriptor();
            }
          else if (p instanceof ViewDescriptor)
          {
            ViewDescriptor v = (ViewDescriptor)p; 
            s = dd.getSchemaDescriptor(v.getCompSchemaId(), tc);
          }
            else if (p instanceof AliasDescriptor)
            {
              AliasDescriptor a = (AliasDescriptor)p;
            s = dd.getSchemaDescriptor( a.getSchemaUUID(), tc);
View Full Code Here

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

  private void bindPrivilegesForView ( TableDescriptor td)
    throws StandardException
  {
    LanguageConnectionContext lcc = getLanguageConnectionContext();
    DataDictionary dd = lcc.getDataDictionary();
    ViewDescriptor vd = dd.getViewDescriptor(td);
    DependencyManager dm = dd.getDependencyManager();
    ProviderInfo[] pis = dm.getPersistentProviderInfos(vd);
    this.descriptorList = new ArrayList();
         
    int siz = pis.length;
View Full Code Here

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

    int               checkIType;

    if (td != null)
    {
      UUID  tableUUID;
      ViewDescriptor vd = (ViewDescriptor)td;

      /*
      ** We only allocate a new UUID if the descriptor doesn't already have one.
      ** For descriptors replicated from a Source system, we already have an UUID.
      */
      tableUUID = vd.getUUID();
      if ( tableUUID == null )
        {
        tableUUID = getUUIDFactory().createUUID();
        vd.setUUID(tableUUID);
      }
      tableID = tableUUID.toString();
      viewText = vd.getViewText();

      /* RESOLVE - check constraints not supported yet */
      checkIType = vd.getCheckOptionType();

      if (SanityManager.DEBUG)
      {
        if (checkIType != ViewDescriptor.NO_CHECK_OPTION)
        {
          SanityManager.THROWASSERT("checkIType expected to be " +
            ViewDescriptor.NO_CHECK_OPTION +
            ", not " + checkIType);
        }
      }
      checkSType = "N";

      UUID tmpId = vd.getCompSchemaId();
      compSchemaId = (tmpId == null) ? null : tmpId.toString();
    }

    /* Insert info into sysviews */

 
View Full Code Here

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

    ExecRow          row,
    TupleDescriptor      parentTupleDescriptor,
    DataDictionary       dd )
          throws StandardException
  {
    ViewDescriptor vd = null;

    if (SanityManager.DEBUG)
    {
      SanityManager.ASSERT(
        row.nColumns() == SYSVIEWS_COLUMN_COUNT,
View Full Code Here

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

   * @exception StandardException    Thrown on error
   */
  private ViewDescriptor getViewDescriptorScan(TableDescriptor tdi)
    throws StandardException
  {
    ViewDescriptor      vd;
    DataValueDescriptor    viewIdOrderable;
    TabInfoImpl          ti = getNonCoreTI(SYSVIEWS_CATALOG_NUM);
    UUID          viewID = tdi.getUUID();

    /* Use viewIdOrderable in both start
     * and stop position for scan.
     */
    viewIdOrderable = getIDValueAsCHAR(viewID);

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

    vd = (ViewDescriptor)
          getDescriptorViaIndex(
            SYSVIEWSRowFactory.SYSVIEWS_INDEX1_ID,
            keyRow,
            (ScanQualifier [][]) null,
            ti,
            (TupleDescriptor) null,
            (List) null,
            false);

    if (vd != null)
    {
      vd.setViewName(tdi.getName());
    }
    return vd;
  }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.