类 Example
- java.lang.Object
-
- tk.mybatis.mapper.entity.Example
-
- 所有已实现的接口:
IDynamicTableName
- 直接已知子类:
Condition
public class Example extends Object implements IDynamicTableName
通用的Example查询对象- 作者:
- liuzh
-
-
嵌套类概要
嵌套类 修饰符和类型 类 说明 static classExample.Builderstatic classExample.Criteriastatic classExample.Criterionprotected static classExample.GeneratedCriteriastatic classExample.OrderBy
-
字段概要
字段 修饰符和类型 字段 说明 protected StringcountColumnprotected booleandistinctprotected Class<?>entityClassprotected Set<String>excludeColumnsprotected booleanexistsprotected booleanforUpdateprotected booleannotNullprotected Example.OrderByORDERBYprotected StringorderByClauseprotected List<Example.Criteria>oredCriteriaprotected Map<String,EntityColumn>propertyMapprotected Set<String>selectColumnsprotected EntityTabletableprotected StringtableName
-
方法概要
-
-
-
字段详细资料
-
orderByClause
protected String orderByClause
-
distinct
protected boolean distinct
-
exists
protected boolean exists
-
notNull
protected boolean notNull
-
forUpdate
protected boolean forUpdate
-
countColumn
protected String countColumn
-
oredCriteria
protected List<Example.Criteria> oredCriteria
-
entityClass
protected Class<?> entityClass
-
table
protected EntityTable table
-
propertyMap
protected Map<String,EntityColumn> propertyMap
-
tableName
protected String tableName
-
ORDERBY
protected Example.OrderBy ORDERBY
-
-
构造器详细资料
-
Example
public Example(Class<?> entityClass)
默认exists为true- 参数:
entityClass-
-
Example
public Example(Class<?> entityClass, boolean exists)
带exists参数的构造方法,默认notNull为false,允许为空- 参数:
entityClass-exists- - true时,如果字段不存在就抛出异常,false时,如果不存在就不使用该字段的条件
-
Example
public Example(Class<?> entityClass, boolean exists, boolean notNull)
带exists参数的构造方法- 参数:
entityClass-exists- - true时,如果字段不存在就抛出异常,false时,如果不存在就不使用该字段的条件notNull- - true时,如果值为空,就会抛出异常,false时,如果为空就不使用该字段的条件
-
-
方法详细资料
-
builder
public static Example.Builder builder(Class<?> entityClass)
-
orderBy
public Example.OrderBy orderBy(String property)
-
excludeProperties
public Example excludeProperties(String... properties)
排除查询字段,优先级低于 selectProperties- 参数:
properties- 属性名的可变参数- 返回:
-
selectProperties
public Example selectProperties(String... properties)
指定要查询的属性列 - 这里会自动映射到表字段- 参数:
properties-- 返回:
-
or
public void or(Example.Criteria criteria)
-
or
public Example.Criteria or()
-
and
public void and(Example.Criteria criteria)
-
and
public Example.Criteria and()
-
createCriteria
public Example.Criteria createCriteria()
-
createCriteriaInternal
protected Example.Criteria createCriteriaInternal()
-
clear
public void clear()
-
getPropertyMap
public Map<String,EntityColumn> getPropertyMap()
-
getCountColumn
public String getCountColumn()
-
getDynamicTableName
public String getDynamicTableName()
从接口复制的说明:IDynamicTableName获取动态表名 - 只要有返回值,不是null和'',就会用返回值作为表名- 指定者:
getDynamicTableName在接口中IDynamicTableName- 返回:
-
getEntityClass
public Class<?> getEntityClass()
-
getOrderByClause
public String getOrderByClause()
-
setOrderByClause
public void setOrderByClause(String orderByClause)
-
getOredCriteria
public List<Example.Criteria> getOredCriteria()
-
isDistinct
public boolean isDistinct()
-
setDistinct
public void setDistinct(boolean distinct)
-
isForUpdate
public boolean isForUpdate()
-
setForUpdate
public void setForUpdate(boolean forUpdate)
-
setCountProperty
public void setCountProperty(String property)
指定 count(property) 查询属性- 参数:
property-
-
setTableName
public void setTableName(String tableName)
设置表名- 参数:
tableName-
-
-