Package tk.mybatis.mapper.entity
Class Example
java.lang.Object
tk.mybatis.mapper.entity.Example
- All Implemented Interfaces:
IDynamicTableName
- Direct Known Subclasses:
Condition
通用的Example查询对象
- Author:
- liuzh
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classstatic classstatic classprotected static classstatic class -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected Stringprotected booleanprotected Class<?>protected booleanprotected booleanprotected booleanprotected Example.OrderByprotected Stringprotected List<Example.Criteria>protected Map<String,EntityColumn> protected EntityTableprotected String -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionand()voidand(Example.Criteria criteria) static Example.Buildervoidclear()protected Example.CriteriaexcludeProperties(String... properties) 排除查询字段,优先级低于 selectProperties获取动态表名 - 只要有返回值,不是null和'',就会用返回值作为表名Class<?>booleanbooleanor()voidor(Example.Criteria criteria) selectProperties(String... properties) 指定要查询的属性列 - 这里会自动映射到表字段voidsetCountProperty(String property) 指定 count(property) 查询属性voidsetDistinct(boolean distinct) voidsetForUpdate(boolean forUpdate) voidsetOrderByClause(String orderByClause) voidsetTableName(String tableName) 设置表名
-
Field Details
-
orderByClause
-
distinct
protected boolean distinct -
exists
protected boolean exists -
notNull
protected boolean notNull -
forUpdate
protected boolean forUpdate -
selectColumns
-
excludeColumns
-
countColumn
-
oredCriteria
-
entityClass
-
table
-
propertyMap
-
tableName
-
ORDERBY
-
-
Constructor Details
-
Example
默认exists为true- Parameters:
entityClass-
-
Example
带exists参数的构造方法,默认notNull为false,允许为空- Parameters:
entityClass-exists- - true时,如果字段不存在就抛出异常,false时,如果不存在就不使用该字段的条件
-
Example
带exists参数的构造方法- Parameters:
entityClass-exists- - true时,如果字段不存在就抛出异常,false时,如果不存在就不使用该字段的条件notNull- - true时,如果值为空,就会抛出异常,false时,如果为空就不使用该字段的条件
-
-
Method Details
-
builder
-
orderBy
-
excludeProperties
排除查询字段,优先级低于 selectProperties- Parameters:
properties- 属性名的可变参数- Returns:
-
selectProperties
指定要查询的属性列 - 这里会自动映射到表字段- Parameters:
properties-- Returns:
-
or
-
or
-
and
-
and
-
createCriteria
-
createCriteriaInternal
-
clear
public void clear() -
getPropertyMap
-
getCountColumn
-
getDynamicTableName
Description copied from interface:IDynamicTableName获取动态表名 - 只要有返回值,不是null和'',就会用返回值作为表名- Specified by:
getDynamicTableNamein interfaceIDynamicTableName- Returns:
-
getEntityClass
-
getOrderByClause
-
setOrderByClause
-
getOredCriteria
-
getSelectColumns
-
isDistinct
public boolean isDistinct() -
setDistinct
public void setDistinct(boolean distinct) -
isForUpdate
public boolean isForUpdate() -
setForUpdate
public void setForUpdate(boolean forUpdate) -
setCountProperty
指定 count(property) 查询属性- Parameters:
property-
-
setTableName
设置表名- Parameters:
tableName-
-