public class DbQueryBuilder
extends DbQueryBuilderDecoration
sql构建器 依次继承 DbQueryBuilderAction 处理动作子句 + DbQueryBuilderDecoration 处理修饰子句 提供select/where等类sql的方法, 但是调用方法时, 不直接拼接sql, 而是在compile()时才延迟拼接sql, 因为调用方法时元素可以无序, 但生成sql时元素必须有序
DbQueryBuilderDecoration.CompanionIDbQueryBuilderQuoter.DefaultImplsIDbQueryBuilderAction.DefaultImplsIDbQueryBuilderDecoration.DefaultImplsCompanion| 构造器和说明 |
|---|
DbQueryBuilder(IDb defaultDb)
sql构建器
依次继承 DbQueryBuilderAction 处理动作子句 + DbQueryBuilderDecoration 处理修饰子句
提供select/where等类sql的方法, 但是调用方法时, 不直接拼接sql, 而是在compile()时才延迟拼接sql, 因为调用方法时元素可以无序, 但生成sql时元素必须有序
|
DbQueryBuilder()
sql构建器
依次继承 DbQueryBuilderAction 处理动作子句 + DbQueryBuilderDecoration 处理修饰子句
提供select/where等类sql的方法, 但是调用方法时, 不直接拼接sql, 而是在compile()时才延迟拼接sql, 因为调用方法时元素可以无序, 但生成sql时元素必须有序
|
DbQueryBuilder(java.lang.String table,
java.lang.String sort,
java.lang.Boolean desc,
java.lang.Integer start,
java.lang.Integer rows,
IDb defaultDb)
获得sql查询构建器
|
DbQueryBuilder(java.lang.String table,
java.lang.String condition,
java.util.List<?> params,
java.lang.String sort,
java.lang.Boolean desc,
java.lang.Integer start,
java.lang.Integer rows,
IDb defaultDb)
获得sql查询构建器
|
| 限定符和类型 | 方法和说明 |
|---|---|
int[] |
batchExecute(SqlAction action,
java.util.List<? extends java.lang.Object> paramses,
IDb db)
批量更新有参数的sql
|
CompiledSql |
compile(SqlAction action,
IDb db,
boolean clone)
编译sql
|
int |
count(java.util.List<?> params,
IDb db)
统计行数: count语句
|
long |
execute(SqlAction action,
java.util.List<? extends java.lang.Object> params,
java.lang.String generatedColumn,
IDb db)
编译 + 执行
|
<T> java.util.List<T> |
fastFindPageBySubquery(int limit,
int offset,
java.lang.String idField,
boolean whereOnlyIds,
java.util.List<?> params,
IDb db,
kotlin.jvm.functions.Function1<? super net.jkcode.jkmvc.db.DbResultRow,? extends T> transform)
通过select id子查询来加快分页查询
|
<T> T |
findResult(java.util.List<?> params,
boolean single,
IDb db,
kotlin.jvm.functions.Function1<? super net.jkcode.jkmvc.db.DbResultSet,? extends T> transform)
查找结果: select 语句
|
IDb |
getDefaultDb()
默认db名
|
boolean |
incr(java.lang.String column,
int step,
java.util.List<?> params,
IDb db)
自增
|
int |
sum(java.lang.String column,
java.util.List<?> params,
IDb db)
加总列值: sum语句
|
andHaving, andHavingClose, andHavingCondition, andHavingOpen, andWhere, andWhereClose, andWhereCondition, andWhereOpen, clear, clone, compileDecoration, compileLimit, forUpdate, getForUpdate, getGroupByClause, getHavingClause, getLimitParams, getOrderByClause, getParts, getWhereClause, groupBy, having, limit, orHaving, orHaving, orHavingClose, orHavingCondition, orHavingOpen, orWhere, orWhere, orWhereClose, orWhereCondition, orWhereExists, orWhereOpen, orderBy, prepareOperator, setForUpdate, setLimitParams, trySplitColumn, trySplitInParams, trySplitWhere, whav, whavClose, whavOpen, where, whereExistsclear, clone, compileAction, copy, distinct, fillDelTables, from, getAction, getDistinct, getInsertRows, getJoinParts, getJoinTables, getManipulatedData, getSelectColumns, getTable, getTableAlias, getUpdateRow, insertColumns, join, on, on, select, select, selects, set, set, setAction, setDistinct, setTable, sets, splitOperator, value, value, valuesclear, clone, getCompiledSql, quoteSingleValue, quoteSubQuery, setCompiledSqlandWhereWrap, batchDelete, batchExecute, batchInsert, batchUpdate, charAt, clone, compile, compileCount, compileDelete, compileInsert, compileSelect, compileSelectOne, compileUpdate, copy, count, delete, execute, fastFindPageBySubquery, fastFindPageMaps, from, from, get, getLength, groupBys, groupBys, having, havingClose, havingCondition, havingOpen, havings, incr, insert, length, ons, orWhereBetween, orWhereLike, orWhereWrap, orderBy, orderBys, orderBys, quote, quoteColumn, quoteColumnOrValue, quoteTable, selectDistinct, subSequence, sum, table, update, where, whereBetween, whereClose, whereCondition, whereLike, whereOpen, whereWrap, wheres, wheresclone, findColumn, findEntities, findEntities, findEntities, findEntity, findEntity, findEntity, findMap, findMaps, findModel, findModel, findModel, findModels, findModels, findModels, findResult, findRow, findRows, findValue, getDefaultDbquote, quoteColumn, quoteColumnOrValue, quoteSingleValue, quoteSubQuery, quoteTableclear, compileAction, distinct, from, from, from, getTableAlias, insertColumns, join, on, on, ons, select, select, selectDistinct, selects, set, set, sets, table, value, value, valuesandHaving, andHavingClose, andHavingCondition, andHavingOpen, andWhere, andWhereClose, andWhereCondition, andWhereOpen, andWhereWrap, compileDecoration, forUpdate, groupBy, groupBys, groupBys, having, having, havingClose, havingCondition, havingOpen, havings, limit, orHaving, orHaving, orHavingClose, orHavingCondition, orHavingOpen, orWhere, orWhere, orWhereBetween, orWhereClose, orWhereCondition, orWhereExists, orWhereLike, orWhereOpen, orWhereWrap, orderBy, orderBy, orderBys, orderBys, where, where, whereBetween, whereClose, whereCondition, whereExists, whereLike, whereOpen, whereWrap, wheres, wherespublic DbQueryBuilder(IDb defaultDb)
sql构建器 依次继承 DbQueryBuilderAction 处理动作子句 + DbQueryBuilderDecoration 处理修饰子句 提供select/where等类sql的方法, 但是调用方法时, 不直接拼接sql, 而是在compile()时才延迟拼接sql, 因为调用方法时元素可以无序, 但生成sql时元素必须有序
defaultDb - 默认db名用在sql执行方法中最后一个参数中,默认使用该属性对应的dbpublic DbQueryBuilder()
sql构建器 依次继承 DbQueryBuilderAction 处理动作子句 + DbQueryBuilderDecoration 处理修饰子句 提供select/where等类sql的方法, 但是调用方法时, 不直接拼接sql, 而是在compile()时才延迟拼接sql, 因为调用方法时元素可以无序, 但生成sql时元素必须有序
public DbQueryBuilder(java.lang.String table,
java.lang.String sort,
java.lang.Boolean desc,
java.lang.Integer start,
java.lang.Integer rows,
IDb defaultDb)
获得sql查询构建器
public DbQueryBuilder(java.lang.String table,
java.lang.String condition,
java.util.List<?> params,
java.lang.String sort,
java.lang.Boolean desc,
java.lang.Integer start,
java.lang.Integer rows,
IDb defaultDb)
获得sql查询构建器
public CompiledSql compile(SqlAction action, IDb db, boolean clone)
编译sql
public <T> T findResult(java.util.List<?> params,
boolean single,
IDb db,
kotlin.jvm.functions.Function1<? super net.jkcode.jkmvc.db.DbResultSet,? extends T> transform)
查找结果: select 语句
public int count(java.util.List<?> params,
IDb db)
统计行数: count语句
public int sum(java.lang.String column,
java.util.List<?> params,
IDb db)
加总列值: sum语句
public boolean incr(java.lang.String column,
int step,
java.util.List<?> params,
IDb db)
自增
public long execute(SqlAction action, java.util.List<? extends java.lang.Object> params, java.lang.String generatedColumn, IDb db)
编译 + 执行
public int[] batchExecute(SqlAction action, java.util.List<? extends java.lang.Object> paramses, IDb db)
批量更新有参数的sql
public <T> java.util.List<T> fastFindPageBySubquery(int limit,
int offset,
java.lang.String idField,
boolean whereOnlyIds,
java.util.List<?> params,
IDb db,
kotlin.jvm.functions.Function1<? super net.jkcode.jkmvc.db.DbResultRow,? extends T> transform)
通过select id子查询来加快分页查询
public IDb getDefaultDb()
默认db名
用在sql执行方法中最后一个参数中,默认使用该属性对应的db