本文整理了Java中org.teiid.metadata.Procedure.setQueryPlan()
方法的一些代码示例,展示了Procedure.setQueryPlan()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Procedure.setQueryPlan()
方法的具体详情如下:
包路径:org.teiid.metadata.Procedure
类名称: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());
内容来源于网络,如有侵权,请联系作者删除!