	@Test
	public void testSearchBySQLWithPager() throws SQLException, RichSQLException {

		IntStream.rangeClosed(1, 10).forEach(i -> {
			try {
				this.orm.insert(Member.class).value("name", "m" + i)
					.executeSelect();
			} catch (Exception e) {
				throw new RuntimeException(e);
			}
		});

		{
			Paginated<Member> paginated = this.orm.searchBySQLWithPager(
				Member.class, "SELECT * FROM `member` ORDER BY id DESC",
				Collections.emptyList(), 4);
			assertEquals(paginated.getRows().size(), 4);
			assertEquals(paginated.getEntriesPerPage(), 4);
			assertEquals(paginated.getHasNextPage(), true);
			assertEquals("10,9,8,7", paginated.getRows().stream()
				.map(row -> "" + row.getId())
				.collect(Collectors.joining(",")));
		}
		{
			Paginated<Member> paginated = this.orm.searchBySQLWithPager(
				Member.class,
				"SELECT * FROM `member` WHERE id<7 ORDER BY id DESC",
				Collections.emptyList(), 4);
			assertEquals(paginated.getRows().size(), 4);
			assertEquals(paginated.getEntriesPerPage(), 4);
			assertEquals(paginated.getHasNextPage(), true);
			assertEquals("6,5,4,3", paginated.getRows().stream()
				.map(row -> "" + row.getId())
				.collect(Collectors.joining(",")));
		}
		{
			Paginated<Member> paginated = this.orm.searchBySQLWithPager(
				Member.class,
				"SELECT * FROM `member` WHERE id<? ORDER BY id DESC",
				Arrays.asList(3), 4);
			assertEquals(paginated.getRows().size(), 2);
			assertEquals(paginated.getEntriesPerPage(), 4);
			assertEquals(paginated.getHasNextPage(), false);
			assertEquals("2,1", paginated.getRows().stream()
				.map(row -> "" + row.getId())
				.collect(Collectors.joining(",")));
		}
		{
			Paginated<Member> paginated = this.orm.searchBySQLWithPager(
				Member.class,
				"SELECT * FROM `member` WHERE id<? ORDER BY id DESC",
				Arrays.asList(3), 10);
			assertEquals(paginated.getRows().size(), 2);
			assertEquals(paginated.getEntriesPerPage(), 10);
			assertEquals(paginated.getHasNextPage(), false);
			assertEquals("2,1", paginated.getRows().stream()
				.map(row -> "" + row.getId())
				.collect(Collectors.joining(",")));
		}
	}