Examples of RoutineAliasInfo


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

            paramCount = 0;
            paramModes = null;
          }
         
          // details[3] = java method
          RoutineAliasInfo ai = new RoutineAliasInfo(details[3],
              paramCount, paramNames,
              pt, paramModes, 0,
              RoutineAliasInfo.PS_JAVA, RoutineAliasInfo.NO_SQL,
              false, rt);
View Full Code Here

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

                arg_modes[i] = JDBC30Translation.PARAMETER_MODE_IN;
            for (int i = 0; i < num_out_param; i++)
                arg_modes[num_in_param + i] = JDBC30Translation.PARAMETER_MODE_OUT;
        }

        RoutineAliasInfo routine_alias_info =
            new RoutineAliasInfo(
                routine_name,                       // name of routine
                num_args,                           // number of params
                arg_names,                          // names of params
                arg_types,                          // types of params
                arg_modes,                          // all "IN" params
View Full Code Here

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

             );
        ps.setString( 1, routineName );
        ResultSet               rs = ps.executeQuery();

        rs.next();
        RoutineAliasInfo    rai = (RoutineAliasInfo) rs.getObject( 1 );

        assertEquals( isDeterministic, rai.isDeterministic() );

        rs.close();
        ps.close();
    }
View Full Code Here

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

        while ( rs.next() )
        {
            String    aliasName = rs.getString( 2 );
            boolean isSystemAlias = rs.getBoolean( 4 );

            RoutineAliasInfo    rai = (RoutineAliasInfo) rs.getObject( 5 );

            if ( isSystemAlias ) { assertFalse( aliasName, rai.isDeterministic() ); }
        }

        rs.close();
        ps.close();
    }
View Full Code Here

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

                        // All parameters must be IN.
                        paramModes[i] = JDBC30Translation.PARAMETER_MODE_IN;
                    }

          // details[3] = java method
          RoutineAliasInfo ai = new RoutineAliasInfo(details[3],
              paramCount, paramNames,
              pt, paramModes, 0,
                            RoutineAliasInfo.PS_JAVA, RoutineAliasInfo.NO_SQL, isDeterministic,
              false, rt);
View Full Code Here

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

                arg_modes[i] = JDBC30Translation.PARAMETER_MODE_IN;
            for (int i = 0; i < num_out_param; i++)
                arg_modes[num_in_param + i] = JDBC30Translation.PARAMETER_MODE_OUT;
        }

        RoutineAliasInfo routine_alias_info =
            new RoutineAliasInfo(
                routine_name,                       // name of routine
                num_args,                           // number of params
                arg_names,                          // names of params
                arg_types,                          // types of params
                arg_modes,                          // all "IN" params
View Full Code Here

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

                   aggregateVector);

    // Is the parameter list to the constructor valid for a VTI?
    methodParms = methodCall.getMethodParms();

        RoutineAliasInfo    routineInfo = methodCall.getRoutineInfo();

        if (
            (routineInfo !=null) &&
            routineInfo.getReturnType().isRowMultiSet() &&
            (routineInfo.getParameterStyle() == RoutineAliasInfo.PS_DERBY_JDBC_RESULT_SET)
            )      {
            isDerbyStyleTableFunction = true;
        }
       
    /* If we have a valid constructor, does class implement the correct interface?
     * If version2 is true, then it must implement PreparedStatement, otherwise
     * it can implement either PreparedStatement or ResultSet.  (We check for
     * PreparedStatement first.)
     */

    if ( isConstructor() )
    {
        NewInvocationNode   constructor = (NewInvocationNode) methodCall;
               
        if (!constructor.assignableTo("java.sql.PreparedStatement"))
        {
      if (version2)
      {
        throw StandardException.newException(SQLState.LANG_DOES_NOT_IMPLEMENT,
                    getVTIName(),
                    "java.sql.PreparedStatement");
      }
      else if (! constructor.assignableTo("java.sql.ResultSet"))
      {
        throw StandardException.newException(SQLState.LANG_DOES_NOT_IMPLEMENT,
                    getVTIName(),
                    "java.sql.ResultSet");
      }
        }
        else
        {
          version2 = true;
        }
       
        /* If this is a version 2 VTI */
        if (version2)
        {
      // Does it support predicates
      implementsPushable = constructor.assignableTo("org.apache.derby.vti.IQualifyable");
        }
        // Remember whether or not the VTI implements the VTICosting interface
        implementsVTICosting = constructor.assignableTo(ClassName.VTICosting);
    }

        if ( isDerbyStyleTableFunction )
        {
            implementsVTICosting = implementsDerbyStyleVTICosting( methodCall.getJavaClassName() );
        }
           

    /* Build the RCL for this VTI.  We instantiate an object in order
     * to get the ResultSetMetaData.
     *
     * If we have a special trigger vti, then we branch off and get
     * its rcl from the trigger table that is waiting for us in
     * the compiler context.
     */
    UUID triggerTableId;
    if ((isConstructor()) && ((triggerTableId = getSpecialTriggerVTITableName(lcc, methodCall.getJavaClassName())) != null)  )
    {
      TableDescriptor td = getDataDictionary().getTableDescriptor(triggerTableId);
      resultColumns = genResultColList(td);

      // costing info
      vtiCosted = true;
      estimatedCost = 50d;
      estimatedRowCount = 5d;
      supportsMultipleInstantiations = true;
    }
    else
   
      resultColumns = (ResultColumnList) getNodeFactory().getNode(
                        C_NodeTypes.RESULT_COLUMN_LIST,
                        getContextManager());

      // if this is a Derby-style Table Function, then build the result
      // column list from the RowMultiSetImpl return datatype

      if ( isDerbyStyleTableFunction ) {
          createResultColumnsForTableFunction( routineInfo.getReturnType() );
      }
      else
      {
           
          ResultSetMetaData rsmd = getResultSetMetaData();
View Full Code Here

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

        if (calledOnNullInputO == null)
          calledOnNullInput = true;
        else
          calledOnNullInput = calledOnNullInputO.booleanValue();

        aliasInfo = new RoutineAliasInfo(this.methodName, paramCount, names, types, modes, drs,
            ((Short) routineElements[PARAMETER_STYLE]).shortValue()// parameter style
                        sqlAllowed, isDeterministic, calledOnNullInput, (TypeDescriptor) routineElements[RETURN_TYPE]);

        implicitCreateSchema = true;
        }
View Full Code Here

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

   * care of the collation type of it's character string types.
   *
   * @return true if it has a parameter or return type of character string
   */
  private boolean anyStringTypeDescriptor() {
    RoutineAliasInfo rai = (RoutineAliasInfo)aliasInfo;
    TypeDescriptor aType = rai.getReturnType();
    TypeId compTypeId;
    /*
    ** Try for a built in type matching the
    ** type name. 
    */
    if (aType != null) //that means we are not dealing with a procedure
    {
      compTypeId = TypeId.getBuiltInTypeId(aType.getTypeName());
      if (compTypeId != null && compTypeId.isStringTypeId())
        return true;     
    }
    if (rai.getParameterCount() != 0) {
      int paramCount = rai.getParameterCount();
      TypeDescriptor[] paramTypes = rai.getParameterTypes();
      for (int i = 0; i < paramCount; i++) {
        compTypeId = TypeId.getBuiltInTypeId(paramTypes[i].getTypeName());
        if (compTypeId != null && compTypeId.isStringTypeId())
          return true;
      }
View Full Code Here

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

             (TupleDescriptor) null,
             (List) null,
             true,
             TransactionController.ISOLATION_REPEATABLE_READ,
             tc);
        RoutineAliasInfo   oldRai = (RoutineAliasInfo) oldAD.getAliasInfo();
        TypeDescriptor     newReturnType = DataTypeDescriptor.getCatalogType( Types.VARCHAR, Limits.MAX_CLOB_RETURN_LEN );
        RoutineAliasInfo   newRai = new RoutineAliasInfo
            (
             oldRai.getMethodName(),
             oldRai.getParameterCount(),
             oldRai.getParameterNames(),
             oldRai.getParameterTypes(),
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.