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

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


      // If column has a default we drop the default and
      // any dependencies
      if (cd.getDefaultInfo() != null)
      {
        DefaultDescriptor defaultDesc = cd.getDefaultDescriptor(dd);
        dm.clearDependencies(lcc, defaultDesc);
      }
    }

    /* Drop the columns */
 
View Full Code Here


                return dd.getConstraintDescriptor(dependableObjectID);

      case StoredFormatIds.DEFAULT_DESCRIPTOR_FINDER_V01_ID:
        ColumnDescriptor  cd = dd.getColumnDescriptorByDefaultId(dependableObjectID);
                if (cd != null)
                    return new DefaultDescriptor(
                        dd,
                        cd.getDefaultUUID(), cd.getReferencingUUID(),
                        cd.getPosition());
                return null;
View Full Code Here

      updateNewColumnToDefault(activation,
                columnInfo[ix].name,
                columnInfo[ix].defaultInfo.getDefaultText(),
                lcc);
       
      DefaultDescriptor defaultDescriptor = new DefaultDescriptor(dd, defaultUUID, td.getUUID(),
                     colNumber + 1);

      /* Create stored dependencies for each provider to default */
      ProviderInfo[] providerInfo = ((DefaultInfoImpl) columnInfo[ix].defaultInfo).getProviderInfo();
      int providerInfoLength = (providerInfo == null) ? 0 : providerInfo.length;
View Full Code Here

               DependencyManager.DROP_COLUMN, lcc);
         
    // If column has a default we drop the default and any dependencies
    if (columnDescriptor.getDefaultInfo() != null)
    {
      DefaultDescriptor defaultDesc = columnDescriptor.getDefaultDescriptor(dd);
      dm.clearDependencies(lcc, defaultDesc);
    }

    // need to deal with triggers if has referencedColumns
    GenericDescriptorList tdl = dd.getTriggerDescriptors(td);
View Full Code Here

    // Clean up after the old default, if non-null
    if (columnDescriptor.hasNonNullDefault())
    {
      // Invalidate off of the old default
      DefaultDescriptor defaultDescriptor = new DefaultDescriptor(dd, columnInfo[ix].oldDefaultUUID,
                     td.getUUID(), columnPosition);

   
      dm.invalidateFor(defaultDescriptor, DependencyManager.MODIFY_COLUMN_DEFAULT, lcc);
   
      // Drop any dependencies
      dm.clearDependencies(lcc, defaultDescriptor);
    }

    UUID defaultUUID = columnInfo[ix].newDefaultUUID;

    /* Generate a UUID for the default, if one exists
     * and there is no default id yet.
     */
    if (columnInfo[ix].defaultInfo != null &&
      defaultUUID == null)
    { 
      defaultUUID = dd.getUUIDFactory().createUUID();
    }

    /* Get a ColumnDescriptor reflecting the new default */
    columnDescriptor = new ColumnDescriptor(
                           columnInfo[ix].name,
                           columnPosition,
                           columnInfo[ix].dataType,
                           columnInfo[ix].defaultValue,
                           columnInfo[ix].defaultInfo,
                           td,
                           defaultUUID,
                           columnInfo[ix].autoincStart,
                           columnInfo[ix].autoincInc,
                           columnInfo[ix].autoincInc != 0
                           );

    // Update the ColumnDescriptor with new default info
    dd.dropColumnDescriptor(td.getUUID(), columnInfo[ix].name, tc);
    dd.addDescriptor(columnDescriptor, td,
             DataDictionary.SYSCOLUMNS_CATALOG_NUM, false, tc);
 
    if (columnInfo[ix].autoincInc != 0)
    {
      // adding an autoincrement default-- calculate the maximum value
      // of the autoincrement column.
      long maxValue = getColumnMax(activation, td, columnInfo[ix].name,
                     columnInfo[ix].autoincInc,
                     columnInfo[ix].autoincStart);
      dd.setAutoincrementValue(tc, td.getUUID(), columnInfo[ix].name,
                   maxValue, true);
    }

    // Add default info for new default, if non-null
    if (columnDescriptor.hasNonNullDefault())
    {
      DefaultDescriptor defaultDescriptor =
        new DefaultDescriptor(dd, defaultUUID,
                     td.getUUID(),
                     columnPosition);
   
      /* Create stored dependencies for each provider to default */
      ProviderInfo[] providerInfo = ((DefaultInfoImpl) columnInfo[ix].defaultInfo).getProviderInfo();
View Full Code Here

      // If column has a default we drop the default and
      // any dependencies
      if (cd.getDefaultInfo() != null)
      {
        DefaultDescriptor defaultDesc = cd.getDefaultDescriptor(dd);
        dm.clearDependencies(lcc, defaultDesc);
      }
    }
  }
View Full Code Here

      String    defaultText = defaultInfo.getDefaultText();
      ValueNode  defaultTree = parseDefault(defaultText, getLanguageConnectionContext(),
                           getCompilerContext());

      /* Query is dependent on the DefaultDescriptor */
      DefaultDescriptor defaultDescriptor = cd.getDefaultDescriptor(
                          getDataDictionary());
      getCompilerContext().createDependency(defaultDescriptor);

      return defaultTree.bindExpression(
                  fromList,
View Full Code Here

      throw StandardException.newException(SQLState.LANG_COLUMN_NOT_FOUND_IN_TABLE, name, td.getName());
    }


    // Get the UUID for the old default
    DefaultDescriptor defaultDescriptor = cd.getDefaultDescriptor(dd);
   
    oldDefaultUUID = (defaultDescriptor == null) ? null : defaultDescriptor.getUUID();

    // Remember the column position
    columnPosition = cd.getPosition();

    // No other work to do if no user specified default
View Full Code Here

       
        DefaultInfoImpl defaultInfo = (DefaultInfoImpl) cd.getDefaultInfo();
        if (defaultInfo != null)
        {
          /* Query is dependent on the DefaultDescriptor */
          DefaultDescriptor defaultDescriptor = cd.getDefaultDescriptor(getDataDictionary());
          getCompilerContext().createDependency(defaultDescriptor);

          rc.setExpression(
            DefaultNode.parseDefault(
              defaultInfo.getDefaultText(),
View Full Code Here

       
        DefaultInfoImpl defaultInfo = (DefaultInfoImpl) cd.getDefaultInfo();
        if (defaultInfo != null)
        {
          /* Query is dependent on the DefaultDescriptor */
          DefaultDescriptor defaultDescriptor = cd.getDefaultDescriptor(getDataDictionary());
          getCompilerContext().createDependency(defaultDescriptor);

          rc.setExpression(
            DefaultNode.parseDefault(
              defaultInfo.getDefaultText(),
View Full Code Here

TOP

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

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.