public void testLimitOnly() throws Exception {
   String expected = "select * from emp order by emp.id limit 10";
   H2PagingTransformer transformer = new H2PagingTransformer(-1, 10);
   SqlParser parser = new SqlParser("select * from emp order by emp.id");
   SqlNode sqlNode = transformer.transform(parser.parse());
   NodePreparedSqlBuilder sqlBuilder =
       new NodePreparedSqlBuilder(new MockConfig(), SqlKind.SELECT, "dummyPath");
   PreparedSql sql = sqlBuilder.build(sqlNode);
   assertEquals(expected, sql.getRawSql());
 }
Exemple #2
0
 @Override
 public String toString() {
   return sql != null ? sql.toString() : null;
 }