Package org.teiid.metadata

Examples of org.teiid.metadata.ProcedureParameter


       
        createKey(KeyRecord.Type.Primary, "pk", vGroup7, vElements7.subList(1, 2));
       
        Schema sp = createVirtualModel("sp", metadataStore); //$NON-NLS-1$
        ColumnSet<Procedure> rs = createResultSet("sp1.vsprs1", new String[] { "StringKey" }, new String[] { DataTypeManager.DefaultDataTypes.STRING }); //$NON-NLS-1$ //$NON-NLS-2$
        ProcedureParameter param = createParameter("param1", ParameterInfo.IN, DataTypeManager.DefaultDataTypes.STRING); //$NON-NLS-1$
        param.setNullType(NullType.Nullable);
        QueryNode sp1qn = new QueryNode("/*+ cache */ CREATE VIRTUAL PROCEDURE BEGIN SELECT x as StringKey from matsrc where x = param1; END"); //$NON-NLS-1$ //$NON-NLS-2$
        Procedure vsp5 = createVirtualProcedure("sp1", sp, Arrays.asList(param), sp1qn); //$NON-NLS-1$
        vsp5.setResultSet(rs);

        return createTransformationMetadata(metadataStore, "");
View Full Code Here


    /**
     * Create stored procedure parameter.
     */
    public static ProcedureParameter createParameter(String name, int direction, String type) {
        ProcedureParameter param = new ProcedureParameter();
        param.setName(name);
        switch (direction) {
        case SPParameter.IN:
          param.setType(Type.In);
          break;
        case SPParameter.INOUT:
          param.setType(Type.InOut);
          break;
        case SPParameter.OUT:
          param.setType(Type.Out);
          break;
        case SPParameter.RESULT_SET:
          throw new AssertionError("should not directly create a resultset param"); //$NON-NLS-1$
        case SPParameter.RETURN_VALUE:
          param.setType(Type.ReturnValue);
          break;
        }
        param.setRuntimeType(type);
        return param;
    }
View Full Code Here

  @Override
  public void getMetadata(MetadataFactory metadataFactory, FileConnection connection) throws TranslatorException {
    Procedure p = metadataFactory.addProcedure(GETTEXTFILES);
    p.setAnnotation("Returns text files that match the given path and pattern as CLOBs");
    ProcedureParameter param = metadataFactory.addProcedureParameter("pathAndPattern", TypeFacility.RUNTIME_NAMES.STRING, Type.In, p); //$NON-NLS-1$
    param.setAnnotation("The path and pattern of what files to return.  Currently the only pattern supported is *.<ext>, which returns only the files matching the given extension at the given path.");
    metadataFactory.addProcedureResultSetColumn("file", TypeFacility.RUNTIME_NAMES.CLOB, p); //$NON-NLS-1$
    metadataFactory.addProcedureResultSetColumn("filePath", TypeFacility.RUNTIME_NAMES.STRING, p); //$NON-NLS-1$
   
    Procedure p1 = metadataFactory.addProcedure(GETFILES);
    p1.setAnnotation("Returns text files that match the given path and pattern as BLOBs");
    param = metadataFactory.addProcedureParameter("pathAndPattern", TypeFacility.RUNTIME_NAMES.STRING, Type.In, p1); //$NON-NLS-1$
    param.setAnnotation("The path and pattern of what files to return.  Currently the only pattern supported is *.<ext>, which returns only the files matching the given extension at the given path.");
    metadataFactory.addProcedureResultSetColumn("file", TypeFacility.RUNTIME_NAMES.BLOB, p1); //$NON-NLS-1$
    metadataFactory.addProcedureResultSetColumn("filePath", TypeFacility.RUNTIME_NAMES.STRING, p1); //$NON-NLS-1$
   
    Procedure p2 = metadataFactory.addProcedure(SAVEFILE);
    p2.setAnnotation("Saves the given vale to the given path.  Any existing file will be overriden.");
    metadataFactory.addProcedureParameter("filePath", TypeFacility.RUNTIME_NAMES.STRING, Type.In, p2); //$NON-NLS-1$
    param = metadataFactory.addProcedureParameter("file", TypeFacility.RUNTIME_NAMES.OBJECT, Type.In, p2); //$NON-NLS-1$
    param.setAnnotation("The contents to save.  Can be one of CLOB, BLOB, or XML");
  }
View Full Code Here

TOP

Related Classes of org.teiid.metadata.ProcedureParameter

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.