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

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

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

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

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

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

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

  1. @Test
  2. public void testGetRequestsJoinVisitor() throws Exception {
  3. final List<RequestData> datas = new ArrayList();
  4. final List<Object> aggs = new ArrayList();
  5. RequestDataVisitor v = new RequestDataVisitor() {
  6. public void visit(RequestData data, Object... aggregates) {
  7. datas.add(data);
  8. //aggs.addAll(Arrays.asList(aggregates));
  9. }
  10. };
  11. dao.getRequests(new Query().properties("path", "resource").filter("path","/foo", Comparison.EQ).
  12. group("path", "resource").sort("resource", SortOrder.ASC), v);
  13. assertEquals(3, datas.size());
  14. assertEquals(1, datas.get(0).getResources().size());
  15. assertEquals("stuff", datas.get(0).getResources().get(0));
  16. assertEquals(1, datas.get(1).getResources().size());
  17. assertEquals("things", datas.get(1).getResources().get(0));
  18. assertEquals(1, datas.get(2).getResources().size());
  19. assertEquals("widgets", datas.get(2).getResources().get(0));
  20. }

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

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

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

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

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

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

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

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

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

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

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

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

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

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

相关文章