public class Example extends Object
Modifier and Type | Class and Description |
---|---|
static class |
Example.Criteria |
static class |
Example.Criterion |
protected static class |
Example.GeneratedCriteria |
static class |
Example.OffsetLimit |
static class |
Example.Order |
static class |
Example.ValueType |
Modifier and Type | Field and Description |
---|---|
protected String |
alias
表别名(只对查询生效)
|
protected boolean |
count |
protected DBField |
countColumn |
protected List<Example.Criteria> |
criterias |
protected DBDialect |
dialect |
protected boolean |
distinct |
protected Class<?> |
entityClass |
protected Set<DBField> |
excludeColumns |
protected boolean |
exists |
protected boolean |
forUpdate |
protected String |
from
追加from字段
|
protected boolean |
notNull |
protected Example.OffsetLimit |
offsetLimit
查询总数限制
|
protected Map<DBField,Example.Order> |
orderMap
排序字段
|
protected Map<DBField,ColumnMapping> |
propertyMap |
protected String |
select
select字段权限最高,不为空,则不再判断selectColumns,excludeColumns,countColumn
|
protected Set<DBField> |
selectColumns |
protected TableMapping |
table |
protected String |
tableName |
Constructor and Description |
---|
Example(Class<? extends DBObject> entityClass)
默认exists为true
|
Example(Class<? extends DBObject> entityClass,
boolean exists)
带exists参数的构造方法,默认notNull为false,允许为空
|
Example(Class<? extends DBObject> entityClass,
boolean exists,
boolean notNull)
带exists参数的构造方法
|
protected boolean distinct
protected boolean count
protected boolean exists
protected boolean notNull
protected boolean forUpdate
protected String alias
protected DBField countColumn
protected String select
protected String from
protected List<Example.Criteria> criterias
protected Map<DBField,Example.Order> orderMap
protected Example.OffsetLimit offsetLimit
protected Class<?> entityClass
protected TableMapping table
protected Map<DBField,ColumnMapping> propertyMap
protected String tableName
protected DBDialect dialect
public Example(Class<? extends DBObject> entityClass)
entityClass
- public Example(Class<? extends DBObject> entityClass, boolean exists)
entityClass
- exists
- - true时,如果字段不存在就抛出异常,false时,如果不存在就不使用该字段的条件public Example offsetLimit(long start, int limit)
start
- limit
- public Example orderBy(DBField property, Example.Order order)
public String getOrderByClause(boolean useAlias)
public Example excludeProperties(DBField... properties)
properties
- 属性名的可变参数public Example selectProperties(DBField... properties)
properties
- public Example selectCount()
public void or(Example.Criteria criteria)
public Example.Criteria or()
public void and(Example.Criteria criteria)
public Example.Criteria and()
public Example.Criteria createCriteria()
protected Example.Criteria createCriteriaInternal()
public void clear()
public DBField getCountColumn()
public String getDynamicTableName()
public Class<?> getEntityClass()
public List<Example.Criteria> getCriterias()
public Map<DBField,Example.Order> getOrderMap()
public boolean isDistinct()
public void setDistinct(boolean distinct)
public boolean isForUpdate()
public void setForUpdate(boolean forUpdate)
public boolean isCount()
public void setCount(boolean count)
public Example.OffsetLimit getOffsetLimit()
public void setOffsetLimit(Example.OffsetLimit offsetLimit)
public String getColumnAlias(String name, boolean useAlias)
name
- useAlias
- public void setDialect(DBDialect dialect)
Copyright © 2020. All rights reserved.