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

            {
                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 (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() )
        {
                    setDefault( rc, cd, defaultInfo );
        }
        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, (List<AggregateNode>) null);
                        newResultColumn = new ResultColumn(
                                defaultTree.getTypeServices(),
View Full Code Here

            }

            // plug in defaults if we haven't done so already
            if ( !changed )
            {
                DefaultInfoImpl     defaultInfo = (DefaultInfoImpl) cd.getDefaultInfo();

        if ( (defaultInfo != null) && !defaultInfo.isGeneratedColumn() && !cd.isAutoincrement() )
        {
                    _thenColumns.setDefault( origRC, cd, defaultInfo );
                    changed = true;
        }
            }
View Full Code Here

            }

            // plug in defaults if we haven't done so already
            if ( !changed )
            {
                DefaultInfoImpl     defaultInfo = (DefaultInfoImpl) cd.getDefaultInfo();

        if ( (defaultInfo != null) && !defaultInfo.isGeneratedColumn() && !cd.isAutoincrement() )
        {
                    _thenColumns.setDefault( origRC, cd, defaultInfo );
                    changed = true;
        }
            }
View Full Code Here

    }

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

    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

    }

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

View Full Code Here

                    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

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.