| Modifier and Type | Class and Description |
|---|---|
(package private) static class |
DefaultQueryImpl.ConditionRelation
只给Condition使用.
|
static class |
DefaultQueryImpl.OrderBy
排序条件.
|
| Modifier and Type | Field and Description |
|---|---|
protected Class<T> |
clazz |
protected List<Condition> |
condList
保存查询条件.
|
protected String[] |
fields
保存取值的字段.
|
protected int |
limit
分页大小
|
protected List<DefaultQueryImpl.OrderBy> |
orderList
保存排序条件
|
protected int |
start
分页开始偏移量
|
| Constructor and Description |
|---|
DefaultQueryImpl() |
| Modifier and Type | Method and Description |
|---|---|
IQuery<T> |
add(Condition cond)
Deprecated.
|
IQuery<T> |
and(Condition cond)
and查询条件
|
void |
clean()
清除当前已经设置的查询条件.
|
IQuery<T> |
clone()
clone.
|
Number |
count()
获取此Query查询到的结果集数量.
|
List<Condition> |
getCondList() |
String[] |
getFields() |
int |
getLimit() |
List<DefaultQueryImpl.OrderBy> |
getOrderList() |
int |
getStart() |
SQL |
getWhereSql() |
boolean |
hasQueryFields() |
boolean |
isEffect() |
IQuery<T> |
limit(int limit)
设置limit参数
|
IQuery<T> |
limit(int start,
int limit)
分页参数.
|
List<T> |
list()
获取此Query查询到的结果集.
|
T |
load()
获取一条记录.
|
IQuery<T> |
or(Condition cond)
or查询条件.
|
IQuery<T> |
orderBy(String field,
Order order)
添加怕需字段
|
IQuery<T> |
orderBy(String field,
Order order,
Class<?> clazz)
添加排序字段.
|
void |
setCondList(List<Condition> condList) |
IQuery<T> |
setFields(Class<?> clazz,
String... fields)
添加取值字段.
|
IQuery<T> |
setFields(String... fields)
添加取值字段.
|
void |
setLimit(int limit) |
IQuery<T> |
setMasterSlave(EnumDBMasterSlave masterSlave)
设置查询主从库.
|
void |
setOrderList(List<DefaultQueryImpl.OrderBy> orderList) |
IQuery<T> |
setShardingKey(IShardingKey<?> shardingKey)
set sharding key.
|
void |
setStart(int start) |
IQuery<T> |
setUseCache(boolean useCache)
设置查询是否使用缓存
|
String |
toString() |
protected String[] fields
protected List<DefaultQueryImpl.OrderBy> orderList
protected int start
protected int limit
public IQuery<T> setShardingKey(IShardingKey<?> shardingKey)
IQuerysetShardingKey in interface IQuery<T>public IQuery<T> setMasterSlave(EnumDBMasterSlave masterSlave)
IQuerysetMasterSlave in interface IQuery<T>public IQuery<T> setUseCache(boolean useCache)
IQuerysetUseCache in interface IQuery<T>public IQuery<T> setFields(String... fields)
IQuerypublic IQuery<T> setFields(Class<?> clazz, String... fields)
IQuery@Deprecated public IQuery<T> add(Condition cond)
IQueryandpublic IQuery<T> orderBy(String field, Order order)
IQuerypublic IQuery<T> orderBy(String field, Order order, Class<?> clazz)
IQuerypublic void clean()
IQuerypublic String[] getFields()
public List<DefaultQueryImpl.OrderBy> getOrderList()
public int getStart()
public int getLimit()
public boolean hasQueryFields()
public boolean isEffect()
public SQL getWhereSql()
public void setOrderList(List<DefaultQueryImpl.OrderBy> orderList)
public void setStart(int start)
public void setLimit(int limit)
Copyright © 2015. All rights reserved.