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

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

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

Procedure.getProperty介绍

暂无

代码示例

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

private boolean isTVF(Procedure proc) {
  String value = proc.getProperty(PIMetadataProcessor.TVF, false);
  return Boolean.parseBoolean(value); 
}

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

private boolean isFunction(Procedure proc) {
  ODataType type = ODataType.valueOf(proc.getProperty(ODataMetadataProcessor.ODATA_TYPE, false));
  return type == ODataType.FUNCTION;
}

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

private static void removeProcedureOption(String key, Procedure proc) {
  if (proc.getProperty(key, false) != null) {
    proc.setProperty(key, null);
  }       
  removeCommonProperty(key, proc);
  
  if (key.equals("UPDATECOUNT")) { //$NON-NLS-1$
    proc.setUpdateCount(1);
  }
}

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

private static void removeProcedureOption(String key, Procedure proc) {
  if (proc.getProperty(key, false) != null) {
    proc.setProperty(key, null);
  }       
  removeCommonProperty(key, proc);
  
  if (key.equals("UPDATECOUNT")) { //$NON-NLS-1$
    proc.setUpdateCount(1);
  }
}

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

private static void removeProcedureOption(String key, Procedure proc) {
  if (proc.getProperty(key, false) != null) {
    proc.setProperty(key, null);
  }       
  removeCommonProperty(key, proc);
  
  if (key.equals("UPDATECOUNT")) { //$NON-NLS-1$
    proc.setUpdateCount(1);
  }
}

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

private boolean isTVF(TableReference table) {
  if (table instanceof NamedTable) {
    String value = ((NamedTable)table).getMetadataObject().getProperty(PIMetadataProcessor.TVF, false);
    return Boolean.parseBoolean(value);
  } else if (table instanceof NamedProcedureCall) {
    String value = ((NamedProcedureCall)table).getCall().getMetadataObject().getProperty(PIMetadataProcessor.TVF, false);
    return Boolean.parseBoolean(value); 
  }
  return false;
}

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

private String buildProcedureOptions(Procedure procedure) {
  StringBuilder options = new StringBuilder();
  addCommonOptions(options, procedure);
  
  if (procedure.getUpdateCount() != Procedure.AUTO_UPDATECOUNT) {
    addOption(options, UPDATECOUNT, procedure.getUpdateCount());
  }    
  
  if (!procedure.getProperties().isEmpty()) {
    for (String key:procedure.getProperties().keySet()) {
      addOption(options, key, procedure.getProperty(key, false));
    }
  }        
  
  return options.toString();
}

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

private String buildProcedureOptions(Procedure procedure) {
  StringBuilder options = new StringBuilder();
  addCommonOptions(options, procedure);
  
  if (procedure.getUpdateCount() != Procedure.AUTO_UPDATECOUNT) {
    addOption(options, UPDATECOUNT, procedure.getUpdateCount());
  }    
  
  if (!procedure.getProperties().isEmpty()) {
    for (String key:procedure.getProperties().keySet()) {
      addOption(options, key, procedure.getProperty(key, false));
    }
  }        
  
  return options.toString();
}

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

private String buildProcedureOptions(Procedure procedure) {
  StringBuilder options = new StringBuilder();
  addCommonOptions(options, procedure);
  
  if (procedure.getUpdateCount() != Procedure.AUTO_UPDATECOUNT) {
    addOption(options, UPDATECOUNT, procedure.getUpdateCount());
  }    
  
  if (!procedure.getProperties().isEmpty()) {
    for (String key:procedure.getProperties().keySet()) {
      addOption(options, key, procedure.getProperty(key, false));
    }
  }        
  
  return options.toString();
}

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

@Override
public ProcedureExecution createProcedureExecution(Call command,ExecutionContext executionContext, RuntimeMetadata metadata, SalesforceConnection connection)
    throws TranslatorException {
  Procedure metadataObject = command.getMetadataObject();
  String nativeQuery = metadataObject.getProperty(SQLStringVisitor.TEIID_NATIVE_QUERY, false);
  if (nativeQuery != null) {
    return new DirectQueryExecution(command.getArguments(), command, connection, metadata, executionContext, nativeQuery, false);
  }
  return new ProcedureExecutionParentImpl(command, connection, metadata, executionContext);
}

代码示例来源:origin: org.teiid.wildfly/rest-service

String uri = procedure.getProperty(REST_NAMESPACE+"URI", false); //$NON-NLS-1$
String method = procedure.getProperty(REST_NAMESPACE+"METHOD", false); //$NON-NLS-1$
if (uri != null && method != null) {
  return true;

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

/**
 * @see org.teiid.language.visitor.SQLStringVisitor#visit(org.teiid.language.Call)
 */
public void visit(Call obj) {
  usingBinding = true;
  Procedure p = obj.getMetadataObject();
  if (p != null) {
    String nativeQuery = p.getProperty(TEIID_NATIVE_QUERY, false);
    if (nativeQuery != null) {
      this.prepared = !Boolean.valueOf(p.getProperty(TEIID_NON_PREPARED, false));
      if (this.prepared) {
        this.preparedValues = new ArrayList<Object>();
      }
      parseNativeQueryParts(nativeQuery, obj.getArguments(), buffer, this);
      return;
    }
  }
  if (obj.isTableReference()) {
    usingBinding = false;
    super.visit(obj);
    return;
  }
  this.prepared = true;
  /*
   * preparedValues is now a list of procedure params instead of just values
   */
  this.preparedValues = obj.getArguments();
  buffer.append(generateSqlForStoredProcedure(obj));
}

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

@Override
public ProcedureExecution createProcedureExecution(Call command,
    ExecutionContext executionContext, RuntimeMetadata metadata,
    GoogleSpreadsheetConnection connection) throws TranslatorException {
  String nativeQuery = command.getMetadataObject().getProperty(SQLStringVisitor.TEIID_NATIVE_QUERY, false);
  if (nativeQuery != null) {
    return new DirectSpreadsheetQueryExecution(nativeQuery, command.getArguments(), executionContext, connection, false);
  }
  throw new TranslatorException("Missing native-query extension metadata."); //$NON-NLS-1$
}

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

@Override
public ProcedureExecution createProcedureExecution(Call command, ExecutionContext executionContext, RuntimeMetadata metadata, WSConnection connection) throws TranslatorException {
  String nativeQuery = command.getMetadataObject().getProperty(SQLStringVisitor.TEIID_NATIVE_QUERY, false);
  if (nativeQuery != null) {
    throw new TranslatorException(ODataPlugin.Util.gs(ODataPlugin.Event.TEIID17014));
  }
  return new ODataProcedureExecution(command, this, executionContext, metadata, connection);
}

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

@Override
public ProcedureExecution createProcedureExecution(Call command, ExecutionContext executionContext, RuntimeMetadata metadata, EntityManager connection) throws TranslatorException {
  String nativeQuery = command.getMetadataObject().getProperty(SQLStringVisitor.TEIID_NATIVE_QUERY, false);
  if (nativeQuery != null) {
    return new JPQLDirectQueryExecution(command.getArguments(), command, executionContext, metadata, connection, nativeQuery, false);
  }
  throw new TranslatorException("Missing native-query extension metadata."); //$NON-NLS-1$
}

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

@Override
public ProcedureExecution createProcedureExecution(Call command,
    ExecutionContext executionContext, RuntimeMetadata metadata,
    WSConnection connection) throws TranslatorException {
  String nativeQuery = command.getMetadataObject().getProperty(
      SQLStringVisitor.TEIID_NATIVE_QUERY, false);
  if (nativeQuery != null) {
    throw new TranslatorException(ODataPlugin.Util.gs(ODataPlugin.Event.TEIID17014));
  }
  return new ODataProcedureExecution(command, this, executionContext, metadata, connection);
}

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

@Override
public ProcedureExecution createProcedureExecution(Call command,
    ExecutionContext executionContext, RuntimeMetadata metadata,
    LdapContext connection) throws TranslatorException {
  String nativeQuery = command.getMetadataObject().getProperty(SQLStringVisitor.TEIID_NATIVE_QUERY, false);
  if (nativeQuery != null) {
    if (nativeQuery.startsWith("search;")) { //$NON-NLS-1$
      return new LDAPDirectSearchQueryExecution(command.getArguments(), this, executionContext, connection, nativeQuery, false);
    }
    return new LDAPDirectCreateUpdateDeleteQueryExecution(command.getArguments(), this, executionContext, connection, nativeQuery, false);
  }
  throw new TranslatorException("Missing native-query extension metadata."); //$NON-NLS-1$
}

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

@Override
public ProcedureExecution createProcedureExecution(Call command, ExecutionContext executionContext, RuntimeMetadata metadata, MongoDBConnection connection) throws TranslatorException {
  String nativeQuery = command.getMetadataObject().getProperty(SQLStringVisitor.TEIID_NATIVE_QUERY, false);
  if (nativeQuery != null) {
    return new MongoDBDirectQueryExecution(command.getArguments(), command, executionContext, metadata, connection, nativeQuery, false, this);
  }
  throw new TranslatorException(MongoDBPlugin.Util.gs(MongoDBPlugin.Event.TEIID18011));
}

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

@Override
public ProcedureExecution createProcedureExecution(Call command,
    ExecutionContext executionContext, RuntimeMetadata metadata,
    Connection connection) throws TranslatorException {
  String nativeQuery = command.getMetadataObject().getProperty(SQLStringVisitor.TEIID_NATIVE_QUERY, false);
  if (nativeQuery != null) {
    return new OlapQueryExecution(command.getArguments(), command, unwrap(connection), executionContext, this, nativeQuery, false);
  }
  throw new TranslatorException("Missing native-query extension metadata."); //$NON-NLS-1$
}

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

@Override
public void visit(Call call) {
  if (oracleSuppliedDriver && call.getResultSetColumnTypes().length > 0 && call.getMetadataObject() != null) {
    if (call.getReturnType() == null && call.getMetadataObject().getProperty(SQLConversionVisitor.TEIID_NATIVE_QUERY, false) == null) {
      //assume stored function handling
      if (!setOutCursorType(call)) {
        call.setReturnType(RefCursorType.class);
      }
    } else {
      //TODO we only will allow a single out cursor
      if (call.getMetadataObject() != null) {
        ProcedureParameter param = call.getReturnParameter();
        if (param != null && REF_CURSOR.equalsIgnoreCase(param.getNativeType())) {
          call.setReturnType(RefCursorType.class);
        }
      }
      setOutCursorType(call);
    }
  }
  super.visit(call);
}

相关文章