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

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

本文整理了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

  1. /**
  2. * This method will alias each of the select into elements to the corresponding column name in the
  3. * target table. This ensures that they will all be uniquely named.
  4. *
  5. * @param query
  6. * @throws QueryValidatorException
  7. */
  8. private Command rewriteSelectInto(Query query) throws TeiidProcessingException{
  9. Into into = query.getInto();
  10. try {
  11. List<ElementSymbol> allIntoElements = Util.deepClone(ResolverUtil.resolveElementsInGroup(into.getGroup(), metadata), ElementSymbol.class);
  12. Insert insert = new Insert(into.getGroup(), allIntoElements, Collections.emptyList());
  13. insert.setSourceHint(query.getSourceHint());
  14. query.setSourceHint(null);
  15. query.setInto(null);
  16. insert.setQueryExpression(query);
  17. return rewriteInsert(correctDatatypes(insert));
  18. } catch (QueryMetadataException e) {
  19. throw new QueryValidatorException(e);
  20. } catch (TeiidComponentException e) {
  21. throw new QueryValidatorException(e);
  22. }
  23. }

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

  1. /**
  2. * This method will alias each of the select into elements to the corresponding column name in the
  3. * target table. This ensures that they will all be uniquely named.
  4. *
  5. * @param query
  6. * @throws QueryValidatorException
  7. */
  8. private Command rewriteSelectInto(Query query) throws TeiidProcessingException{
  9. Into into = query.getInto();
  10. try {
  11. List<ElementSymbol> allIntoElements = Util.deepClone(ResolverUtil.resolveElementsInGroup(into.getGroup(), metadata), ElementSymbol.class);
  12. Insert insert = new Insert(into.getGroup(), allIntoElements, Collections.emptyList());
  13. insert.setSourceHint(query.getSourceHint());
  14. query.setSourceHint(null);
  15. query.setInto(null);
  16. insert.setQueryExpression(query);
  17. return rewriteInsert(correctDatatypes(insert));
  18. } catch (QueryMetadataException e) {
  19. throw new QueryValidatorException(e);
  20. } catch (TeiidComponentException e) {
  21. throw new QueryValidatorException(e);
  22. }
  23. }

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

  1. /**
  2. * This method will alias each of the select into elements to the corresponding column name in the
  3. * target table. This ensures that they will all be uniquely named.
  4. *
  5. * @param query
  6. * @throws QueryValidatorException
  7. */
  8. private Command rewriteSelectInto(Query query) throws TeiidProcessingException{
  9. Into into = query.getInto();
  10. try {
  11. List<ElementSymbol> allIntoElements = Util.deepClone(ResolverUtil.resolveElementsInGroup(into.getGroup(), metadata), ElementSymbol.class);
  12. Insert insert = new Insert(into.getGroup(), allIntoElements, Collections.emptyList());
  13. insert.setSourceHint(query.getSourceHint());
  14. query.setSourceHint(null);
  15. query.setInto(null);
  16. insert.setQueryExpression(query);
  17. return rewriteInsert(correctDatatypes(insert));
  18. } catch (QueryMetadataException e) {
  19. throw new QueryValidatorException(e);
  20. } catch (TeiidComponentException e) {
  21. throw new QueryValidatorException(e);
  22. }
  23. }

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

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

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

  1. query.setSelect( select );
  2. query.setFrom( from );
  3. query.setInto( into );
  4. query.setCriteria(criteria);
  5. query.setGroupBy(groupBy);

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

  1. query.setSelect( select );
  2. query.setFrom( from );
  3. query.setInto( into );
  4. query.setCriteria(criteria);
  5. query.setGroupBy(groupBy);

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

  1. query.setSelect( select );
  2. query.setFrom( from );
  3. query.setInto( into );
  4. query.setCriteria(criteria);
  5. query.setGroupBy(groupBy);

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

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

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

  1. @Test public void testSelectInto(){
  2. GroupSymbol g = new GroupSymbol("m.g"); //$NON-NLS-1$
  3. From from = new From();
  4. from.addGroup(g);
  5. Select select = new Select();
  6. ElementSymbol c1 = new ElementSymbol("c1", false); //$NON-NLS-1$
  7. select.addSymbol(c1);
  8. select.addSymbol(new ElementSymbol("c2", false)); //$NON-NLS-1$
  9. Into into = new Into(new GroupSymbol("#temp")); //$NON-NLS-1$
  10. Query q = new Query();
  11. q.setSelect(select);
  12. q.setFrom(from);
  13. q.setInto(into);
  14. helpTest("SELECT c1, c2 INTO #temp FROM m.g", //$NON-NLS-1$
  15. "SELECT c1, c2 INTO #temp FROM m.g", //$NON-NLS-1$
  16. q);
  17. }

相关文章