diff --git a/sqlhelper-dialect/src/main/java/com/jn/sqlhelper/dialect/internal/limit/AbstractLimitHandler.java b/sqlhelper-dialect/src/main/java/com/jn/sqlhelper/dialect/internal/limit/AbstractLimitHandler.java index 46159c532..092a325ec 100644 --- a/sqlhelper-dialect/src/main/java/com/jn/sqlhelper/dialect/internal/limit/AbstractLimitHandler.java +++ b/sqlhelper-dialect/src/main/java/com/jn/sqlhelper/dialect/internal/limit/AbstractLimitHandler.java @@ -55,7 +55,7 @@ private int bindLimitParameters(RowSelection selection, PreparedStatement statem } long firstRow = convertToFirstRowValue(LimitHelper.getFirstRow(selection)); int lastRow = getMaxOrLimit(selection); - boolean hasFirstRow = (getDialect().isSupportsLimitOffset()) && ((firstRow > 0) || (getDialect().isForceLimitUsage())); + boolean hasFirstRow = getDialect().isSupportsLimitOffset() && ((firstRow > 0) || (getDialect().isForceLimitUsage())); boolean reverse = getDialect().isBindLimitParametersInReverseOrder(); if (hasFirstRow) { statement.setInt(index + (reverse ? 1 : 0), Long.valueOf(firstRow).intValue()); diff --git a/sqlhelper-dialect/src/main/java/com/jn/sqlhelper/dialect/internal/limit/OffsetFetchFirstOnlyLimitHandler.java b/sqlhelper-dialect/src/main/java/com/jn/sqlhelper/dialect/internal/limit/OffsetFetchFirstOnlyLimitHandler.java index ef2db30d1..35cd69fea 100644 --- a/sqlhelper-dialect/src/main/java/com/jn/sqlhelper/dialect/internal/limit/OffsetFetchFirstOnlyLimitHandler.java +++ b/sqlhelper-dialect/src/main/java/com/jn/sqlhelper/dialect/internal/limit/OffsetFetchFirstOnlyLimitHandler.java @@ -28,6 +28,9 @@ * offset ? rows fetch next ? rows only *
* every dialect use the limitHandler should set bindLimitParameterInReverseOrder = false + * + * + * 需要注意的是,offset fetch 通常是在 order by 之后 */ public class OffsetFetchFirstOnlyLimitHandler extends AbstractLimitHandler {