org.teiid.query.sql.lang.Query.clone()方法的使用及代码示例

x33g5p2x  于2022-01-29 转载在 其他  
字(5.2k)|赞(0)|评价(0)|浏览(468)

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

Query.clone介绍

[英]Deep clone Query to produce a new identical query.
[中]深度克隆查询以生成新的相同查询。

代码示例

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

public void testClone() {    
  Query q = sample2();
  Query qclone = (Query)q.clone();
  int equals = 0;
  UnitTestUtil.helpTestEquivalence(equals, q, qclone);
}

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

plannedResult.query = (Query)plannedResult.query.clone();
for (Command c : CommandCollectorVisitor.getCommands(plannedResult.query)) {

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

@Test public void testSubqueryAliasWithPeriod() throws Exception {
  String sql = "select \"pm1.g2\".x from (select 1 as x) as \"pm1.g2\"";
  Query query = (Query)helpResolve(sql);
  SubqueryFromClause sfc = (SubqueryFromClause)query.getFrom().getClauses().get(0);
  GroupSymbol gs = sfc.getGroupSymbol();
  assertEquals("pm1.g2", gs.getName());
  assertNull(gs.getDefinition());
  assertEquals("SELECT \"pm1.g2\".x FROM (SELECT 1 AS x) AS \"pm1.g2\"", query.toString());
  assertEquals("SELECT \"pm1.g2\".x FROM (SELECT 1 AS x) AS \"pm1.g2\"", query.clone().toString());
  assertEquals("[\"pm1.g2\".x]", query.getProjectedSymbols().toString());
}

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

public void testClone3() {
    Query q = sample2();
    q.setInto(new Into(new GroupSymbol("#foo"))); //$NON-NLS-1$
    Query qclone = (Query)q.clone();
    assertNotNull(qclone.getInto());
  }
}

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

plannedResult.query = (Query)plannedResult.query.clone();
for (Command c : CommandCollectorVisitor.getCommands(plannedResult.query)) {

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

plannedResult.query = (Query)plannedResult.query.clone();
for (Command c : CommandCollectorVisitor.getCommands(plannedResult.query)) {

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

@Test public void testNestedViewAliasing() throws Exception {
  String sql = "select e1, e2 from (select y.e1, y.e2 from (select pm1.g1.e1, 1 as e2 from pm1.g1) y) z"; //$NON-NLS-1$
  Query command = (Query)QueryParser.getQueryParser().parseCommand(sql);
  QueryResolver.resolveCommand(command, RealMetadataFactory.example1Cached());
  command = (Query) command.clone();
  command.acceptVisitor(new AliasGenerator(true));
  assertEquals("SELECT v_1.c_0, v_1.c_1 FROM (SELECT v_0.c_0, v_0.c_1 FROM (SELECT g_0.e1 AS c_0, 1 AS c_1 FROM pm1.g1 AS g_0) AS v_0) AS v_1", command.toString()); //$NON-NLS-1$
}

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

stagableQuery = (Query)stagableQuery.clone();
  String parentName = parent.getNonCorrelationName();
stagableQuery = (Query)stagableQuery.clone();

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

q.setFrom(new From(Arrays.asList(new UnaryFromClause(temp))));
insert.setQueryExpression((QueryCommand) q.clone());
insert.addTag(WRITE_THROUGH); 
block.addStatement(new CommandStatement(insert));
  LoopStatement loop = new LoopStatement(b, (Query)q.clone(), "x"); //$NON-NLS-1$
  StoredProcedure sp = new StoredProcedure();
  sp.setProcedureName("SYSAdmin.refreshMatViewRow"); //$NON-NLS-1$

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

q.setFrom(new From(Arrays.asList(new UnaryFromClause(temp))));
insert.setQueryExpression((QueryCommand) q.clone());
insert.addTag(WRITE_THROUGH); 
block.addStatement(new CommandStatement(insert));
  LoopStatement loop = new LoopStatement(b, (Query)q.clone(), "x"); //$NON-NLS-1$
  StoredProcedure sp = new StoredProcedure();
  sp.setProcedureName("SYSAdmin.refreshMatViewRow"); //$NON-NLS-1$

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

q.setFrom(new From(Arrays.asList(new UnaryFromClause(temp))));
insert.setQueryExpression((QueryCommand) q.clone());
insert.addTag(WRITE_THROUGH); 
block.addStatement(new CommandStatement(insert));
  LoopStatement loop = new LoopStatement(b, (Query)q.clone(), "x"); //$NON-NLS-1$
  StoredProcedure sp = new StoredProcedure();
  sp.setProcedureName("SYSAdmin.refreshMatViewRow"); //$NON-NLS-1$

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

Query query = (Query)info.getViewDefinition().clone();
query.setOrderBy(null);
SymbolMap expressionMapping = SymbolMap.createSymbolMap(update.getGroup(), query.getProjectedSymbols(), metadata);

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

Query query = (Query)info.getViewDefinition().clone();
query.setOrderBy(null);
SymbolMap expressionMapping = SymbolMap.createSymbolMap(update.getGroup(), query.getProjectedSymbols(), metadata);

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

Query query = (Query)info.getViewDefinition().clone();
query.setOrderBy(null);
SymbolMap expressionMapping = SymbolMap.createSymbolMap(update.getGroup(), query.getProjectedSymbols(), metadata);

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

Query query = (Query)info.getViewDefinition().clone();
query.setOrderBy(null);
SymbolMap expressionMapping = SymbolMap.createSymbolMap(delete.getGroup(), query.getProjectedSymbols(), metadata);

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

Query query = (Query)info.getViewDefinition().clone();
query.setOrderBy(null);
SymbolMap expressionMapping = SymbolMap.createSymbolMap(delete.getGroup(), query.getProjectedSymbols(), metadata);

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

Query query = (Query)info.getViewDefinition().clone();
query.setOrderBy(null);
SymbolMap expressionMapping = SymbolMap.createSymbolMap(delete.getGroup(), query.getProjectedSymbols(), metadata);

相关文章