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

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

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

Procedure.getName介绍

暂无

代码示例

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

public String getName() {
  return procedure.getName();
}

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

@Override
  public void fillRow(List<Object> row, Procedure proc,
      VDBMetaData v, TransformationMetadata metadata,
      CommandContext cc, SimpleIterator<Procedure> iter) {
    row.add(v.getName());
    row.add(proc.getParent().getName());
    row.add(proc.getName());
    row.add(proc.getNameInSource());
    row.add(proc.getResultSet() != null);
    row.add(proc.getUUID());
    row.add(proc.getAnnotation());
    row.add(proc.getParent().getUUID());
  }
});

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

public void addProcedure(Procedure procedure) {
  procedure.setParent(this);
  if (this.procedures.put(procedure.getName(), procedure) != null) {
    throw new DuplicateRecordException(DataPlugin.Event.TEIID60014, DataPlugin.Util.gs(DataPlugin.Event.TEIID60014, procedure.getName())); 
  }
  resolvingOrder.add(procedure);
}

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

@Override
  public void fillRow(List<Object> row, Procedure proc,
      VDBMetaData v, TransformationMetadata metadata,
      CommandContext cc, SimpleIterator<Procedure> iter) {
    row.add(v.getName());
    row.add(proc.getParent().getName());
    row.add(proc.getName());
    row.add(proc.getNameInSource());
    row.add(proc.getResultSet() != null);
    row.add(proc.getUUID());
    row.add(proc.getAnnotation());
    row.add(proc.getParent().getUUID());
  }
});

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

public void procedureModified(Procedure procedure) {
  if (!assertInEditMode(Mode.SCHEMA)) {
    return;
  }
  verifyProcedureExists(procedure.getName());
  assertGrant(Grant.Permission.Privilege.ALTER, Database.ResourceType.PROCEDURE, procedure);
}

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

@Override
  public void fillRow(List<Object> row, Procedure proc,
      VDBMetaData v, TransformationMetadata metadata,
      CommandContext cc, SimpleIterator<Procedure> iter) {
    row.add(v.getName());
    row.add(proc.getParent().getName());
    row.add(proc.getName());
    row.add(proc.getNameInSource());
    row.add(proc.getResultSet() != null);
    row.add(proc.getUUID());
    row.add(proc.getAnnotation());
    row.add(proc.getParent().getUUID());
  }
});

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

private static CsdlComplexType buildComplexType(Procedure proc,
    ColumnSet<Procedure> returnColumns, CsdlSchema csdlSchema) {
  CsdlComplexType complexType = new CsdlComplexType();
  String entityTypeName = proc.getName() + "_" + returnColumns.getName(); //$NON-NLS-1$
  complexType.setName(entityTypeName);
  ArrayList<CsdlProperty> props = new ArrayList<CsdlProperty>();
  for (Column c : returnColumns.getColumns()) {
    CsdlProperty property = buildProperty(c, (c.getNullType() == NullType.Nullable));
    props.add(property);
    addColumnAnnotations(c, property, csdlSchema);
  }
  complexType.setProperties(props);
  return complexType;
}

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

static FunctionMethod replaceProcedureWithFunction(MetadataFactory factory,
    Procedure proc) throws MetadataException {
  if (proc.isFunction() && proc.getQueryPlan() != null) {
    return null;
  }
  FunctionMethod method = createFunctionMethod(proc);
  //remove the old proc
  factory.getSchema().getResolvingOrder().remove(factory.getSchema().getResolvingOrder().size() - 1);
  factory.getSchema().getProcedures().remove(proc.getName());
  
  factory.getSchema().addFunction(method);
  return method;
}

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

static FunctionMethod replaceProcedureWithFunction(MetadataFactory factory,
    Procedure proc) throws MetadataException {
  if (proc.isFunction() && proc.getQueryPlan() != null) {
    return null;
  }
  FunctionMethod method = createFunctionMethod(proc);
  //remove the old proc
  factory.getSchema().getResolvingOrder().remove(factory.getSchema().getResolvingOrder().size() - 1);
  factory.getSchema().getProcedures().remove(proc.getName());
  
  factory.getSchema().addFunction(method);
  return method;
}

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

static FunctionMethod replaceProcedureWithFunction(MetadataFactory factory,
    Procedure proc) throws MetadataException {
  if (proc.isFunction() && proc.getQueryPlan() != null) {
    return null;
  }
  FunctionMethod method = createFunctionMethod(proc);
  //remove the old proc
  factory.getSchema().getResolvingOrder().remove(factory.getSchema().getResolvingOrder().size() - 1);
  factory.getSchema().getProcedures().remove(proc.getName());
  
  factory.getSchema().addFunction(method);
  return method;
}

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

private void visit(EdmParameter edmParameter) throws TeiidProcessingException {
  Class<?> runtimeType = resolveParameterType(this.procedure.getName(), edmParameter.getName());
  Integer sqlType = JDBCSQLTypeInfo.getSQLType(DataTypeManager.getDataTypeName(runtimeType));
  Object value = this.parameterValueProvider.getValue(edmParameter, runtimeType);
  this.sqlParameters.add(new SQLParameter(edmParameter.getName(), value, sqlType));
}

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

AbstractMetadataRecord getColumn(String paramName, Procedure proc, boolean parameter) throws MetadataException {
  if (proc.getResultSet() != null) {
    Column result = proc.getResultSet().getColumnByName(paramName);
    if (result != null) {
      return result;
    }
  }
  if (parameter) {
    List<ProcedureParameter> params = proc.getParameters();
    for (ProcedureParameter param:params) {
      if (param.getName().equalsIgnoreCase(paramName)) {
        return param;
      }
    }
  }
  throw new MetadataException(QueryPlugin.Util.getString("SQLParser.alter_procedure_param_doesnot_exist", paramName, proc.getName())); //$NON-NLS-1$
}

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

AbstractMetadataRecord getColumn(String paramName, Procedure proc, boolean parameter) throws MetadataException {
  if (proc.getResultSet() != null) {
    Column result = proc.getResultSet().getColumnByName(paramName);
    if (result != null) {
      return result;
    }
  }
  if (parameter) {
    List<ProcedureParameter> params = proc.getParameters();
    for (ProcedureParameter param:params) {
      if (param.getName().equalsIgnoreCase(paramName)) {
        return param;
      }
    }
  }
  throw new MetadataException(QueryPlugin.Util.getString("SQLParser.alter_procedure_param_doesnot_exist", paramName, proc.getName())); //$NON-NLS-1$
}

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

AbstractMetadataRecord getColumn(String paramName, Procedure proc, boolean parameter) throws MetadataException {
  if (proc.getResultSet() != null) {
    Column result = proc.getResultSet().getColumnByName(paramName);
    if (result != null) {
      return result;
    }
  }
  if (parameter) {
    List<ProcedureParameter> params = proc.getParameters();
    for (ProcedureParameter param:params) {
      if (param.getName().equalsIgnoreCase(paramName)) {
        return param;
      }
    }
  }
  throw new MetadataException(QueryPlugin.Util.getString("SQLParser.alter_procedure_param_doesnot_exist", paramName, proc.getName())); //$NON-NLS-1$
}

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

@Test public void testDuplicateProcedure() {
  ModelMetaData mmd = new ModelMetaData();
  mmd.setName("foo");
  mmd.addProperty("importer.renameAllDuplicates", "true");
  HashMap<String, Datatype> types = new HashMap<String, Datatype>();
  Datatype value = new Datatype();
  value.setName("string");
  types.put("string", value);
  MetadataFactory factory = new MetadataFactory("x", 1, types, mmd);
  Procedure x = factory.addProcedure("x");
  assertEquals("x", x.getName());
  Procedure x1 = factory.addProcedure("X");
  assertEquals("X_1", x1.getName());
  Procedure x2 = factory.addProcedure("X");
  assertEquals("X_2", x2.getName());
}

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

@Test public void testNameFormat() {
  ModelMetaData mmd = new ModelMetaData();
  mmd.setName("foo");
  mmd.addProperty("importer.nameFormat", "x_%s_y");
  HashMap<String, Datatype> types = new HashMap<String, Datatype>();
  MetadataFactory factory = new MetadataFactory("x", 1, types, mmd);
  Table x = factory.addTable("x");
  assertEquals("x_x_y", x.getName());
  
  Procedure p = factory.addProcedure("a%b.c");
  assertEquals("x_a%b.c_y", p.getName());
}

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

@Override
public void visit(AlterProcedure obj) {
  Procedure p = (Procedure)obj.getTarget().getMetadataID();
  String sql = obj.getDefinition().toString();
  if (getMetadataRepository(vdb, p.getParent().getName()) != null) {
    getMetadataRepository(vdb, p.getParent().getName()).setProcedureDefinition(workContext.getVdbName(), workContext.getVdbVersion(), p, sql);
  }
  alterProcedureDefinition(vdb, p, sql, false);
  if (pdm.getEventDistributor() != null) {
    pdm.getEventDistributor().setProcedureDefinition(workContext.getVdbName(), workContext.getVdbVersion(), p.getParent().getName(), p.getName(), sql);
  }
}

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

@Override
public void visit(AlterProcedure obj) {
  Procedure p = (Procedure)obj.getTarget().getMetadataID();
  String sql = obj.getDefinition().toString();
  if (getMetadataRepository(vdb, p.getParent().getName()) != null) {
    getMetadataRepository(vdb, p.getParent().getName()).setProcedureDefinition(workContext.getVdbName(), workContext.getVdbVersion(), p, sql);
  }
  alterProcedureDefinition(vdb, p, sql, false);
  if (pdm.getEventDistributor() != null) {
    pdm.getEventDistributor().setProcedureDefinition(workContext.getVdbName(), workContext.getVdbVersion(), p.getParent().getName(), p.getName(), sql);
  }
}

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

@Override
public void visit(AlterProcedure obj) {
  Procedure p = (Procedure)obj.getTarget().getMetadataID();
  String sql = obj.getDefinition().toString();
  if (getMetadataRepository(vdb, p.getParent().getName()) != null) {
    getMetadataRepository(vdb, p.getParent().getName()).setProcedureDefinition(workContext.getVdbName(), workContext.getVdbVersion(), p, sql);
  }
  alterProcedureDefinition(vdb, p, sql, false);
  if (pdm.getEventDistributor() != null) {
    pdm.getEventDistributor().setProcedureDefinition(workContext.getVdbName(), workContext.getVdbVersion(), p.getParent().getName(), p.getName(), sql);
  }
}

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

private void addProcedureTableReturn(MetadataFactory mf, XMLMetadata metadata, Procedure procedure, 
    CsdlEntityType type, String namePrefix) throws TranslatorException {
  for (CsdlProperty property:type.getProperties()) {
    if (isSimple(property.getType()) || isEnum(metadata, property.getType())) {
      mf.addProcedureResultSetColumn(
          namePrefix == null? property.getName():namePrefix+"_"+property.getName(),
          ODataTypeManager.teiidType(property.getType(), property.isCollection()), procedure);
    }
    else if (isComplexType(metadata, property.getType())) {
      CsdlComplexType childType = getComplexType(metadata, property.getType());
      addProcedureTableReturn(mf, metadata, procedure, childType, property.getName());
    }            
    else {
      throw new TranslatorException(ODataPlugin.Util.gs(
          ODataPlugin.Event.TEIID17023, procedure.getName()));
    }
  }
}

相关文章