|
|
@ -20,126 +20,338 @@ public class RestrictionKit { |
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
|
|
|
* 指定列中和指定值相等的限制条件 |
|
|
|
|
|
|
|
* |
|
|
|
|
|
|
|
* @param columnName 列名 |
|
|
|
|
|
|
|
* @param columnValue 列值 |
|
|
|
|
|
|
|
* @return 限制条件 |
|
|
|
|
|
|
|
*/ |
|
|
|
public static Restriction eq(String columnName, Object columnValue) { |
|
|
|
public static Restriction eq(String columnName, Object columnValue) { |
|
|
|
return RestrictionFactory.eq(columnName, columnValue); |
|
|
|
return RestrictionFactory.eq(columnName, columnValue); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
|
|
|
* 指定列中和指定值相等的限制条件 |
|
|
|
|
|
|
|
* |
|
|
|
|
|
|
|
* @param column 列 |
|
|
|
|
|
|
|
* @param columnValue 列值 |
|
|
|
|
|
|
|
* @return 限制条件 |
|
|
|
|
|
|
|
*/ |
|
|
|
public static Restriction eq(Column column, Object columnValue) { |
|
|
|
public static Restriction eq(Column column, Object columnValue) { |
|
|
|
return RestrictionFactory.eq(column, columnValue); |
|
|
|
return RestrictionFactory.eq(column, columnValue); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
|
|
|
* 指定列中大于指定值的限制条件 |
|
|
|
|
|
|
|
* |
|
|
|
|
|
|
|
* @param columnName 列名 |
|
|
|
|
|
|
|
* @param columnValue 列值 |
|
|
|
|
|
|
|
* @return 限制条件 |
|
|
|
|
|
|
|
*/ |
|
|
|
public static Restriction gt(String columnName, Object columnValue) { |
|
|
|
public static Restriction gt(String columnName, Object columnValue) { |
|
|
|
return RestrictionFactory.gt(columnName, columnValue); |
|
|
|
return RestrictionFactory.gt(columnName, columnValue); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
|
|
|
* 指定列中大于指定值的限制条件 |
|
|
|
|
|
|
|
* |
|
|
|
|
|
|
|
* @param column 列 |
|
|
|
|
|
|
|
* @param columnValue 列值 |
|
|
|
|
|
|
|
* @return 限制条件 |
|
|
|
|
|
|
|
*/ |
|
|
|
public static Restriction gt(Column column, Object columnValue) { |
|
|
|
public static Restriction gt(Column column, Object columnValue) { |
|
|
|
return RestrictionFactory.gt(column, columnValue); |
|
|
|
return RestrictionFactory.gt(column, columnValue); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
|
|
|
* 指定列中大于等于指定值的限制条件 |
|
|
|
|
|
|
|
* |
|
|
|
|
|
|
|
* @param columnName 列名 |
|
|
|
|
|
|
|
* @param columnValue 列值 |
|
|
|
|
|
|
|
* @return 限制条件 |
|
|
|
|
|
|
|
*/ |
|
|
|
public static Restriction gte(String columnName, Object columnValue) { |
|
|
|
public static Restriction gte(String columnName, Object columnValue) { |
|
|
|
return RestrictionFactory.gte(columnName, columnValue); |
|
|
|
return RestrictionFactory.gte(columnName, columnValue); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
|
|
|
* 指定列中大于等于指定值的限制条件 |
|
|
|
|
|
|
|
* |
|
|
|
|
|
|
|
* @param column 列 |
|
|
|
|
|
|
|
* @param columnValue 列值 |
|
|
|
|
|
|
|
* @return 限制条件 |
|
|
|
|
|
|
|
*/ |
|
|
|
public static Restriction gte(Column column, Object columnValue) { |
|
|
|
public static Restriction gte(Column column, Object columnValue) { |
|
|
|
return RestrictionFactory.gte(column, columnValue); |
|
|
|
return RestrictionFactory.gte(column, columnValue); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
|
|
|
* 指定列中小于指定值的限制条件 |
|
|
|
|
|
|
|
* |
|
|
|
|
|
|
|
* @param columnName 列名 |
|
|
|
|
|
|
|
* @param columnValue 列值 |
|
|
|
|
|
|
|
* @return 限制条件 |
|
|
|
|
|
|
|
*/ |
|
|
|
public static Restriction lt(String columnName, Object columnValue) { |
|
|
|
public static Restriction lt(String columnName, Object columnValue) { |
|
|
|
return RestrictionFactory.lt(columnName, columnValue); |
|
|
|
return RestrictionFactory.lt(columnName, columnValue); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
|
|
|
* 指定列中小于指定值的限制条件 |
|
|
|
|
|
|
|
* |
|
|
|
|
|
|
|
* @param column 列 |
|
|
|
|
|
|
|
* @param columnValue 列值 |
|
|
|
|
|
|
|
* @return 限制条件 |
|
|
|
|
|
|
|
*/ |
|
|
|
public static Restriction lt(Column column, Object columnValue) { |
|
|
|
public static Restriction lt(Column column, Object columnValue) { |
|
|
|
return RestrictionFactory.lt(column, columnValue); |
|
|
|
return RestrictionFactory.lt(column, columnValue); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
|
|
|
* 指定列中小于等于指定值的限制条件 |
|
|
|
|
|
|
|
* |
|
|
|
|
|
|
|
* @param columnName 列名 |
|
|
|
|
|
|
|
* @param columnValue 列值 |
|
|
|
|
|
|
|
* @return 限制条件 |
|
|
|
|
|
|
|
*/ |
|
|
|
public static Restriction lte(String columnName, Object columnValue) { |
|
|
|
public static Restriction lte(String columnName, Object columnValue) { |
|
|
|
return RestrictionFactory.lte(columnName, columnValue); |
|
|
|
return RestrictionFactory.lte(columnName, columnValue); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
|
|
|
* 指定列中小于等于指定值的限制条件 |
|
|
|
|
|
|
|
* |
|
|
|
|
|
|
|
* @param column 列 |
|
|
|
|
|
|
|
* @param columnValue 列值 |
|
|
|
|
|
|
|
* @return 限制条件 |
|
|
|
|
|
|
|
*/ |
|
|
|
public static Restriction lte(Column column, Object columnValue) { |
|
|
|
public static Restriction lte(Column column, Object columnValue) { |
|
|
|
return RestrictionFactory.lte(column, columnValue); |
|
|
|
return RestrictionFactory.lte(column, columnValue); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
|
|
|
* 指定列中不等于指定值的限制条件 |
|
|
|
|
|
|
|
* |
|
|
|
|
|
|
|
* @param columnName 列名 |
|
|
|
|
|
|
|
* @param columnValue 列值 |
|
|
|
|
|
|
|
* @return 限制条件 |
|
|
|
|
|
|
|
*/ |
|
|
|
public static Restriction neq(String columnName, Object columnValue) { |
|
|
|
public static Restriction neq(String columnName, Object columnValue) { |
|
|
|
return RestrictionFactory.neq(columnName, columnValue); |
|
|
|
return RestrictionFactory.neq(columnName, columnValue); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
|
|
|
* 指定列中不等于指定值的限制条件 |
|
|
|
|
|
|
|
* |
|
|
|
|
|
|
|
* @param column 列 |
|
|
|
|
|
|
|
* @param columnValue 列值 |
|
|
|
|
|
|
|
* @return 限制条件 |
|
|
|
|
|
|
|
*/ |
|
|
|
public static Restriction neq(Column column, Object columnValue) { |
|
|
|
public static Restriction neq(Column column, Object columnValue) { |
|
|
|
return RestrictionFactory.neq(column, columnValue); |
|
|
|
return RestrictionFactory.neq(column, columnValue); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
|
|
|
* 指定列中匹配指定值的限制条件 |
|
|
|
|
|
|
|
* |
|
|
|
|
|
|
|
* @param columnName 列名 |
|
|
|
|
|
|
|
* @param columnValue 列值 |
|
|
|
|
|
|
|
* @return 限制条件 |
|
|
|
|
|
|
|
*/ |
|
|
|
public static Restriction like(String columnName, Object columnValue) { |
|
|
|
public static Restriction like(String columnName, Object columnValue) { |
|
|
|
return RestrictionFactory.like(columnName, columnValue); |
|
|
|
return RestrictionFactory.like(columnName, columnValue); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
|
|
|
* 指定列中匹配指定值的限制条件 |
|
|
|
|
|
|
|
* |
|
|
|
|
|
|
|
* @param column 列 |
|
|
|
|
|
|
|
* @param columnValue 列值 |
|
|
|
|
|
|
|
* @return 限制条件 |
|
|
|
|
|
|
|
*/ |
|
|
|
public static Restriction like(Column column, Object columnValue) { |
|
|
|
public static Restriction like(Column column, Object columnValue) { |
|
|
|
return RestrictionFactory.like(column, columnValue); |
|
|
|
return RestrictionFactory.like(column, columnValue); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
|
|
|
* 指定列中以指定值开头的限制条件 |
|
|
|
|
|
|
|
* |
|
|
|
|
|
|
|
* @param columnName 列名 |
|
|
|
|
|
|
|
* @param columnValue 列值 |
|
|
|
|
|
|
|
* @return 限制条件 |
|
|
|
|
|
|
|
*/ |
|
|
|
public static Restriction startWith(String columnName, Object columnValue) { |
|
|
|
public static Restriction startWith(String columnName, Object columnValue) { |
|
|
|
return RestrictionFactory.startWith(columnName, columnValue); |
|
|
|
return RestrictionFactory.startWith(columnName, columnValue); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
|
|
|
* 指定列中以指定值开头的限制条件 |
|
|
|
|
|
|
|
* |
|
|
|
|
|
|
|
* @param column 列 |
|
|
|
|
|
|
|
* @param columnValue 列值 |
|
|
|
|
|
|
|
* @return 限制条件 |
|
|
|
|
|
|
|
*/ |
|
|
|
public static Restriction startWith(Column column, Object columnValue) { |
|
|
|
public static Restriction startWith(Column column, Object columnValue) { |
|
|
|
return RestrictionFactory.startWith(column, columnValue); |
|
|
|
return RestrictionFactory.startWith(column, columnValue); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
|
|
|
* 指定列中以指定值结尾的限制条件 |
|
|
|
|
|
|
|
* |
|
|
|
|
|
|
|
* @param columnName 列名 |
|
|
|
|
|
|
|
* @param columnValue 列值 |
|
|
|
|
|
|
|
* @return 限制条件 |
|
|
|
|
|
|
|
*/ |
|
|
|
public static Restriction endWith(String columnName, Object columnValue) { |
|
|
|
public static Restriction endWith(String columnName, Object columnValue) { |
|
|
|
return RestrictionFactory.endWith(columnName, columnValue); |
|
|
|
return RestrictionFactory.endWith(columnName, columnValue); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
|
|
|
* 指定列中以指定值结尾的限制条件 |
|
|
|
|
|
|
|
* |
|
|
|
|
|
|
|
* @param column 列 |
|
|
|
|
|
|
|
* @param columnValue 列值 |
|
|
|
|
|
|
|
* @return 限制条件 |
|
|
|
|
|
|
|
*/ |
|
|
|
public static Restriction endWith(Column column, Object columnValue) { |
|
|
|
public static Restriction endWith(Column column, Object columnValue) { |
|
|
|
return RestrictionFactory.endWith(column, columnValue); |
|
|
|
return RestrictionFactory.endWith(column, columnValue); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
|
|
|
* 指定列中包含在指定值中的限制条件 |
|
|
|
|
|
|
|
* |
|
|
|
|
|
|
|
* @param columnName 列名 |
|
|
|
|
|
|
|
* @param columnValues 列值 |
|
|
|
|
|
|
|
* @return 限制条件 |
|
|
|
|
|
|
|
*/ |
|
|
|
public static Restriction in(String columnName, Set<?> columnValues) { |
|
|
|
public static Restriction in(String columnName, Set<?> columnValues) { |
|
|
|
return RestrictionFactory.in(columnName, columnValues); |
|
|
|
return RestrictionFactory.in(columnName, columnValues); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
|
|
|
* 指定列中包含在指定值中的限制条件 |
|
|
|
|
|
|
|
* |
|
|
|
|
|
|
|
* @param column 列 |
|
|
|
|
|
|
|
* @param columnValues 列值 |
|
|
|
|
|
|
|
* @return 限制条件 |
|
|
|
|
|
|
|
*/ |
|
|
|
public static Restriction in(Column column, Set<?> columnValues) { |
|
|
|
public static Restriction in(Column column, Set<?> columnValues) { |
|
|
|
return RestrictionFactory.in(column, columnValues); |
|
|
|
return RestrictionFactory.in(column, columnValues); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
|
|
|
* 指定列中包含在指定值中的限制条件 |
|
|
|
|
|
|
|
* |
|
|
|
|
|
|
|
* @param columnName 列名 |
|
|
|
|
|
|
|
* @param query 子查询 |
|
|
|
|
|
|
|
* @return 限制条件 |
|
|
|
|
|
|
|
*/ |
|
|
|
public static Restriction inQuery(String columnName, SubQuery query) { |
|
|
|
public static Restriction inQuery(String columnName, SubQuery query) { |
|
|
|
return RestrictionFactory.inQuery(columnName, query); |
|
|
|
return RestrictionFactory.inQuery(columnName, query); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
|
|
|
* 指定列中包含在指定值中的限制条件 |
|
|
|
|
|
|
|
* |
|
|
|
|
|
|
|
* @param column 列 |
|
|
|
|
|
|
|
* @param query 子查询 |
|
|
|
|
|
|
|
* @return 限制条件 |
|
|
|
|
|
|
|
*/ |
|
|
|
public static Restriction inQuery(Column column, SubQuery query) { |
|
|
|
public static Restriction inQuery(Column column, SubQuery query) { |
|
|
|
return RestrictionFactory.inQuery(column, query); |
|
|
|
return RestrictionFactory.inQuery(column, query); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
|
|
|
* 指定列中不包含在指定值中的限制条件 |
|
|
|
|
|
|
|
* |
|
|
|
|
|
|
|
* @param columnName 列名 |
|
|
|
|
|
|
|
* @param columnValues 列值 |
|
|
|
|
|
|
|
* @return 限制条件 |
|
|
|
|
|
|
|
*/ |
|
|
|
public static Restriction notIn(String columnName, Set<?> columnValues) { |
|
|
|
public static Restriction notIn(String columnName, Set<?> columnValues) { |
|
|
|
return RestrictionFactory.notIn(columnName, columnValues); |
|
|
|
return RestrictionFactory.notIn(columnName, columnValues); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
|
|
|
* 指定列中不包含在指定值中的限制条件 |
|
|
|
|
|
|
|
* |
|
|
|
|
|
|
|
* @param column 列 |
|
|
|
|
|
|
|
* @param columnValues 列值 |
|
|
|
|
|
|
|
* @return 限制条件 |
|
|
|
|
|
|
|
*/ |
|
|
|
public static Restriction notIn(Column column, Set<?> columnValues) { |
|
|
|
public static Restriction notIn(Column column, Set<?> columnValues) { |
|
|
|
return RestrictionFactory.notIn(column, columnValues); |
|
|
|
return RestrictionFactory.notIn(column, columnValues); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
|
|
|
* 指定列中不包含在指定值中的限制条件 |
|
|
|
|
|
|
|
* |
|
|
|
|
|
|
|
* @param columnName 列名 |
|
|
|
|
|
|
|
* @param query 子查询 |
|
|
|
|
|
|
|
* @return 限制条件 |
|
|
|
|
|
|
|
*/ |
|
|
|
public static Restriction notInQuery(String columnName, SubQuery query) { |
|
|
|
public static Restriction notInQuery(String columnName, SubQuery query) { |
|
|
|
return RestrictionFactory.notInQuery(columnName, query); |
|
|
|
return RestrictionFactory.notInQuery(columnName, query); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
|
|
|
* 指定列中不包含在指定值中的限制条件 |
|
|
|
|
|
|
|
* |
|
|
|
|
|
|
|
* @param column 列 |
|
|
|
|
|
|
|
* @param query 子查询 |
|
|
|
|
|
|
|
* @return 限制条件 |
|
|
|
|
|
|
|
*/ |
|
|
|
public static Restriction notInQuery(Column column, SubQuery query) { |
|
|
|
public static Restriction notInQuery(Column column, SubQuery query) { |
|
|
|
return RestrictionFactory.notInQuery(column, query); |
|
|
|
return RestrictionFactory.notInQuery(column, query); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
|
|
|
* 将多个限制条件以或的方式组合到一起 |
|
|
|
|
|
|
|
* |
|
|
|
|
|
|
|
* @param restrictions 多个限制条件 |
|
|
|
|
|
|
|
* @return 限制条件 |
|
|
|
|
|
|
|
*/ |
|
|
|
public static Restriction or(Restriction... restrictions) { |
|
|
|
public static Restriction or(Restriction... restrictions) { |
|
|
|
return RestrictionFactory.or(restrictions); |
|
|
|
return RestrictionFactory.or(restrictions); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
|
|
|
* 将多个限制条件以或的方式组合到一起 |
|
|
|
|
|
|
|
* |
|
|
|
|
|
|
|
* @param restrictionList 多个限制条件 |
|
|
|
|
|
|
|
* @return 限制条件 |
|
|
|
|
|
|
|
*/ |
|
|
|
public static Restriction or(List<Restriction> restrictionList) { |
|
|
|
public static Restriction or(List<Restriction> restrictionList) { |
|
|
|
return RestrictionFactory.or(restrictionList); |
|
|
|
return RestrictionFactory.or(restrictionList); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
|
|
|
* 将多个限制条件以且的方式组合到一起 |
|
|
|
|
|
|
|
* |
|
|
|
|
|
|
|
* @param restrictions 多个限制条件 |
|
|
|
|
|
|
|
* @return 限制条件 |
|
|
|
|
|
|
|
*/ |
|
|
|
public static Restriction and(Restriction... restrictions) { |
|
|
|
public static Restriction and(Restriction... restrictions) { |
|
|
|
return RestrictionFactory.and(restrictions); |
|
|
|
return RestrictionFactory.and(restrictions); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
|
|
|
* 将多个限制条件以且的方式组合到一起 |
|
|
|
|
|
|
|
* |
|
|
|
|
|
|
|
* @param restrictionList 多个限制条件 |
|
|
|
|
|
|
|
* @return 限制条件 |
|
|
|
|
|
|
|
*/ |
|
|
|
public static Restriction and(List<Restriction> restrictionList) { |
|
|
|
public static Restriction and(List<Restriction> restrictionList) { |
|
|
|
return RestrictionFactory.and(restrictionList); |
|
|
|
return RestrictionFactory.and(restrictionList); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
|
|
|
* 排除掉指定的限制条件 |
|
|
|
|
|
|
|
* |
|
|
|
|
|
|
|
* @param restriction 条件 |
|
|
|
|
|
|
|
* @return 限制条件 |
|
|
|
|
|
|
|
*/ |
|
|
|
public static Restriction not(Restriction restriction) { |
|
|
|
public static Restriction not(Restriction restriction) { |
|
|
|
return RestrictionFactory.not(restriction); |
|
|
|
return RestrictionFactory.not(restriction); |
|
|
|
} |
|
|
|
} |
|
|
|