From 91e93fd617630dd5a3514fadac78e0f16eef39d8 Mon Sep 17 00:00:00 2001 From: Yoryos Valotasios Date: Tue, 23 Nov 2010 00:22:39 +0200 Subject: [PATCH] Added some comments --- .../main/java/org/hibernate/dialect/SQLServer2005Dialect.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/core/src/main/java/org/hibernate/dialect/SQLServer2005Dialect.java b/core/src/main/java/org/hibernate/dialect/SQLServer2005Dialect.java index f0fefab7b1..1a538eb4ad 100644 --- a/core/src/main/java/org/hibernate/dialect/SQLServer2005Dialect.java +++ b/core/src/main/java/org/hibernate/dialect/SQLServer2005Dialect.java @@ -59,11 +59,13 @@ public class SQLServer2005Dialect extends SQLServerDialect { @Override public int convertToFirstRowValue(int zeroBasedFirstResult) { - return zeroBasedFirstResult + 1; + // Our dialect isn't zero based. The first row should get the number 1 + return zeroBasedFirstResult + 1; } @Override public String getLimitString(String query, int offset, int limit) { + // We transform the query to one with an offset and limit if we have an offset and limit to bind if (offset > 1 || limit > 1) return getLimitString(query, true); return query; }