org.teiid.metadata.Procedure.setAnnotation()方法的使用及代码示例

x33g5p2x  于2022-01-26 转载在 其他  
字(8.4k)|赞(0)|评价(0)|浏览(110)

本文整理了Java中org.teiid.metadata.Procedure.setAnnotation()方法的一些代码示例,展示了Procedure.setAnnotation()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Procedure.setAnnotation()方法的具体详情如下:
包路径:org.teiid.metadata.Procedure
类名称:Procedure
方法名:setAnnotation

Procedure.setAnnotation介绍

暂无

代码示例

代码示例来源:origin: org.teiid.connectors/translator-swagger

procedure.setProperty(PRODUCES, produces);
procedure.setProperty(CONSUMES, consumes);
procedure.setAnnotation(getOperationSummary(operation));
for (Entry<String, Object> extension:operation.getVendorExtensions().entrySet()) {
  procedure.setProperty(extension.getKey(), extension.getValue().toString());

代码示例来源:origin: org.teiid.connectors/translator-file

@Override
public void getMetadata(MetadataFactory metadataFactory, VirtualFileConnection connection) throws TranslatorException {
  Procedure p = metadataFactory.addProcedure(GETTEXTFILES);
  p.setAnnotation("Returns text files that match the given path and pattern as CLOBs"); //$NON-NLS-1$
  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."); //$NON-NLS-1$
  p1.setAnnotation("Returns files that match the given path and pattern as BLOBs"); //$NON-NLS-1$
  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."); //$NON-NLS-1$
  p2.setAnnotation("Saves the given value to the given path.  Any existing file will be overriden."); //$NON-NLS-1$
  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$
  p3.setAnnotation("Delete the given file path. "); //$NON-NLS-1$
  metadataFactory.addProcedureParameter("filePath", TypeFacility.RUNTIME_NAMES.STRING, Type.In, p3); //$NON-NLS-1$

代码示例来源:origin: org.teiid.connectors/translator-salesforce

public static void addProcedrues(MetadataFactory metadataFactory) {
  Procedure p1 = metadataFactory.addProcedure("GetUpdated"); //$NON-NLS-1$
  p1.setAnnotation("Gets the updated objects"); //$NON-NLS-1$
  ProcedureParameter param = metadataFactory.addProcedureParameter("ObjectName", TypeFacility.RUNTIME_NAMES.STRING, Type.In, p1); //$NON-NLS-1$
  param.setAnnotation("ObjectName"); //$NON-NLS-1$
  param = metadataFactory.addProcedureParameter("StartDate", TypeFacility.RUNTIME_NAMES.TIMESTAMP, Type.In, p1); //$NON-NLS-1$
  param.setAnnotation("Start Time"); //$NON-NLS-1$
  param = metadataFactory.addProcedureParameter("EndDate", TypeFacility.RUNTIME_NAMES.TIMESTAMP, Type.In, p1); //$NON-NLS-1$
  param.setAnnotation("End Time"); //$NON-NLS-1$
  param = metadataFactory.addProcedureParameter("LatestDateCovered", TypeFacility.RUNTIME_NAMES.TIMESTAMP, Type.In, p1); //$NON-NLS-1$
  param.setAnnotation("Latest Date Covered"); //$NON-NLS-1$
  metadataFactory.addProcedureResultSetColumn("ID", TypeFacility.RUNTIME_NAMES.STRING, p1); //$NON-NLS-1$
  
  
  Procedure p2 = metadataFactory.addProcedure("GetDeleted"); //$NON-NLS-1$
  p2.setAnnotation("Gets the deleted objects"); //$NON-NLS-1$
  param = metadataFactory.addProcedureParameter("ObjectName", TypeFacility.RUNTIME_NAMES.STRING, Type.In, p2); //$NON-NLS-1$
  param.setAnnotation("ObjectName"); //$NON-NLS-1$
  param = metadataFactory.addProcedureParameter("StartDate", TypeFacility.RUNTIME_NAMES.TIMESTAMP, Type.In, p2); //$NON-NLS-1$
  param.setAnnotation("Start Time"); //$NON-NLS-1$
  param = metadataFactory.addProcedureParameter("EndDate", TypeFacility.RUNTIME_NAMES.TIMESTAMP, Type.In, p2); //$NON-NLS-1$
  param.setAnnotation("End Time"); //$NON-NLS-1$
  param = metadataFactory.addProcedureParameter("EarliestDateAvailable", TypeFacility.RUNTIME_NAMES.TIMESTAMP, Type.In, p2); //$NON-NLS-1$
  param.setAnnotation("Earliest Date Available"); //$NON-NLS-1$
  param = metadataFactory.addProcedureParameter("LatestDateCovered", TypeFacility.RUNTIME_NAMES.TIMESTAMP, Type.In, p2); //$NON-NLS-1$
  param.setAnnotation("Latest Date Covered"); //$NON-NLS-1$       
  metadataFactory.addProcedureResultSetColumn("ID", TypeFacility.RUNTIME_NAMES.STRING, p2); //$NON-NLS-1$     
  metadataFactory.addProcedureResultSetColumn("DeletedDate", TypeFacility.RUNTIME_NAMES.TIMESTAMP, p2); //$NON-NLS-1$
}

代码示例来源:origin: org.jboss.teiid/teiid-engine

@Override
  public void loadMetadata(MetadataFactory factory, ExecutionFactory executionFactory, Object connectionFactory) throws TranslatorException {

    if (executionFactory != null && executionFactory.supportsDirectQueryProcedure() && factory.getSchema().getProcedure(executionFactory.getDirectQueryProcedureName()) == null) {
      Procedure p = factory.addProcedure(executionFactory.getDirectQueryProcedureName());
      p.setAnnotation("Invokes translator with a native query that returns results in an array of values"); //$NON-NLS-1$

      ProcedureParameter param = factory.addProcedureParameter("request", TypeFacility.RUNTIME_NAMES.STRING, Type.In, p); //$NON-NLS-1$
      param.setAnnotation("The native query to execute"); //$NON-NLS-1$
      param.setNullType(NullType.No_Nulls);

      param = factory.addProcedureParameter("variable", TypeFacility.RUNTIME_NAMES.OBJECT, Type.In, p); //$NON-NLS-1$
      param.setAnnotation("Any number of varaibles; usage will vary by translator"); //$NON-NLS-1$
      param.setNullType(NullType.Nullable);
      param.setVarArg(true);
      
      factory.addProcedureResultSetColumn("tuple", DataTypeManager.getDataTypeName(DataTypeManager.getArrayType(TypeFacility.RUNTIME_TYPES.OBJECT)), p); //$NON-NLS-1$		
    }
  }    
}

代码示例来源:origin: org.teiid/teiid-engine

@Override
  public void loadMetadata(MetadataFactory factory, ExecutionFactory executionFactory, Object connectionFactory) throws TranslatorException {

    if (executionFactory != null && executionFactory.supportsDirectQueryProcedure() && factory.getSchema().getProcedure(executionFactory.getDirectQueryProcedureName()) == null) {
      Procedure p = factory.addProcedure(executionFactory.getDirectQueryProcedureName());
      p.setAnnotation("Invokes translator with a native query that returns results in an array of values"); //$NON-NLS-1$

      ProcedureParameter param = factory.addProcedureParameter("request", TypeFacility.RUNTIME_NAMES.STRING, Type.In, p); //$NON-NLS-1$
      param.setAnnotation("The native query to execute"); //$NON-NLS-1$
      param.setNullType(NullType.No_Nulls);

      param = factory.addProcedureParameter("variable", TypeFacility.RUNTIME_NAMES.OBJECT, Type.In, p); //$NON-NLS-1$
      param.setAnnotation("Any number of varaibles; usage will vary by translator"); //$NON-NLS-1$
      param.setNullType(NullType.Nullable);
      param.setVarArg(true);
      
      factory.addProcedureResultSetColumn("tuple", DataTypeManager.getDataTypeName(DataTypeManager.getArrayType(TypeFacility.RUNTIME_TYPES.OBJECT)), p); //$NON-NLS-1$		
    }
  }    
}

代码示例来源:origin: teiid/teiid

@Override
  public void loadMetadata(MetadataFactory factory, ExecutionFactory executionFactory, Object connectionFactory) throws TranslatorException {

    if (executionFactory != null && executionFactory.supportsDirectQueryProcedure() && factory.getSchema().getProcedure(executionFactory.getDirectQueryProcedureName()) == null) {
      Procedure p = factory.addProcedure(executionFactory.getDirectQueryProcedureName());
      p.setAnnotation("Invokes translator with a native query that returns results in an array of values"); //$NON-NLS-1$

      ProcedureParameter param = factory.addProcedureParameter("request", TypeFacility.RUNTIME_NAMES.STRING, Type.In, p); //$NON-NLS-1$
      param.setAnnotation("The native query to execute"); //$NON-NLS-1$
      param.setNullType(NullType.No_Nulls);

      param = factory.addProcedureParameter("variable", TypeFacility.RUNTIME_NAMES.OBJECT, Type.In, p); //$NON-NLS-1$
      param.setAnnotation("Any number of varaibles; usage will vary by translator"); //$NON-NLS-1$
      param.setNullType(NullType.Nullable);
      param.setVarArg(true);
      
      factory.addProcedureResultSetColumn("tuple", DataTypeManager.getDataTypeName(DataTypeManager.getArrayType(TypeFacility.RUNTIME_TYPES.OBJECT)), p); //$NON-NLS-1$		
    }
  }    
}

相关文章