Package org.apache.derby.catalog.types

Examples of org.apache.derby.catalog.types.DefaultInfoImpl


        if (cd.isAutoincrement())
        {
          rc.setAutoincrementGenerated();
        } // end of if ()
       
        DefaultInfoImpl defaultInfo = (DefaultInfoImpl) cd.getDefaultInfo();

                //
                // For generated columns, we don't have enough context at this
                // point to bind the generation clause (the default) and
                // unfortunately that step occurs very soon after defaults are substituted in. The
                // parsing and binding of generation clauses happens considerably
                // later on. At this juncture, we can be patient and just plug
                // in a NULL literal as a placeholder. For generated columns,
                // the generation clause tree is plugged in in DMLModStatementNode.parseAndBindGenerationClauses().
                //
        if ( (defaultInfo != null) && !defaultInfo.isGeneratedColumn() )
        {
          /* Query is dependent on the DefaultDescriptor */
          DefaultDescriptor defaultDescriptor = cd.getDefaultDescriptor(getDataDictionary());
          getCompilerContext().createDependency(defaultDescriptor);

          rc.setExpression(
            DefaultNode.parseDefault(
              defaultInfo.getDefaultText(),
              getLanguageConnectionContext(),
              getCompilerContext()));
        }
        else
        {
View Full Code Here


            // column position is 1-based, index is 0-based.
            ColumnDescriptor colDesc = targetTD.getColumnDescriptor(columnNumber);
            DataTypeDescriptor colType = colDesc.getType();

            // Check for defaults
            DefaultInfoImpl defaultInfo = (DefaultInfoImpl) colDesc.getDefaultInfo();
     
      //Column has constant default value ,
      //if it have defaultInfo and not be autoincrement.
            if (defaultInfo != null && ! colDesc.isAutoincrement())
            {
                //RESOLVEPARAMETER - skip the tree if we have the value
                /*
                  if (defaultInfo.getDefaultValue() != null)
                  {
                  }
                  else
                */
                {
                    if ( colDesc.hasGenerationClause() )
                    {
                        // later on we will revisit the generated columns and bind
                        // their generation clauses
                        newResultColumn = createGeneratedColumn( targetTD, colDesc );
                    }
                    else
                    {
                        // Generate the tree for the default
                        String defaultText = defaultInfo.getDefaultText();
                        ValueNode defaultTree = parseDefault(defaultText);
                        defaultTree = defaultTree.bindExpression
                            (getFromList(), (SubqueryList) null, (Vector) null);
                        newResultColumn = (ResultColumn) getNodeFactory().getNode
                            ( C_NodeTypes.RESULT_COLUMN, defaultTree.getTypeServices(), defaultTree, getContextManager());
View Full Code Here

          defaultTypeId.getSQLTypeName() );
      }

      // Save off the default text
      // RESOLVEDEFAULT - Convert to constant if possible
      defaultInfo = new DefaultInfoImpl(false,
                defaultNode.getDefaultText(),
                defaultValue);

      if (SanityManager.DEBUG)
      {
View Full Code Here

    }
  }


  private static DefaultInfoImpl createDefaultInfoOfAutoInc(){
    return new DefaultInfoImpl(true,
             null,
             null);
  }
View Full Code Here

        if (cd.isAutoincrement())
        {
          rc.setAutoincrementGenerated();
        } // end of if ()
       
        DefaultInfoImpl defaultInfo = (DefaultInfoImpl) cd.getDefaultInfo();

                //
                // For generated columns, we don't have enough context at this
                // point to bind the generation clause (the default) and
                // unfortunately that step occurs very soon after defaults are substituted in. The
                // parsing and binding of generation clauses happens considerably
                // later on. At this juncture, we can be patient and just plug
                // in a NULL literal as a placeholder. For generated columns,
                // the generation clause tree is plugged in in DMLModStatementNode.parseAndBindGenerationClauses().
                //
        if ( (defaultInfo != null) && !defaultInfo.isGeneratedColumn() )
        {
          /* Query is dependent on the DefaultDescriptor */
          DefaultDescriptor defaultDescriptor = cd.getDefaultDescriptor(getDataDictionary());
          getCompilerContext().createDependency(defaultDescriptor);

          rc.setExpression(
            DefaultNode.parseDefault(
              defaultInfo.getDefaultText(),
              getLanguageConnectionContext(),
              getCompilerContext()));
        }
        else
        {
View Full Code Here

    }

    /* If we have the default text, then parse and bind it and
     * return the tree.
     */
    DefaultInfoImpl defaultInfo = (DefaultInfoImpl) cd.getDefaultInfo();
    if (defaultInfo != null)
    {
      String    defaultText = defaultInfo.getDefaultText();
      ValueNode  defaultTree = parseDefault(defaultText, getLanguageConnectionContext(),
                           getCompilerContext());

      /* Query is dependent on the DefaultDescriptor */
      DefaultDescriptor defaultDescriptor = cd.getDefaultDescriptor(
View Full Code Here

    }

    int columnNumber;
    String columnName;
    String defaultID;
    DefaultInfoImpl    defaultInfo = null;
    ColumnDescriptor colDesc;
    BaseTypeIdImpl    typeId;
    TypeId  wrapperTypeId;
    DataValueDescriptor  defaultValue = null;
    UUID        defaultUUID = null;
    UUID        uuid = null;
    UUIDFactory      uuidFactory = getUUIDFactory();
    long autoincStart, autoincInc;

    DataDescriptorGenerator  ddg = dd.getDataDescriptorGenerator();


    /*
    ** We're going to be getting the UUID for this sucka
    ** so make sure it is a UniqueTupleDescriptor.
    */
    if (parentTupleDescriptor != null)
    {
      if (SanityManager.DEBUG)
      {
        if (!(parentTupleDescriptor instanceof UniqueTupleDescriptor))
        {
          SanityManager.THROWASSERT(parentTupleDescriptor.getClass().getName()
              + " not instanceof UniqueTupleDescriptor")
        }
      }
      uuid = ((UniqueTupleDescriptor)parentTupleDescriptor).getUUID();
    }
    else
    {
      /* 1st column is REFERENCEID (char(36)) */
      uuid = uuidFactory.recreateUUID(row.getColumn(SYSCOLUMNS_REFERENCEID).
                          getString());
    }

    /* NOTE: We get columns 5 and 6 next in order to work around
     * a 1.3.0 HotSpot bug.  (#4361550)
     */

    // 5th column is COLUMNDEFAULT (serialiazable)
    Object object = row.getColumn(SYSCOLUMNS_COLUMNDEFAULT).getObject();
    if (object instanceof DataValueDescriptor)
    {
      defaultValue = (DataValueDescriptor) object;
    }
    else if (object instanceof DefaultInfoImpl)
    {
      defaultInfo = (DefaultInfoImpl) object;
      defaultValue = defaultInfo.getDefaultValue();
    }

    /* 6th column is DEFAULTID (char(36)) */
    defaultID = row.getColumn(SYSCOLUMNS_COLUMNDEFAULTID).getString();

View Full Code Here

            // column position is 1-based, index is 0-based.
            ColumnDescriptor colDesc = targetTD.getColumnDescriptor(columnNumber);
            DataTypeDescriptor colType = colDesc.getType();

            // Check for defaults
            DefaultInfoImpl defaultInfo = (DefaultInfoImpl) colDesc.getDefaultInfo();
     
      //Column has constant default value ,
      //if it have defaultInfo and not be autoincrement.
            if (defaultInfo != null && ! colDesc.isAutoincrement())
            {
                //RESOLVEPARAMETER - skip the tree if we have the value
                /*
                  if (defaultInfo.getDefaultValue() != null)
                  {
                  }
                  else
                */
                {
                    // Generate the tree for the default
                    String defaultText = defaultInfo.getDefaultText();
                    ValueNode defaultTree = parseDefault(defaultText);
                    defaultTree = defaultTree.bindExpression(
                        getFromList(),
                        (SubqueryList) null,
                        (Vector) null);
View Full Code Here

        if (cd.isAutoincrement())
        {
          rc.setAutoincrementGenerated();
        } // end of if ()
       
        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(),
              getLanguageConnectionContext(),
              getCompilerContext()));

        }
        else
View Full Code Here

          defaultTypeId.getSQLTypeName() );
      }

      // Save off the default text
      // RESOLVEDEFAULT - Convert to constant if possible
      defaultInfo = new DefaultInfoImpl(false,
                defaultNode.getDefaultText(),
                defaultValue);

      if (SanityManager.DEBUG)
      {
View Full Code Here

TOP

Related Classes of org.apache.derby.catalog.types.DefaultInfoImpl

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.