org.geoserver.monitor.Query.sort()方法的使用及代码示例

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

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

Query.sort介绍

暂无

代码示例

代码示例来源:origin: org.geoserver.extension/monitor-hibernate

@Test
public void testGetRequestsJoin() throws Exception {
  List<RequestData> datas = dao.getRequests(new Query().properties("path", "resource")
    .filter("path","/foo", Comparison.EQ). group("path", "resource")
    .sort("resource", SortOrder.ASC));
  
  assertEquals(3, datas.size());
  assertEquals("stuff", datas.get(0).getResources().get(0));
  assertEquals("things", datas.get(1).getResources().get(0));
  assertEquals("widgets", datas.get(2).getResources().get(0));
}
@Test

代码示例来源:origin: org.geoserver.extension/monitor-hibernate

@Test
public void testGetRequestsJoinIN() throws Exception {
  List<String> resources = Arrays.asList("widgets", "things");
  List<RequestData> datas = dao.getRequests(new Query().properties("resource")
    .aggregate("count()").filter("resource", resources, Comparison.IN)
    .group("resource").sort("resource", SortOrder.ASC));
  
  assertEquals(2, datas.size());
  assertEquals("things", datas.get(0).getResources().get(0));
  assertEquals("widgets", datas.get(1).getResources().get(0));
}

代码示例来源:origin: org.geoserver.extension/monitor-hibernate

@Test
public void testGetRequestsJoinVisitor() throws Exception {
  final List<RequestData> datas = new ArrayList();
  final List<Object> aggs = new ArrayList();
  
  RequestDataVisitor v = new RequestDataVisitor() {
    public void visit(RequestData data, Object... aggregates) {
      datas.add(data);
      //aggs.addAll(Arrays.asList(aggregates));
    }
  };
  dao.getRequests(new Query().properties("path", "resource").filter("path","/foo", Comparison.EQ).
      group("path", "resource").sort("resource", SortOrder.ASC), v);
  
  assertEquals(3, datas.size());
  assertEquals(1, datas.get(0).getResources().size());
  assertEquals("stuff", datas.get(0).getResources().get(0));
  assertEquals(1, datas.get(1).getResources().size());
  assertEquals("things", datas.get(1).getResources().get(0));
  assertEquals(1, datas.get(2).getResources().size());
  assertEquals("widgets", datas.get(2).getResources().get(0));
}

代码示例来源:origin: org.geoserver.extension/monitor-hibernate

.group("service", "operation").sort("count()", SortOrder.DESC), v);

代码示例来源:origin: org.geoserver.extension/monitor-core

@Test
public void testGetRequestsSorted() throws Exception {
  assertCoveredInOrder(dao.getRequests(new Query().filter("id", 11l, Comparison.LT)
      .sort("path", SortOrder.ASC)),  8, 5, 4, 9, 1, 7, 6, 10, 3, 2);
}

代码示例来源:origin: org.geoserver.extension/monitor-core

@Test
public void testGetRequestsPaged() throws Exception {
  List<RequestData> datas = dao.getRequests(
    new Query().page(5l, 2l).sort("startTime", SortOrder.ASC));
  
  assertCoveredInOrder(datas, 6, 7);
}

代码示例来源:origin: org.geoserver.extension/gs-monitor-core

@Test
public void testGetRequestsPaged() throws Exception {
  List<RequestData> datas =
      dao.getRequests(new Query().page(5l, 2l).sort("startTime", SortOrder.ASC));
  assertCoveredInOrder(datas, 6, 7);
}

代码示例来源:origin: org.geoserver.extension/gs-monitor-core

@Test
public void testGetRequestsSorted() throws Exception {
  assertCoveredInOrder(
      dao.getRequests(
          new Query().filter("id", 11l, Comparison.LT).sort("path", SortOrder.ASC)),
      8,
      5,
      4,
      9,
      1,
      7,
      6,
      10,
      3,
      2);
}

代码示例来源:origin: org.geoserver.extension/monitor-core

@Test
public void testGetRequestsBetween2() throws Exception {
  //test that the query is inclusive, and test sorting
  List<RequestData> datas = dao.getRequests(new Query().between(
    toDate("2010-07-23T15:56:44"), toDate("2010-07-23T16:16:44"))
    .sort("startTime", SortOrder.ASC));
  
  assertCoveredInOrder(datas, 4, 5, 6);
}

代码示例来源:origin: org.geoserver.extension/gs-monitor-core

@Test
public void testGetRequestsBetween2() throws Exception {
  // test that the query is inclusive, and test sorting
  List<RequestData> datas =
      dao.getRequests(
          new Query()
              .between(
                  toDate("2010-07-23T15:56:44"),
                  toDate("2010-07-23T16:16:44"))
              .sort("startTime", SortOrder.ASC));
  assertCoveredInOrder(datas, 4, 5, 6);
}

相关文章