Package org.apache.derby.iapi.sql.depend

Examples of org.apache.derby.iapi.sql.depend.ProviderList


                                                 indexAction);

            }
      else
      {
        ProviderList apl = constraintDN.getAuxiliaryProviderList();
        ConstraintInfo refInfo = null;
                ProviderInfo[]  providerInfos;

        if (constraintDN instanceof FKConstraintDefinitionNode)
        {
          refInfo = ((FKConstraintDefinitionNode)constraintDN).getReferencedConstraintInfo();
        }       

        /* Create the ProviderInfos, if the constraint is dependent on any Providers */
        if (apl != null && apl.size() > 0)
        {
          /* Get all the dependencies for the current statement and transfer
           * them to this view.
           */
          DependencyManager dm = dd.getDependencyManager();
View Full Code Here


            FromList fromList = new FromList(
                    getOptimizerFactory().doJoinOrderOptimization(),
          getContextManager());
     
      CompilerContext cc = getCompilerContext();
      ProviderList prevAPL = cc.getCurrentAuxiliaryProviderList();
      ProviderList apl = new ProviderList();
     
      try
      {
        cc.setCurrentAuxiliaryProviderList(apl);
        cc.pushCurrentPrivType(Authorizer.SELECT_PRIV);
View Full Code Here

            //
            // Generated columns may depend on functions mentioned in their
            // generation clauses.
            //
            ProviderList apl = null;
            ProviderInfo[]  providerInfos = null;
      if ( coldef.hasGenerationClause() )
      {
        apl = coldef.getGenerationClauseNode().getAuxiliaryProviderList();
      }
            if (apl != null && apl.size() > 0)
            {
                DependencyManager dm = getDataDictionary().getDependencyManager();
                providerInfos = dm.getPersistentProviderInfos(apl);
            }
View Full Code Here

         * for the check constraint, "push" it on the compiler context
         * by swapping it with the current auxiliary provider list
         * and the "pop" it when we're done by restoring the old
         * auxiliary provider list.
         */
        ProviderList apl = new ProviderList();

        ProviderList prevAPL = cc.getCurrentAuxiliaryProviderList();
        cc.setCurrentAuxiliaryProviderList(apl);

        // Tell the compiler context to only allow deterministic nodes
        cc.setReliability( CompilerContext.CHECK_CONSTRAINT );
        checkTree = checkTree.bindExpression(fromList, (SubqueryList) null,
View Full Code Here

            generationClauseNode = cdn.getGenerationClauseNode();

      // bind the generation clause
      final int previousReliability = cc.getReliability();
            ProviderList prevAPL = cc.getCurrentAuxiliaryProviderList();
      try
      {
        /* Each generation clause can have its own set of dependencies.
         * These dependencies need to be shared with the prepared
         * statement as well.  We create a new auxiliary provider list
         * for the generation clause, "push" it on the compiler context
         * by swapping it with the current auxiliary provider list
         * and the "pop" it when we're done by restoring the old
         * auxiliary provider list.
         */
        ProviderList apl = new ProviderList();

        cc.setCurrentAuxiliaryProviderList(apl);

        // Tell the compiler context to forbid subqueries and
        // non-deterministic functions.
        cc.setReliability( CompilerContext.GENERATION_CLAUSE_RESTRICTION );
        generationTree = generationClauseNode.bindExpression(fromList, (SubqueryList) null,
                     aggregateVector);

                //
                // If the user did not declare a type for this column, then the column type defaults
                // to the type of the generation clause.
                // However, if the user did declare a type for this column, then the
                // type of the generation clause must be assignable to the declared
                // type.
                //
                DataTypeDescriptor  generationClauseType = generationTree.getTypeServices();
                DataTypeDescriptor  declaredType = cdn.getType();
                if ( declaredType == null )
                {
                    cdn.setType( generationClauseType );

                    //
                    // Poke the type into the FromTable so that constraints will
                    // compile.
                    //
                    tableColumns.getResultColumn( cdn.getColumnName(), false ).setType( generationClauseType );

                    //
                    // We skipped these steps earlier on because we didn't have
                    // a datatype. Now that we have a datatype, revisit these
                    // steps.
                    //
                    setCollationTypeOnCharacterStringColumn( sd, cdn );
                    cdn.checkUserType( table.getTableDescriptor() );
                }
                else
                {
                    TypeId  declaredTypeId = declaredType.getTypeId();
                    TypeId  resolvedTypeId = generationClauseType.getTypeId();

                    if ( !getTypeCompiler( resolvedTypeId ).convertible( declaredTypeId, false ) )
                    {
                        throw StandardException.newException
                            ( SQLState.LANG_UNASSIGNABLE_GENERATION_CLAUSE, cdn.getName(), resolvedTypeId.getSQLTypeName() );
                    }
                }

        // no aggregates, please
        if (aggregateVector.size() != 0)
        {
          throw StandardException.newException( SQLState.LANG_AGGREGATE_IN_GENERATION_CLAUSE, cdn.getName());
        }
       
        /* Save the APL off in the constraint node */
        if (apl.size() > 0)
        {
          generationClauseNode.setAuxiliaryProviderList(apl);
        }

      }
View Full Code Here

                         constraintDN.getDropBehavior(),
                                                 constraintDN.getVerifyType());
      }
      else
      {
        ProviderList apl = constraintDN.getAuxiliaryProviderList();
        ConstraintInfo refInfo = null;
        ProviderInfo[]  providerInfos = null;

        if (constraintDN instanceof FKConstraintDefinitionNode)
        {
          refInfo = ((FKConstraintDefinitionNode)constraintDN).getReferencedConstraintInfo();
        }       

        /* Create the ProviderInfos, if the constraint is dependent on any Providers */
        if (apl != null && apl.size() > 0)
        {
          /* Get all the dependencies for the current statement and transfer
           * them to this view.
           */
          DependencyManager dm = dd.getDependencyManager();
View Full Code Here

    FromList  fromList = (FromList) nodeFactory.getNode(
                    C_NodeTypes.FROM_LIST,
                    nodeFactory.doJoinOrderOptimization(),
                    cm);

    ProviderList   prevAPL = compilerContext.getCurrentAuxiliaryProviderList();
    ProviderList   apl = new ProviderList();

    try {
      compilerContext.setCurrentAuxiliaryProviderList(apl);
      compilerContext.pushCurrentPrivType(Authorizer.SELECT_PRIV);
View Full Code Here

    FromList  fromList = (FromList) nodeFactory.getNode(
                    C_NodeTypes.FROM_LIST,
                    nodeFactory.doJoinOrderOptimization(),
                    cm);

    ProviderList   prevAPL = compilerContext.getCurrentAuxiliaryProviderList();
    ProviderList   apl = new ProviderList();

    try {
      compilerContext.setCurrentAuxiliaryProviderList(apl);

      /* Bind the tables in the queryExpression */
 
View Full Code Here

       * for the default, "push" it on the compiler context
       * by swapping it with the current auxiliary provider list
       * and the "pop" it when we're done by restoring the old
       * auxiliary provider list.
       */
      ProviderList apl = new ProviderList();

      ProviderList prevAPL = cc.getCurrentAuxiliaryProviderList();
      cc.setCurrentAuxiliaryProviderList(apl);

      // Tell the compiler context to only allow deterministic nodes
      cc.setReliability( CompilerContext.DEFAULT_RESTRICTION );
      defaultTree = defaultTree.bindExpression(
View Full Code Here

         * for the check constraint, "push" it on the compiler context
         * by swapping it with the current auxiliary provider list
         * and the "pop" it when we're done by restoring the old
         * auxiliary provider list.
         */
        ProviderList apl = new ProviderList();

        ProviderList prevAPL = cc.getCurrentAuxiliaryProviderList();
        cc.setCurrentAuxiliaryProviderList(apl);

        // Tell the compiler context to only allow deterministic nodes
        cc.setReliability( CompilerContext.CHECK_CONSTRAINT );
        checkTree = checkTree.bindExpression(fromList, (SubqueryList) null,
View Full Code Here

TOP

Related Classes of org.apache.derby.iapi.sql.depend.ProviderList

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.