Package cn.cloudself.query
Class QueryPro<T,ID,SELECT_BY_FIELD extends AbstractExpression<?,?,?,?,?,?>,ORDER_BY_FIELD extends AbstractExpression<?,?,?,?,?,?>,UPDATE_SET_FIELD extends UpdateSetDefinedExpression<UPDATE_BY_FIELD>,UPDATE_BY_FIELD extends AbstractExpression<?,?,?,?,?,?>,DELETE_BY_FIELD extends AbstractExpression<?,?,?,?,?,?>>
- java.lang.Object
-
- cn.cloudself.query.QueryPro<T,ID,SELECT_BY_FIELD,ORDER_BY_FIELD,UPDATE_SET_FIELD,UPDATE_BY_FIELD,DELETE_BY_FIELD>
-
- All Implemented Interfaces:
IQueryProConfig.Writeable<QueryPro<T,ID,SELECT_BY_FIELD,ORDER_BY_FIELD,UPDATE_SET_FIELD,UPDATE_BY_FIELD,DELETE_BY_FIELD>>
public class QueryPro<T,ID,SELECT_BY_FIELD extends AbstractExpression<?,?,?,?,?,?>,ORDER_BY_FIELD extends AbstractExpression<?,?,?,?,?,?>,UPDATE_SET_FIELD extends UpdateSetDefinedExpression<UPDATE_BY_FIELD>,UPDATE_BY_FIELD extends AbstractExpression<?,?,?,?,?,?>,DELETE_BY_FIELD extends AbstractExpression<?,?,?,?,?,?>> extends Object implements IQueryProConfig.Writeable<QueryPro<T,ID,SELECT_BY_FIELD,ORDER_BY_FIELD,UPDATE_SET_FIELD,UPDATE_BY_FIELD,DELETE_BY_FIELD>>
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface cn.cloudself.query.config.IQueryProConfig.Writeable
IQueryProConfig.Writeable.Default<T extends IQueryProConfig.Writeable<T>>
-
-
Constructor Summary
Constructors Constructor Description QueryPro(Class<?> queryProClass, Class<T> clazz, QueryStructure queryStructure, QueryFieldCreator<SELECT_BY_FIELD> createSelectByField, QueryFieldCreator<ORDER_BY_FIELD> createOrderByField, QueryFieldCreator<UPDATE_SET_FIELD> createUpdateSetField, QueryFieldCreator<UPDATE_BY_FIELD> createUpdateByField, QueryFieldCreator<DELETE_BY_FIELD> createDeleteByField)
-
Method Summary
-
-
-
Constructor Detail
-
QueryPro
public QueryPro(Class<?> queryProClass, Class<T> clazz, QueryStructure queryStructure, QueryFieldCreator<SELECT_BY_FIELD> createSelectByField, QueryFieldCreator<ORDER_BY_FIELD> createOrderByField, QueryFieldCreator<UPDATE_SET_FIELD> createUpdateSetField, QueryFieldCreator<UPDATE_BY_FIELD> createUpdateByField, QueryFieldCreator<DELETE_BY_FIELD> createDeleteByField)
-
-
Method Detail
-
dbType
@NotNull public QueryPro<T,ID,SELECT_BY_FIELD,ORDER_BY_FIELD,UPDATE_SET_FIELD,UPDATE_BY_FIELD,DELETE_BY_FIELD> dbType(@NotNull IQueryProConfig.DatabaseType dbType)
- Specified by:
dbTypein interfaceIQueryProConfig.Writeable<T>
-
maxParameterSize
@NotNull public QueryPro<T,ID,SELECT_BY_FIELD,ORDER_BY_FIELD,UPDATE_SET_FIELD,UPDATE_BY_FIELD,DELETE_BY_FIELD> maxParameterSize(int size)
- Specified by:
maxParameterSizein interfaceIQueryProConfig.Writeable<T>
-
connection
@NotNull public QueryPro<T,ID,SELECT_BY_FIELD,ORDER_BY_FIELD,UPDATE_SET_FIELD,UPDATE_BY_FIELD,DELETE_BY_FIELD> connection(@NotNull Connection connection)
- Specified by:
connectionin interfaceIQueryProConfig.Writeable<T>
-
dataSource
@NotNull public QueryPro<T,ID,SELECT_BY_FIELD,ORDER_BY_FIELD,UPDATE_SET_FIELD,UPDATE_BY_FIELD,DELETE_BY_FIELD> dataSource(@NotNull DataSource dataSource)
- Specified by:
dataSourcein interfaceIQueryProConfig.Writeable<T>
-
bt
@NotNull public QueryPro<T,ID,SELECT_BY_FIELD,ORDER_BY_FIELD,UPDATE_SET_FIELD,UPDATE_BY_FIELD,DELETE_BY_FIELD> bt(boolean enable)
- Specified by:
btin interfaceIQueryProConfig.Writeable<T>
-
pl
@NotNull public QueryPro<T,ID,SELECT_BY_FIELD,ORDER_BY_FIELD,UPDATE_SET_FIELD,UPDATE_BY_FIELD,DELETE_BY_FIELD> pl(boolean enable)
- Specified by:
plin interfaceIQueryProConfig.Writeable<T>
-
pl
@NotNull public QueryPro<T,ID,SELECT_BY_FIELD,ORDER_BY_FIELD,UPDATE_SET_FIELD,UPDATE_BY_FIELD,DELETE_BY_FIELD> pl(boolean enable, @NotNull LogLevel level)
- Specified by:
plin interfaceIQueryProConfig.Writeable<T>
-
ple
@NotNull public QueryPro<T,ID,SELECT_BY_FIELD,ORDER_BY_FIELD,UPDATE_SET_FIELD,UPDATE_BY_FIELD,DELETE_BY_FIELD> ple(boolean print)
- Specified by:
plein interfaceIQueryProConfig.Writeable<T>
-
pcb
@NotNull public QueryPro<T,ID,SELECT_BY_FIELD,ORDER_BY_FIELD,UPDATE_SET_FIELD,UPDATE_BY_FIELD,DELETE_BY_FIELD> pcb(boolean enable)
- Specified by:
pcbin interfaceIQueryProConfig.Writeable<T>
-
pcb
@NotNull public QueryPro<T,ID,SELECT_BY_FIELD,ORDER_BY_FIELD,UPDATE_SET_FIELD,UPDATE_BY_FIELD,DELETE_BY_FIELD> pcb(boolean enable, @NotNull LogLevel level)
- Specified by:
pcbin interfaceIQueryProConfig.Writeable<T>
-
pr
@NotNull public QueryPro<T,ID,SELECT_BY_FIELD,ORDER_BY_FIELD,UPDATE_SET_FIELD,UPDATE_BY_FIELD,DELETE_BY_FIELD> pr(boolean enable)
- Specified by:
prin interfaceIQueryProConfig.Writeable<T>
-
pr
@NotNull public QueryPro<T,ID,SELECT_BY_FIELD,ORDER_BY_FIELD,UPDATE_SET_FIELD,UPDATE_BY_FIELD,DELETE_BY_FIELD> pr(boolean enable, @NotNull LogLevel level)
- Specified by:
prin interfaceIQueryProConfig.Writeable<T>
-
dryRun
@NotNull public QueryPro<T,ID,SELECT_BY_FIELD,ORDER_BY_FIELD,UPDATE_SET_FIELD,UPDATE_BY_FIELD,DELETE_BY_FIELD> dryRun(boolean enable)
Description copied from interface:IQueryProConfig.Writeable占位,未充分测试,不推荐使用- Specified by:
dryRunin interfaceIQueryProConfig.Writeable<T>
-
logicDelete
@NotNull public QueryPro<T,ID,SELECT_BY_FIELD,ORDER_BY_FIELD,UPDATE_SET_FIELD,UPDATE_BY_FIELD,DELETE_BY_FIELD> logicDelete(boolean enable)
- Specified by:
logicDeletein interfaceIQueryProConfig.Writeable<T>
-
logicDelete
@NotNull public QueryPro<T,ID,SELECT_BY_FIELD,ORDER_BY_FIELD,UPDATE_SET_FIELD,UPDATE_BY_FIELD,DELETE_BY_FIELD> logicDelete(boolean enable, @NotNull String field, @Nullable Object trueValue, @Nullable Object falseValue)
- Specified by:
logicDeletein interfaceIQueryProConfig.Writeable<T>
-
selectBy
public SELECT_BY_FIELD selectBy()
查询操作
-
selectByObj
public SELECT_BY_FIELD selectByObj(T obj)
-
orderBy
public ORDER_BY_FIELD orderBy()
排序操作
-
updateSet
@PureContract @Contract(pure=true) public UPDATE_SET_FIELD updateSet()
更新操作 例子:updateSet().kee("new-key").where.id.equalTo(1).run() 注意如果要更新的值传入null(例子中是kee), 则会报错, 如确实需要更新为null, 使用 java: updateSet().kee(NULL).where.id.equalTo(1).run() java: updateSet().kee(QueryProConstKt.NULL).where.id().equalTo(1).run()
-
updateSet
@PureContract @Contract(pure=true) public UpdateSetDefinedExpression<UPDATE_BY_FIELD> updateSet(T obj)
更新操作 updateSet(Apple(id = 2021, name = "iPhone13", type = null)).run() 如果 需要更新的值为null, 则跳过该字段不更新 如确实需要更新, 使用 updateSet(Apple(id = 2021, name = "iPhone13", type = null), true).run() 如果需要更新的值更新的值为null, 会将其更新为null
-
updateSet
@PureContract @Contract(pure=true) public UpdateSetDefinedExpression<UPDATE_BY_FIELD> updateSet(T obj, boolean override)
更新操作 updateSet(Apple(id = 2021, name = "iPhone13", type = null)).run() 如果 需要更新的值为null, 则跳过该字段不更新 如确实需要更新, 使用 updateSet(Apple(id = 2021, name = "iPhone13", type = null), true).run() 如果需要更新的值更新的值为null, 会将其更新为null
-
updateSet
@PureContract @Contract(pure=true) public UpdateSetDefinedExpression<UPDATE_BY_FIELD> updateSet(Map<String,?> obj)
-
deleteBy
public DELETE_BY_FIELD deleteBy()
删除操作
-
deleteByPrimaryKey
public boolean deleteByPrimaryKey(Object keyValue)
使用主键删除
-
insert
@SafeVarargs public final List<ID> insert(Map<String,?>... objs)
-
insert
public List<ID> insert(Collection<T> collection)
批量插入
-
plus
public QueryProPlus<T,T> plus()
-
plus
public QueryProPlus<T,Alias> plus(String alias)
-
-