public interface Select extends StatementParameters
| 限定符和类型 | 接口和说明 |
|---|---|
static interface |
Select.Join |
| 限定符和类型 | 方法和说明 |
|---|---|
Select |
as(String alias)
设置别名
|
Select |
asc(String... fields)
升序排序
|
int |
count()
返回总记录数,使用此访问时,之前指定返回字段无效
|
Select |
desc(String... fields)
降序排序
|
<T extends Engine> |
from(Class<T> table,
String... fields)
需要查询的表
|
<T extends Engine> |
go()
执行查询操作
|
<T extends Engine> |
go(boolean isReset)
执行查询操作
|
Select |
groupBy(String... fields)
可选的 GROUP BY 子句的一般形式
GROUP BY expression [, ...] |
Select |
having(Cnd condition)
可选的 HAVING 子句有如下形式:HAVING SUM(OrderPrice)<2000
|
<T extends Engine> |
innerJoin(Class<T> table,
String... fields)
INNER JOIN表
|
Select.Join |
innerJoin(Select select,
String... fields)
INNER JOIN子查询Select语句
|
<T extends Engine> |
join(Class<T> table,
String... fields)
JOIN表
|
Select.Join |
join(Select select,
String... fields)
JOIN子查询Select语句
|
<T extends Engine> |
leftJoin(Class<T> table,
String... fields)
LEFT JOIN表
|
Select.Join |
leftJoin(Select select,
String... fields)
LEFT JOIN子查询Select语句
|
Select |
limit(int count)
LIMIT 子句由两个独立的子句组成:
LIMIT { count | ALL } OFFSET startcount 声明返回的最大行数,而 start 声明开始返回行之前忽略的行数。 |
<T extends Engine> |
load(Class<T> table)
加载表,一般都是在指定表的key或唯一键时使用此访问加载其他的内容
|
<T extends Engine> |
load(T table)
加载表,一般都是在指定表的key或唯一键时使用此访问加载其他的内容
|
Select |
offset(int start)
从第几页开始取数据
|
Select |
orderBy(String orderby)
混合排序表达式
可选的 ORDER BY 子句有下面的一般形式: ORDER BY expression [ ASC | DESC | USING operator ] [, ...] |
<T extends Engine> |
outerJoin(Class<T> table,
String... fields)
OUTER JOIN表
|
Select.Join |
outerJoin(Select select,
String... fields)
OUTER JOIN子查询Select语句
|
RowSet |
query()
执行查询操作
|
RowSet |
query(boolean isReset)
执行查询操作
|
<T extends Engine> |
rightJoin(Class<T> table,
String... fields)
RIGHT JOIN表
|
Select.Join |
rightJoin(Select select,
String... fields)
RIGHT JOIN子查询Select语句
|
Select |
where(Cnd cnd)
WHERE条件表达式
|
getParams<T extends Engine> Select from(Class<T> table, String... fields) throws SQLException
T - -table - 表对应的Classfields - 需要返回的字段集,默认返回全部SQLException - -<T extends Engine> Select.Join join(Class<T> table, String... fields) throws SQLException
T - -table - 表对应的Classfields - 需要返回的字段集,默认不返回任何字段SQLException - -Select.Join join(Select select, String... fields) throws SQLException
select - 子查询Select语句fields - 需要返回的字段集,默认不返回任何字段SQLException - -<T extends Engine> Select.Join leftJoin(Class<T> table, String... fields) throws SQLException
T - -table - 表对应的Classfields - 需要返回的字段集,默认不返回任何字段SQLException - -Select.Join leftJoin(Select select, String... fields) throws SQLException
select - 子查询Select语句fields - 需要返回的字段集,默认不返回任何字段SQLException - -<T extends Engine> Select.Join rightJoin(Class<T> table, String... fields) throws SQLException
T - -table - 表对应的Classfields - 需要返回的字段集,默认不返回任何字段SQLException - -Select.Join rightJoin(Select select, String... fields) throws SQLException
select - 子查询Select语句fields - 需要返回的字段集,默认不返回任何字段SQLException - -<T extends Engine> Select.Join innerJoin(Class<T> table, String... fields) throws SQLException
T - -table - 表对应的Classfields - 需要返回的字段集,默认不返回任何字段SQLException - -Select.Join innerJoin(Select select, String... fields) throws SQLException
select - 子查询Select语句fields - 需要返回的字段集,默认不返回任何字段SQLException - -<T extends Engine> Select.Join outerJoin(Class<T> table, String... fields) throws SQLException
T - -table - 表对应的Classfields - 需要返回的字段集,默认不返回任何字段SQLException - -Select.Join outerJoin(Select select, String... fields) throws SQLException
select - 子查询Select语句fields - 需要返回的字段集,默认不返回任何字段SQLException - -Select orderBy(String orderby)
orderby - -Select groupBy(String... fields)
fields - -Select having(Cnd condition)
condition - HAVING condition这里 condition 与为 WHERE 子句里声明的相同。Select limit(int count)
count - -Select offset(int start)
start - -int count() throws SQLException
SQLException - -<T extends Engine> List<T> go() throws SQLException
T - -SQLException - -<T extends Engine> List<T> go(boolean isReset) throws SQLException
T - -isReset - 是否重置sql语句SQLException - -RowSet query() throws SQLException
SQLException - -RowSet query(boolean isReset) throws SQLException
isReset - 是否需要即使重置selectSQLException - -<T extends Engine> boolean load(T table) throws SQLException
T - -table - 需要加载的表实体SQLException - -<T extends Engine> T load(Class<T> table) throws SQLException
T - -table - 需要加载的表实体SQLException - -Copyright © 2020 Pivotal Software, Inc.. All rights reserved.