コード例 #1
0
  public void testOrderByDescending() {
    final List<SimpleObject> objects =
        shillelagh.selectFrom(SimpleObject.class).orderBy("customerId").descending().toList();

    int last = Integer.MAX_VALUE;
    for (final SimpleObject simpleObject : objects) {
      assertThat(simpleObject.getCustomerId()).isLessThanOrEqualTo(last);
      last = (int) simpleObject.getCustomerId();
    }
  }
コード例 #2
0
  public void testOrderByAscending() {
    final List<SimpleObject> objects =
        shillelagh.selectFrom(SimpleObject.class).orderBy("customerId").ascending().toList();

    int last = 0;
    for (final SimpleObject simpleObject : objects) {
      assertThat(simpleObject.getCustomerId()).isGreaterThanOrEqualTo(last);
      last = (int) simpleObject.getCustomerId();
    }
  }