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

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

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

Query.getOrderBy介绍

暂无

代码示例

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

@Test public void testNumberedOrderBy1_2() throws Exception {
  Query resolvedQuery = (Query) getCommand("SELECT pm1.g1.e1, e2, concat(e3,'x'), concat(e2, 5) FROM pm1.g1 ORDER BY 3, 4, 1, 2"); //$NON-NLS-1$
  helpCheckElements(resolvedQuery.getOrderBy(), 
    new String[] { "pm1.g1.e3", "pm1.g1.e2", "pm1.g1.e1", "pm1.g1.e2" }, //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
    new String[] { "pm1.g1.e3", "pm1.g1.e2", "pm1.g1.e1", "pm1.g1.e2" }); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
  
  helpCheckExpressionsSymbols(resolvedQuery.getOrderBy(),
    new String[] {"concat(convert(e3, string), 'x')", "concat(convert(e2, string), '5')"}); //$NON-NLS-1$ //$NON-NLS-2$
}

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

@Test public void testOrderBy2() throws Exception {
  Query resolvedQuery = (Query) getCommand("SELECT * FROM pm1.g1 ORDER BY e1"); //$NON-NLS-1$
  helpCheckElements(resolvedQuery.getOrderBy(), 
    new String[] { "pm1.g1.e1" }, //$NON-NLS-1$
    new String[] { "pm1.g1.e1" }); //$NON-NLS-1$
}

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

@Test public void testOrderBy4() throws Exception {
  Query resolvedQuery = (Query) getCommand("SELECT e1 FROM pm1.g1 ORDER BY pm1.g1.e1"); //$NON-NLS-1$
  helpCheckElements(resolvedQuery.getOrderBy(), 
    new String[] { "pm1.g1.e1" }, //$NON-NLS-1$
    new String[] { "pm1.g1.e1" }); //$NON-NLS-1$
}

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

@Test public void testOrderBy6() throws Exception {
  Query resolvedQuery = (Query) getCommand("SELECT e1 FROM pm1.g1 AS x ORDER BY e1"); //$NON-NLS-1$
  helpCheckElements(resolvedQuery.getOrderBy(), 
    new String[] { "x.e1" }, //$NON-NLS-1$
    new String[] { "pm1.g1.e1" }); //$NON-NLS-1$
}

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

@Test public void testOrderBy_J658a() {
  Query resolvedQuery = (Query) helpResolve("SELECT pm1.g1.e1, e2, e3 as x, (5+2) as y FROM pm1.g1 ORDER BY e3"); //$NON-NLS-1$
  OrderBy orderBy = resolvedQuery.getOrderBy();
  int[] expectedPositions = new int[] {2};
  helpTestOrderBy(orderBy, expectedPositions);
}

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

@Test public void testOrderBy7() throws Exception {
  Query resolvedQuery = (Query) getCommand("SELECT e1 FROM pm1.g1 AS x ORDER BY x.e1"); //$NON-NLS-1$
  helpCheckElements(resolvedQuery.getOrderBy(), 
    new String[] { "x.e1" }, //$NON-NLS-1$
    new String[] { "pm1.g1.e1" }); //$NON-NLS-1$
}

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

@Test public void testOrderBy8() throws Exception {
  Query resolvedQuery = (Query) getCommand("SELECT x.e1 FROM pm1.g1 AS x ORDER BY e1"); //$NON-NLS-1$
  helpCheckElements(resolvedQuery.getOrderBy(), 
    new String[] { "x.e1" }, //$NON-NLS-1$
    new String[] { "pm1.g1.e1" }); //$NON-NLS-1$
}

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

@Test public void testOrderBy10() throws Exception {
  Query resolvedQuery = (Query) getCommand("SELECT a.e1, b.e1 FROM pm1.g1 AS a, pm1.g1 AS b ORDER BY a.e1"); //$NON-NLS-1$
  helpCheckElements(resolvedQuery.getOrderBy(), 
    new String[] { "a.e1" }, //$NON-NLS-1$
    new String[] { "pm1.g1.e1" }); //$NON-NLS-1$
}

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

@Test public void testOrderBy11() throws Exception {
  Query resolvedQuery = (Query) getCommand("SELECT a.e1, b.e1 FROM pm1.g1 AS a, pm1.g1 AS b ORDER BY b.e1"); //$NON-NLS-1$
  helpCheckElements(resolvedQuery.getOrderBy(), 
    new String[] { "b.e1" }, //$NON-NLS-1$
    new String[] { "pm1.g1.e1" }); //$NON-NLS-1$
}

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

@Test public void testOrderBy13() throws Exception {
  Query resolvedQuery = (Query) getCommand("SELECT a.e1, pm1.g1.e1 FROM pm1.g1 AS a, pm1.g1 ORDER BY pm1.g1.e1"); //$NON-NLS-1$
  helpCheckElements(resolvedQuery.getOrderBy(), 
    new String[] { "pm1.g1.e1" }, //$NON-NLS-1$
    new String[] { "pm1.g1.e1" }); //$NON-NLS-1$
}

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

/**
 * partially-qualified ORDER BY's with ambiguous short group names
 */
@Test public void testDefect10729() throws Exception {
  Query resolvedQuery = (Query) getCommand("SELECT pm1.g1.e1 FROM pm1.g1 ORDER BY g1.e1"); //$NON-NLS-1$
  helpCheckElements(resolvedQuery.getOrderBy(), 
    new String[] { "pm1.g1.e1" }, //$NON-NLS-1$ 
    new String[] { "pm1.g1.e1" } ); //$NON-NLS-1$ 
}

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

@Test public void testNumberedOrderBy1_4() throws Exception {
  String sql = "select e1, (select e2 from pm4.g1) from pm4.g2 X order by 2"; //$NON-NLS-1$
  Query resolvedQuery = (Query) getCommand(sql); 
  
  helpCheckExpressionsSymbols(resolvedQuery.getOrderBy(),
      new String[] {"(SELECT e2 FROM pm4.g1 LIMIT 2)"}); //$NON-NLS-1$        
}

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

@Test public void testOrderBy1() throws Exception {
  Query resolvedQuery = (Query) getCommand("SELECT pm1.g1.e1, e2, e3 as x, (5+2) as y FROM pm1.g1 ORDER BY x, y, pm1.g1.e1, e2"); //$NON-NLS-1$
  helpCheckElements(resolvedQuery.getOrderBy(), 
    new String[] { "pm1.g1.e3", "pm1.g1.e1", "pm1.g1.e2" }, //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
    new String[] { "pm1.g1.e3", "pm1.g1.e1", "pm1.g1.e2" }); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
}

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

@Test public void testOrderBy5() throws Exception {
  Query resolvedQuery = (Query) getCommand("SELECT e1 FROM pm1.g1 ORDER BY e1"); //$NON-NLS-1$
  helpCheckElements(resolvedQuery.getOrderBy(), 
    new String[] { "pm1.g1.e1" }, //$NON-NLS-1$
    new String[] { "pm1.g1.e1" }); //$NON-NLS-1$
}

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

@Test public void testOrderBy14() throws Exception {
  Query resolvedQuery = (Query) getCommand("SELECT a.e1 as x, pm1.g1.e1 as y FROM pm1.g1 AS a, pm1.g1 ORDER BY x"); //$NON-NLS-1$
  helpCheckElements(resolvedQuery.getOrderBy(), 
    new String[] { "a.e1" }, //$NON-NLS-1$
    new String[] { "pm1.g1.e1" }); //$NON-NLS-1$
}

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

@Test public void testOrderBy15() throws Exception {
  Query resolvedQuery = (Query) getCommand("SELECT a.e1 as x, pm1.g1.e1 as y FROM pm1.g1 AS a, pm1.g1 ORDER BY y"); //$NON-NLS-1$
  helpCheckElements(resolvedQuery.getOrderBy(), 
    new String[] { "pm1.g1.e1" }, //$NON-NLS-1$
    new String[] { "pm1.g1.e1" }); //$NON-NLS-1$
}

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

@Test public void testNumberedOrderBy4() throws Exception {
  Query resolvedQuery = (Query) getCommand("SELECT e1 FROM pm1.g1 ORDER BY 1"); //$NON-NLS-1$
  helpCheckElements(resolvedQuery.getOrderBy(), 
    new String[] { "pm1.g1.e1" }, //$NON-NLS-1$
    new String[] { "pm1.g1.e1" }); //$NON-NLS-1$
}

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

@Test public void testNumberedOrderBy8() throws Exception {
  Query resolvedQuery = (Query) getCommand("SELECT a.e1 as x, pm1.g1.e1 as y FROM pm1.g1 AS a, pm1.g1 ORDER BY 1"); //$NON-NLS-1$
  helpCheckElements(resolvedQuery.getOrderBy(), 
    new String[] { "a.e1" }, //$NON-NLS-1$
    new String[] { "pm1.g1.e1" }); //$NON-NLS-1$
}

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

/**
 * partially-qualified ORDER BY's with ambiguous short group names
 */
@Test public void testDefect10729a() throws Exception {
  Query resolvedQuery = (Query) getCommand("SELECT pm1.g1.e1 FROM pm1.g1 ORDER BY e1"); //$NON-NLS-1$
  helpCheckElements(resolvedQuery.getOrderBy(), 
    new String[] { "pm1.g1.e1" }, //$NON-NLS-1$ 
    new String[] { "pm1.g1.e1" } ); //$NON-NLS-1$ 
}

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

@Test public void testOrderBy_J658b() {
  Query resolvedQuery = (Query) helpResolve("SELECT pm1.g1.e1, e2, e3 as x, (5+2) as y FROM pm1.g1 ORDER BY e2, e3 "); //$NON-NLS-1$
  helpTestOrderBy(resolvedQuery.getOrderBy(), new int[] {1, 2});
}
@Test public void testOrderBy_J658c() {

相关文章