diff --git a/src/org/redkale/source/Flipper.java b/src/org/redkale/source/Flipper.java index 829075335..d8a42d7c7 100644 --- a/src/org/redkale/source/Flipper.java +++ b/src/org/redkale/source/Flipper.java @@ -33,7 +33,7 @@ public final class Flipper implements Serializable, Cloneable { } public Flipper(int limit) { - this.limit = limit > 0 ? limit : DEFAULT_LIMIT; + this.limit = limit > 0 ? limit : 0; } public Flipper(String sortColumn) { @@ -41,17 +41,17 @@ public final class Flipper implements Serializable, Cloneable { } public Flipper(int limit, int offset) { - this.limit = limit > 0 ? limit : DEFAULT_LIMIT; + this.limit = limit > 0 ? limit : 0; this.offset = offset < 0 ? 0 : offset; } public Flipper(int limit, String sortColumn) { - this.limit = limit > 0 ? limit : DEFAULT_LIMIT; + this.limit = limit > 0 ? limit : 0; this.sort = sortColumn; } public Flipper(int limit, int offset, String sortColumn) { - this.limit = limit > 0 ? limit : DEFAULT_LIMIT; + this.limit = limit > 0 ? limit : 0; this.offset = offset < 0 ? 0 : offset; this.sort = sortColumn; } @@ -93,9 +93,7 @@ public final class Flipper implements Serializable, Cloneable { } public void setLimit(int limit) { - if (limit > 0) { - this.limit = limit; - } + this.limit = limit; } public Flipper limit(int limit) { @@ -121,9 +119,7 @@ public final class Flipper implements Serializable, Cloneable { } public void setSort(String sort) { - if (sort != null) { - this.sort = sort.trim(); - } + this.sort = sort == null ? "" : sort.trim(); } public Flipper sort(String sort) {