Package org.apache.derby.catalog.types

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


          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

            // 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

        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

            {
                referencedColumnNames[ i ] = ((ResultColumn)rcl.elementAt( generationClauseColumnReferences[ i ] - 1 )).getName();
            }

            String              currentSchemaName = getLanguageConnectionContext().getCurrentSchemaName();
            DefaultInfoImpl dii = new DefaultInfoImpl
                ( generationClauseNode.getExpressionText(), referencedColumnNames, currentSchemaName );
            cdn.setDefaultInfo( dii );

      /* Clear the column references in the RCL so each generation clause
       * starts with a clean list.
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

    }

    /* 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

            // 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, (List) null);
                        newResultColumn = (ResultColumn) getNodeFactory().getNode
                            ( C_NodeTypes.RESULT_COLUMN, defaultTree.getTypeServices(), defaultTree, getContextManager());
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 (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

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.