Class QueryWrapper<T>
java.lang.Object
com.baomidou.mybatisplus.core.conditions.Wrapper<T>
com.baomidou.mybatisplus.core.conditions.AbstractWrapper<T,String,QueryWrapper<T>>
com.baomidou.mybatisplus.core.conditions.query.QueryWrapper<T>
- All Implemented Interfaces:
Compare<QueryWrapper<T>,,String> Func<QueryWrapper<T>,,String> Join<QueryWrapper<T>>,Nested<QueryWrapper<T>,,QueryWrapper<T>> ISqlSegment,Query<QueryWrapper<T>,,T, String> Serializable
public class QueryWrapper<T>
extends AbstractWrapper<T,String,QueryWrapper<T>>
implements Query<QueryWrapper<T>,T,String>
Entity 对象封装操作类
- Since:
- 2018-05-25
- Author:
- hubin miemie HCL
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from class com.baomidou.mybatisplus.core.conditions.AbstractWrapper
AbstractWrapper.DoSomething -
Field Summary
FieldsFields inherited from class com.baomidou.mybatisplus.core.conditions.AbstractWrapper
expression, lastSql, paramAlias, paramNameSeq, paramNameValuePairs, sqlComment, sqlFirst, typedThis -
Constructor Summary
ConstructorsConstructorDescriptionQueryWrapper(Class<T> entityClass) QueryWrapper(T entity) QueryWrapper(T entity, String... columns) -
Method Summary
Modifier and TypeMethodDescription开启检查 SQL 注入voidclear()条件清空protected StringcolumnToString(String column) 获取 columnName查询条件 SQL 片段protected QueryWrapper<T> instance()用于生成嵌套 sqllambda()返回一个支持 lambda 函数写法的 wrapper指定查询字段select(Class<T> entityClass, Predicate<TableFieldInfo> predicate) 过滤查询的字段信息(主键除外!)Methods inherited from class com.baomidou.mybatisplus.core.conditions.AbstractWrapper
addCondition, addNestedCondition, allEq, allEq, and, and, appendSqlSegments, apply, between, clone, columnsToString, columnsToString, columnToMapping, columnToSqlSegment, comment, doGroupBy, doOrderBy, eq, eqOrIsNull, eqSql, exists, first, formatParam, formatSqlMaybeWithParam, func, ge, geSql, getEntity, getEntityClass, getExpression, getParamAlias, getParamNameValuePairs, getSqlComment, getSqlFirst, getSqlSegment, groupBy, groupBy, groupBy, groupBy, gt, gtSql, having, in, in, inExpression, inExpression, inExpression, inExpression, initNeed, inSql, isNotNull, isNull, isUseAnnotationOrderBy, last, le, leSql, like, likeLeft, likeRight, likeValue, lt, ltSql, maybeDo, ne, nested, not, not, notBetween, notExists, notIn, notIn, notInSql, notLike, notLikeLeft, notLikeRight, onParamAliasChanged, or, or, orderBy, orderBy, orderBy, orderBy, setEntity, setEntityClass, setParamAliasMethods inherited from class com.baomidou.mybatisplus.core.conditions.Wrapper
getCustomSqlSegment, getSqlSet, getTargetSql, isEmptyOfEntity, isEmptyOfNormal, isEmptyOfWhere, isNonEmptyOfEntity, isNonEmptyOfNormal, isNonEmptyOfWhere, nonEmptyOfEntity, nonEmptyOfNormal, nonEmptyOfWhereMethods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface com.baomidou.mybatisplus.core.conditions.interfaces.Compare
allEq, allEq, allEq, allEq, between, eq, eqOrIsNull, ge, gt, le, like, likeLeft, likeRight, lt, ne, notBetween, notLike, notLikeLeft, notLikeRightMethods inherited from interface com.baomidou.mybatisplus.core.conditions.interfaces.Func
eqSql, func, geSql, groupBy, groupBy, groupBy, gtSql, having, in, in, inSql, isNotNull, isNull, leSql, ltSql, notIn, notIn, notInSql, orderByAsc, orderByAsc, orderByAsc, orderByAsc, orderByAsc, orderByAsc, orderByAsc, orderByDesc, orderByDesc, orderByDesc, orderByDesc, orderByDesc, orderByDesc, orderByDescMethods inherited from interface com.baomidou.mybatisplus.core.conditions.interfaces.Join
apply, comment, exists, first, last, notExists, or
-
Field Details
-
sqlSelect
查询字段
-
-
Constructor Details
-
QueryWrapper
public QueryWrapper() -
QueryWrapper
-
QueryWrapper
-
QueryWrapper
-
-
Method Details
-
checkSqlInjection
开启检查 SQL 注入 -
columnToString
Description copied from class:AbstractWrapper获取 columnName- Overrides:
columnToStringin classAbstractWrapper<T,String, QueryWrapper<T>>
-
select
Description copied from interface:Query指定查询字段 -
select
Description copied from interface:Query过滤查询的字段信息(主键除外!)例1: 只要 java 字段名以 "test" 开头的 -> select(i -> i.getProperty().startsWith("test"))
例2: 只要 java 字段属性是 CharSequence 类型的 -> select(TableFieldInfo::isCharSequence)
例3: 只要 java 字段没有填充策略的 -> select(i -> i.getFieldFill() == FieldFill.DEFAULT)
例4: 要全部字段 -> select(i -> true)
例5: 只要主键字段 -> select(i -> false)
-
getSqlSelect
Description copied from interface:Query查询条件 SQL 片段- Specified by:
getSqlSelectin interfaceQuery<QueryWrapper<T>,T, String> - Overrides:
getSqlSelectin classWrapper<T>
-
lambda
返回一个支持 lambda 函数写法的 wrapper -
instance
用于生成嵌套 sql故 sqlSelect 不向下传递
- Specified by:
instancein classAbstractWrapper<T,String, QueryWrapper<T>>
-
clear
public void clear()Description copied from class:Wrapper条件清空- Overrides:
clearin classAbstractWrapper<T,String, QueryWrapper<T>>
-