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

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

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

Query.setInto介绍

暂无

代码示例

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

/**
 * This method will alias each of the select into elements to the corresponding column name in the 
 * target table.  This ensures that they will all be uniquely named.
 *  
 * @param query
 * @throws QueryValidatorException
 */
private Command rewriteSelectInto(Query query) throws TeiidProcessingException{
  Into into = query.getInto();
  try {
    List<ElementSymbol> allIntoElements = Util.deepClone(ResolverUtil.resolveElementsInGroup(into.getGroup(), metadata), ElementSymbol.class);
    Insert insert = new Insert(into.getGroup(), allIntoElements, Collections.emptyList());
    insert.setSourceHint(query.getSourceHint());
    query.setSourceHint(null);
    query.setInto(null);
    insert.setQueryExpression(query);
    return rewriteInsert(correctDatatypes(insert));
  } catch (QueryMetadataException e) {
     throw new QueryValidatorException(e);
  } catch (TeiidComponentException e) {
     throw new QueryValidatorException(e);
  }
}

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

/**
 * This method will alias each of the select into elements to the corresponding column name in the 
 * target table.  This ensures that they will all be uniquely named.
 *  
 * @param query
 * @throws QueryValidatorException
 */
private Command rewriteSelectInto(Query query) throws TeiidProcessingException{
  Into into = query.getInto();
  try {
    List<ElementSymbol> allIntoElements = Util.deepClone(ResolverUtil.resolveElementsInGroup(into.getGroup(), metadata), ElementSymbol.class);
    Insert insert = new Insert(into.getGroup(), allIntoElements, Collections.emptyList());
    insert.setSourceHint(query.getSourceHint());
    query.setSourceHint(null);
    query.setInto(null);
    insert.setQueryExpression(query);
    return rewriteInsert(correctDatatypes(insert));
  } catch (QueryMetadataException e) {
     throw new QueryValidatorException(e);
  } catch (TeiidComponentException e) {
     throw new QueryValidatorException(e);
  }
}

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

/**
 * This method will alias each of the select into elements to the corresponding column name in the 
 * target table.  This ensures that they will all be uniquely named.
 *  
 * @param query
 * @throws QueryValidatorException
 */
private Command rewriteSelectInto(Query query) throws TeiidProcessingException{
  Into into = query.getInto();
  try {
    List<ElementSymbol> allIntoElements = Util.deepClone(ResolverUtil.resolveElementsInGroup(into.getGroup(), metadata), ElementSymbol.class);
    Insert insert = new Insert(into.getGroup(), allIntoElements, Collections.emptyList());
    insert.setSourceHint(query.getSourceHint());
    query.setSourceHint(null);
    query.setInto(null);
    insert.setQueryExpression(query);
    return rewriteInsert(correctDatatypes(insert));
  } catch (QueryMetadataException e) {
     throw new QueryValidatorException(e);
  } catch (TeiidComponentException e) {
     throw new QueryValidatorException(e);
  }
}

代码示例来源: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.jboss.teiid/teiid-engine

query.setSelect( select );
query.setFrom( from );
query.setInto( into );
query.setCriteria(criteria);
query.setGroupBy(groupBy);

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

query.setSelect( select );
query.setFrom( from );
query.setInto( into );
query.setCriteria(criteria);
query.setGroupBy(groupBy);

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

query.setSelect( select );
query.setFrom( from );
query.setInto( into );
query.setCriteria(criteria);
query.setGroupBy(groupBy);

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

GroupSymbol intoGroupSymbol = new GroupSymbol(intoGroupName); 
query.setInto(new Into(intoGroupSymbol));

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

@Test public void testSelectInto(){
  GroupSymbol g = new GroupSymbol("m.g"); //$NON-NLS-1$
  From from = new From();
  from.addGroup(g);
  
  Select select = new Select();
  ElementSymbol c1 = new ElementSymbol("c1", false); //$NON-NLS-1$
  select.addSymbol(c1);
  select.addSymbol(new ElementSymbol("c2", false));   //$NON-NLS-1$
  
  Into into = new Into(new GroupSymbol("#temp")); //$NON-NLS-1$
  Query q = new Query();
  q.setSelect(select);
  q.setFrom(from);
  q.setInto(into);
  helpTest("SELECT c1, c2 INTO #temp FROM m.g",  //$NON-NLS-1$
       "SELECT c1, c2 INTO #temp FROM m.g", //$NON-NLS-1$
       q);  
}

相关文章