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

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

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

Procedure.setQueryPlan介绍

暂无

代码示例

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

public void setProcedureDefinition(final String procedureName, final String definition, boolean updateFunctional) {
  if (!assertInEditMode(Mode.SCHEMA)) {
    return;
  }
  Procedure procedure = verifyProcedureExists(procedureName);
  
  assertGrant(Grant.Permission.Privilege.CREATE, Database.ResourceType.PROCEDURE, procedure);
  
  procedure.setQueryPlan(definition);
}

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

public static void alterProcedureDefinition(final VDBMetaData vdb, final Procedure p, final String sql, boolean updateStore) {
  TransformationMetadata metadata = vdb.getAttachment(TransformationMetadata.class);
  DatabaseStore store = vdb.getAttachment(DatabaseStore.class);
  
  try {
    Command command = QueryParser.getQueryParser().parseProcedure(p.getQueryPlan(), false);
    QueryResolver.resolveCommand(command, new GroupSymbol(p.getFullName()), Command.TYPE_STORED_PROCEDURE, metadata, false);
    MetadataValidator.determineDependencies(p, command);
  } catch (TeiidException e) {
    //should have been caught in validation, but this logic
    //is also not mature so since there is no lock on the vdb
    //it is possible that the plan is no longer valid at this point due
    //to a concurrent execution
  }
  p.setQueryPlan(sql);
  p.setLastModified(System.currentTimeMillis());
  metadata.addToMetadataCache(p, "transformation/"+StoredProcedure.class.getSimpleName().toUpperCase(), null); //$NON-NLS-1$
}

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

public static void alterProcedureDefinition(final VDBMetaData vdb, final Procedure p, final String sql, boolean updateStore) {
  TransformationMetadata metadata = vdb.getAttachment(TransformationMetadata.class);
  DatabaseStore store = vdb.getAttachment(DatabaseStore.class);
  
  try {
    Command command = QueryParser.getQueryParser().parseProcedure(p.getQueryPlan(), false);
    QueryResolver.resolveCommand(command, new GroupSymbol(p.getFullName()), Command.TYPE_STORED_PROCEDURE, metadata, false);
    MetadataValidator.determineDependencies(p, command);
  } catch (TeiidException e) {
    //should have been caught in validation, but this logic
    //is also not mature so since there is no lock on the vdb
    //it is possible that the plan is no longer valid at this point due
    //to a concurrent execution
  }
  p.setQueryPlan(sql);
  p.setLastModified(System.currentTimeMillis());
  metadata.addToMetadataCache(p, "transformation/"+StoredProcedure.class.getSimpleName().toUpperCase(), null); //$NON-NLS-1$
}

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

public static void alterProcedureDefinition(final VDBMetaData vdb, final Procedure p, final String sql, boolean updateStore) {
  TransformationMetadata metadata = vdb.getAttachment(TransformationMetadata.class);
  DatabaseStore store = vdb.getAttachment(DatabaseStore.class);
  
  try {
    Command command = QueryParser.getQueryParser().parseProcedure(p.getQueryPlan(), false);
    QueryResolver.resolveCommand(command, new GroupSymbol(p.getFullName()), Command.TYPE_STORED_PROCEDURE, metadata, false);
    MetadataValidator.determineDependencies(p, command);
  } catch (TeiidException e) {
    //should have been caught in validation, but this logic
    //is also not mature so since there is no lock on the vdb
    //it is possible that the plan is no longer valid at this point due
    //to a concurrent execution
  }
  p.setQueryPlan(sql);
  p.setLastModified(System.currentTimeMillis());
  metadata.addToMetadataCache(p, "transformation/"+StoredProcedure.class.getSimpleName().toUpperCase(), null); //$NON-NLS-1$
}

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

public void setProcedureDefinition(final String procedureName, final String definition) {
  if (!assertInEditMode(Mode.SCHEMA)) {
    return;
  }
  Procedure procedure = (Procedure)getSchemaRecord(procedureName, ResourceType.PROCEDURE);
  
  assertGrant(Grant.Permission.Privilege.ALTER, Database.ResourceType.PROCEDURE, procedure);
  
  if (!procedure.isVirtual()) {
    throw new org.teiid.metadata.MetadataException(QueryPlugin.Event.TEIID31238,
        QueryPlugin.Util.gs(QueryPlugin.Event.TEIID31238, procedure.getFullName()));
  }
  
  procedure.setQueryPlan(definition);
}

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

public void setProcedureDefinition(final String procedureName, final String definition) {
  if (!assertInEditMode(Mode.SCHEMA)) {
    return;
  }
  Procedure procedure = (Procedure)getSchemaRecord(procedureName, ResourceType.PROCEDURE);
  
  assertGrant(Grant.Permission.Privilege.ALTER, Database.ResourceType.PROCEDURE, procedure);
  
  if (!procedure.isVirtual()) {
    throw new org.teiid.metadata.MetadataException(QueryPlugin.Event.TEIID31238,
        QueryPlugin.Util.gs(QueryPlugin.Event.TEIID31238, procedure.getFullName()));
  }
  
  procedure.setQueryPlan(definition);
}

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

/**
 * Create virtual sotred procedure.
 * @param name Name of stored query, must match model name
 * @param model Metadata object for the model
 * @param params List of FakeMetadataObject that are the parameters for the procedure
 * @param queryPlan Object representing query plan
 * @return Metadata object for stored procedure
 */
public static Procedure createVirtualProcedure(String name, Schema model, List<ProcedureParameter> params, QueryNode queryPlan) {
  Procedure proc = createStoredProcedure(name, model, params);
  proc.setVirtual(true);
  proc.setQueryPlan(queryPlan.getQuery());
  return proc;
}

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

String proc = this.getProcedureDefinition(vdbName, vdbVersion, p);
if (proc != null) {
  p.setQueryPlan(proc);

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

TransformationRecordImpl transformRecord = (TransformationRecordImpl)getRecordByType(procedureRecord.getUUID(), MetadataConstants.RECORD_TYPE.PROC_TRANSFORM, false);
if(transformRecord != null) {
  procedureRecord.setQueryPlan(transformRecord.getTransformation());

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

TransformationRecordImpl transformRecord = (TransformationRecordImpl)getRecordByType(procedureRecord.getUUID(), MetadataConstants.RECORD_TYPE.PROC_TRANSFORM, false);
if(transformRecord != null) {
  procedureRecord.setQueryPlan(transformRecord.getTransformation());

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

{if (true) throw new MetadataException(QueryPlugin.Util.getString("SQLParser.function_def", procName));}
proc.setQueryPlan((comment != null?comment.image+" ":"") + stmt.toString());

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

{if (true) throw new MetadataException(QueryPlugin.Util.getString("SQLParser.function_def", procName));}
proc.setQueryPlan((comment != null?comment.image+" ":"") + stmt.toString());

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

{if (true) throw new MetadataException(QueryPlugin.Util.getString("SQLParser.function_def", procName));}
proc.setQueryPlan((comment != null?comment.image+" ":"") + stmt.toString());

相关文章