Package cc.carm.lib.easysql.api.builder
Interface ConditionalBuilder<B extends ConditionalBuilder<B,T>,T extends SQLAction<?>>
-
- All Superinterfaces:
SQLBuilder
- All Known Subinterfaces:
DeleteBuilder
,TableQueryBuilder
,UpdateBuilder
public interface ConditionalBuilder<B extends ConditionalBuilder<B,T>,T extends SQLAction<?>> extends SQLBuilder
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description B
addCondition(@NotNull java.lang.String[] columnNames, @Nullable java.lang.Object[] queryValues)
B
addCondition(@NotNull java.lang.String columnName, @NotNull java.lang.String operator, @Nullable java.lang.Object queryValue)
B
addCondition(@NotNull java.lang.String columnName, @Nullable java.lang.Object queryValue)
B
addCondition(@Nullable java.lang.String condition)
B
addNotNullCondition(@NotNull java.lang.String columnName)
default B
addTimeCondition(@NotNull java.lang.String columnName, long startMillis, long endMillis)
添加时间的限定条件。B
addTimeCondition(@NotNull java.lang.String columnName, java.util.Date startDate, java.util.Date endDate)
添加时间的限定条件。T
build()
将现有条件构建完整的SQL语句用于执行。B
setConditions(@Nullable java.lang.String condition)
直接设定条件的源文本,不需要以WHERE开头。B
setConditions(java.util.LinkedHashMap<@NotNull java.lang.String,@Nullable java.lang.Object> conditionSQLs)
直接设定每个条件的文本与其对应数值,将以AND链接,且不需要以WHERE开头。B
setLimit(int limit)
设定限定的条目数-
Methods inherited from interface cc.carm.lib.easysql.api.SQLBuilder
getManager
-
-
-
-
Method Detail
-
setLimit
B setLimit(int limit)
设定限定的条目数- Parameters:
limit
- 条数限制- Returns:
ConditionalBuilder
-
setConditions
B setConditions(@Nullable @Nullable java.lang.String condition)
直接设定条件的源文本,不需要以WHERE开头。
如id = 1 AND name = 'test' OR name = 'test2'
。- Parameters:
condition
- 条件文本,不需要以WHERE开头。- Returns:
ConditionalBuilder
-
setConditions
B setConditions(java.util.LinkedHashMap<@NotNull java.lang.String,@Nullable java.lang.Object> conditionSQLs)
直接设定每个条件的文本与其对应数值,将以AND链接,且不需要以WHERE开头。
条件如id = ?
,问号将被以对应的数值填充。。- Parameters:
conditionSQLs
- 条件内容,将以AND链接,且不需要以WHERE开头。- Returns:
ConditionalBuilder
-
addCondition
B addCondition(@Nullable @Nullable java.lang.String condition)
-
addCondition
B addCondition(@NotNull @NotNull java.lang.String columnName, @NotNull @NotNull java.lang.String operator, @Nullable @Nullable java.lang.Object queryValue)
-
addCondition
B addCondition(@NotNull @NotNull java.lang.String columnName, @Nullable @Nullable java.lang.Object queryValue)
-
addCondition
B addCondition(@NotNull @NotNull java.lang.String[] columnNames, @Nullable @Nullable java.lang.Object[] queryValues)
-
addNotNullCondition
B addNotNullCondition(@NotNull @NotNull java.lang.String columnName)
-
addTimeCondition
default B addTimeCondition(@NotNull @NotNull java.lang.String columnName, long startMillis, long endMillis)
添加时间的限定条件。 若设定了开始时间,则限定条件为endMillis >= startMillis
;- Parameters:
columnName
- 判断的行startMillis
- 开始时间戳,若<0
则不作限定endMillis
- 结束时间戳,若<0
则不作限定- Returns:
ConditionalBuilder
-
addTimeCondition
B addTimeCondition(@NotNull @NotNull java.lang.String columnName, @Nullable java.util.Date startDate, @Nullable java.util.Date endDate)
添加时间的限定条件。 若设定了开始时间,则限定条件为endDate >= startTime
;- Parameters:
columnName
- 判断的行startDate
- 开始时间,若为null则不作限定endDate
- 结束时间,若为null则不作限定- Returns:
ConditionalBuilder
-
-