This commit is contained in:
@@ -40,6 +40,11 @@ public final class Flipper implements Serializable, Cloneable {
|
|||||||
this.offset = offset < 0 ? 0 : offset;
|
this.offset = offset < 0 ? 0 : offset;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public Flipper(int limit, String sortColumn) {
|
||||||
|
this.limit = limit > 0 ? limit : DEFAULT_LIMIT;
|
||||||
|
this.sort = sortColumn;
|
||||||
|
}
|
||||||
|
|
||||||
public Flipper(int limit, int offset, String sortColumn) {
|
public Flipper(int limit, int offset, String sortColumn) {
|
||||||
this.limit = limit > 0 ? limit : DEFAULT_LIMIT;
|
this.limit = limit > 0 ? limit : DEFAULT_LIMIT;
|
||||||
this.offset = offset < 0 ? 0 : offset;
|
this.offset = offset < 0 ? 0 : offset;
|
||||||
|
|||||||
@@ -80,6 +80,18 @@ public class SelectColumn implements Predicate<String> {
|
|||||||
return new SelectColumn(columns, false);
|
return new SelectColumn(columns, false);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* class中的字段名
|
||||||
|
*
|
||||||
|
* @param cols 包含的字段名集合
|
||||||
|
* @param columns 包含的字段名集合
|
||||||
|
*
|
||||||
|
* @return SelectColumn
|
||||||
|
*/
|
||||||
|
public static SelectColumn createIncludes(String[] cols, String... columns) {
|
||||||
|
return new SelectColumn(Utility.append(cols, columns), false);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* class中的字段名
|
* class中的字段名
|
||||||
*
|
*
|
||||||
@@ -91,6 +103,18 @@ public class SelectColumn implements Predicate<String> {
|
|||||||
return new SelectColumn(columns, true);
|
return new SelectColumn(columns, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* class中的字段名
|
||||||
|
*
|
||||||
|
* @param cols 排除的字段名集合
|
||||||
|
* @param columns 排除的字段名集合
|
||||||
|
*
|
||||||
|
* @return SelectColumn
|
||||||
|
*/
|
||||||
|
public static SelectColumn createExcludes(String[] cols, String... columns) {
|
||||||
|
return new SelectColumn(Utility.append(cols, columns), true);
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean test(final String column) {
|
public boolean test(final String column) {
|
||||||
if (this.columns != null) {
|
if (this.columns != null) {
|
||||||
|
|||||||
Reference in New Issue
Block a user