SQLServerDialect extends Dialect { public String getLimitString(String sql, int offset, int limit) { return getLimitString(sql,offset,null,limit,null); }  boolean supportsLimitOffset(); boolean supportsLimit(); String getLimitString(String sql, int offset, int limit); String getLimitString(String querySelect, int offset,String offsetPlaceholder, int limit, String limitPlaceholder);  }
@Test public void getLimitString() { Assert.assertEquals("select top 0 * from user", dialect.getLimitString("select * from user", 0, 0)); Assert.assertEquals("select top 12 * from user", dialect.getLimitString("select * from user", 0, 12)); }
@Test(expected=UnsupportedOperationException.class) public void getLimitStringWithException1() { Assert.assertEquals("", dialect.getLimitString("select * from user", 12, 0)); }
@Test(expected=UnsupportedOperationException.class) public void getLimitStringWithException2() { Assert.assertEquals("", dialect.getLimitString("select * from user", 12, 34)); }
@Test public void getLimitStringWithPlaceHolader() { String OFFSET = ":offset"; String LIMIT = ":limit"; Assert.assertEquals("select top 0 * from user", dialect.getLimitString("select * from user", 0,OFFSET, 0,LIMIT)); Assert.assertEquals("select top 12 * from user", dialect.getLimitString("select * from user", 0,OFFSET,12,LIMIT)); }