public class SqlQuery extends AbstractQuery<Object>
| Modifier and Type | Field and Description |
|---|---|
protected List<Condition> |
conditions |
protected String |
from |
protected List<String> |
groups |
static String |
INNER_JOIN
Constant
INNER_JOIN=" left join " |
static String |
LEFT_OUTER_JOIN
Constant
LEFT_OUTER_JOIN=" left outer join " |
protected List<Order> |
orders |
static String |
OUTER_JOIN
Constant
OUTER_JOIN=" outer join " |
static String |
RIGHT_OUTER_JOIN
Constant
RIGHT_OUTER_JOIN=" right outer join " |
protected String |
select |
| Constructor and Description |
|---|
SqlQuery()
Constructor for SqlQuery.
|
SqlQuery(String queryStr)
Constructor for SqlQuery.
|
| Modifier and Type | Method and Description |
|---|---|
SqlQuery |
add(Collection<Condition> cons)
添加一组条件
query中不能添加条件集合作为一个条件,因此这里命名没有采用有区别性的addAll |
SqlQuery |
add(Condition condition)
add.
|
SqlQuery |
addOrder(List<Order> orders)
addOrder.
|
SqlQuery |
addOrder(Order order)
addOrder.
|
Query<Object> |
build()
build.
|
protected String |
genQueryString(boolean hasOrder)
genQueryString.
|
List<Condition> |
getConditions()
Getter for the field
conditions. |
String |
getFrom()
Getter for the field
from. |
List<String> |
getGroups()
Getter for the field
groups. |
protected Lang |
getLang()
getLang.
|
List<Order> |
getOrders()
Getter for the field
orders. |
Map<String,Object> |
getParams()
getParams.
|
String |
getSelect()
Getter for the field
select. |
SqlQuery |
groupBy(String what)
groupBy.
|
SqlQuery |
limit(PageLimit limit)
limit.
|
SqlQuery |
params(Map<String,Object> newParams)
params.
|
void |
setConditions(List<Condition> conditions)
Setter for the field
conditions. |
void |
setFrom(String from)
Setter for the field
from. |
void |
setGroups(List<String> groups)
Setter for the field
groups. |
void |
setOrders(List<Order> orders)
Setter for the field
orders. |
void |
setSelect(String select)
Setter for the field
select. |
String |
toCountString()
toCountString.
|
String |
toQueryString()
生成查询语句(如果查询语句已经存在则不进行生成)
|
getCountStr, getLimit, getQueryStr, isCacheable, setCacheable, setCountStr, setLimit, setParams, setQueryStrpublic static final String INNER_JOIN
INNER_JOIN=" left join "public static final String OUTER_JOIN
OUTER_JOIN=" outer join "public static final String LEFT_OUTER_JOIN
LEFT_OUTER_JOIN=" left outer join "public static final String RIGHT_OUTER_JOIN
RIGHT_OUTER_JOIN=" right outer join "protected String select
protected String from
public SqlQuery add(Collection<Condition> cons)
cons - a Collection object.SqlQuery object.public void setSelect(String select)
Setter for the field select.
select - a String object.public List<Condition> getConditions()
Getter for the field conditions.
List object.public void setConditions(List<Condition> conditions)
Setter for the field conditions.
conditions - a List object.public void setFrom(String from)
Setter for the field from.
from - a String object.public void setOrders(List<Order> orders)
Setter for the field orders.
orders - a List object.public void setGroups(List<String> groups)
Setter for the field groups.
groups - a List object.public String toQueryString()
toQueryString in class AbstractQuery<Object>String object.public String toCountString()
toCountString.
toCountString in class AbstractQuery<Object>String object.protected String genQueryString(boolean hasOrder)
genQueryString.
hasOrder - a boolean.String object.public Map<String,Object> getParams()
getParams.
getParams in interface QueryBuilder<Object>getParams in class AbstractQuery<Object>Map object.public SqlQuery limit(PageLimit limit)
limit.
limit - a PageLimit object.QueryBuilder object.Copyright © 2005–2018 The Beangle Software. All rights reserved.