パッケージ org.nkjmlab.sorm4j.sql
インタフェース SelectBuilder
-
- すべてのスーパーインタフェース:
SqlStatementSupplier
- 既知のサブインタフェースのリスト:
SelectQuery<T>
public interface SelectBuilder extends SqlStatementSupplier
API of creates a select SQL statement.- 作成者:
- nkjm
-
-
ネストされたクラスの概要
ネストされたクラス 修飾子とタイプ インタフェース 説明 static classSelectBuilder.ConditionValue object represents conditions of where clause or having clause.static classSelectBuilder.OrderByValue object for order by clause.
-
メソッドの概要
すべてのメソッド staticメソッド インスタンス・メソッド abstractメソッド 修飾子とタイプ メソッド 説明 static SelectBuilder.Conditionand(Object... conds)Creates AND condition with concatenating arguments.static Stringas(String col, String alias)Creates AS alias.StringbuildSql()Creates a select SQL statement from the objects.static SelectBuilder.Conditioncond(String cond)CreatesSelectBuilder.Conditioninstance.static SelectBuilder.Conditioncond(String left, String op, String right)static SelectBuildercreate()CreateSelectBuilderobject.SelectBuilderdistinct()Add distinct keyword to SQL.SelectBuilderfrom(String table)Create from clause.SelectBuildergroupBy(String... columns)Create group by clause.SelectBuilderhaving(String expr)Create having clause.SelectBuilderhaving(SelectBuilder.Condition condition)Create having clause with the givenSelectBuilder.Condition.SelectBuilderlimit(int limit)Create limit clause.SelectBuilderlimit(int limit, int offset)Create limit clause with offset.static SelectBuilder.Conditionor(Object... conds)Creates OR condition with concatenating arguments.static SelectBuilder.OrderByorder(String column, String ascOrDesc)CreateSelectBuilder.OrderByobjects.SelectBuilderorderBy(String column, String ascOrDesc)Create order by clause.SelectBuilderorderBy(SelectBuilder.OrderBy... orderBys)Create order by clause.SelectBuilderselect(String... columns)Create select clause.StringtoPrettyString()Create prettified string.StringtoPrettyString(boolean prettyPrint)Create prettified or plain string.SelectBuilderwhere(String expr)Create where clause.SelectBuilderwhere(SelectBuilder.Condition condition)Create where clause.-
インタフェースから継承されたメソッド org.nkjmlab.sorm4j.sql.SqlStatementSupplier
toSqlStatement
-
-
-
-
メソッドの詳細
-
and
static SelectBuilder.Condition and(Object... conds)
Creates AND condition with concatenating arguments.
For example,
and("id=?", "name=?") returns "id=? and name=?"- パラメータ:
conds- condition in String or Condition- 戻り値:
-
as
static String as(String col, String alias)
Creates AS alias.
For example,
as("avg(score)", "avg_score") returns "avg(score) as avg_score"
-
cond
static SelectBuilder.Condition cond(String cond)
Creates
SelectBuilder.Conditioninstance.For example,
and(cond("id=?"), "name=?") returns "id=? and name=?"
-
cond
static SelectBuilder.Condition cond(String left, String op, String right)
-
create
static SelectBuilder create()
CreateSelectBuilderobject.- 戻り値:
-
or
static SelectBuilder.Condition or(Object... conds)
Creates OR condition with concatenating arguments.
For example,
or("id=?", "name=?") returns "id=? or name=?"
-
order
static SelectBuilder.OrderBy order(String column, String ascOrDesc)
CreateSelectBuilder.OrderByobjects.- パラメータ:
column-ascOrDesc-- 戻り値:
-
buildSql
String buildSql()
Creates a select SQL statement from the objects.- 戻り値:
-
distinct
SelectBuilder distinct()
Add distinct keyword to SQL.
-
from
SelectBuilder from(String table)
Create from clause.from("player") returns "from player"- パラメータ:
table-- 戻り値:
-
groupBy
SelectBuilder groupBy(String... columns)
Create group by clause.- パラメータ:
columns-- 戻り値:
-
having
SelectBuilder having(SelectBuilder.Condition condition)
Create having clause with the givenSelectBuilder.Condition.- パラメータ:
condition-- 戻り値:
-
having
SelectBuilder having(String expr)
Create having clause.- パラメータ:
expr-- 戻り値:
-
limit
SelectBuilder limit(int limit)
Create limit clause.- パラメータ:
limit-- 戻り値:
-
limit
SelectBuilder limit(int limit, int offset)
Create limit clause with offset.- パラメータ:
limit-- 戻り値:
-
orderBy
SelectBuilder orderBy(SelectBuilder.OrderBy... orderBys)
Create order by clause.- パラメータ:
orderBys-- 戻り値:
-
orderBy
SelectBuilder orderBy(String column, String ascOrDesc)
Create order by clause.- パラメータ:
column-ascOrDesc-- 戻り値:
-
select
SelectBuilder select(String... columns)
Create select clause. The default value is "*".For example,
select("id","name","age") returns "select id, name, age"- パラメータ:
columns-- 戻り値:
-
toPrettyString
String toPrettyString()
Create prettified string.- 戻り値:
-
toPrettyString
String toPrettyString(boolean prettyPrint)
Create prettified or plain string.- パラメータ:
prettyPrint-- 戻り値:
-
where
SelectBuilder where(SelectBuilder.Condition condition)
Create where clause.- パラメータ:
condition-- 戻り値:
-
where
SelectBuilder where(String expr)
Create where clause.- パラメータ:
expr-- 戻り値:
-
-