パッケージ org.nkjmlab.sorm4j.sql
インタフェース SelectStringBuilder
-
public interface SelectStringBuilderAPI of creates a select SQL statement.- 作成者:
- nkjm
-
-
ネストされたクラスの概要
ネストされたクラス 修飾子とタイプ インタフェース 説明 static classSelectStringBuilder.ConditionValue object represents conditions of where clause or having clause.static classSelectStringBuilder.OrderByValue object for order by clause.
-
メソッドの概要
すべてのメソッド staticメソッド インスタンス・メソッド abstractメソッド 修飾子とタイプ メソッド 説明 static SelectStringBuilder.Conditionand(Object... conds)Creates AND condition with concatenating arguments.static Stringas(String col, String alias)Creates AS alias.Stringbuild()Creates a select SQL statement from the objects.static SelectStringBuilder.Conditioncond(String cond)CreatesSelectStringBuilder.Conditioninstance.static SelectStringBuilder.Conditioncond(String left, String op, String right)static SelectStringBuildercreate()CreateSelectStringBuilderobject.SelectStringBuilderdistinct()Add distinct keyword to SQL.SelectStringBuilderfrom(String table)Create from clause.SelectStringBuildergroupBy(String... columns)Create group by clause.SelectStringBuilderhaving(String expr)Create having clause.SelectStringBuilderhaving(SelectStringBuilder.Condition condition)Create having clause with the givenSelectStringBuilder.Condition.SelectStringBuilderlimit(int limit)Create limit clause.SelectStringBuilderlimit(int limit, int offset)Create limit clause with offset.static SelectStringBuilder.Conditionor(Object... conds)Creates OR condition with concatenating arguments.static SelectStringBuilder.OrderByorder(String column, String ascOrDesc)CreateSelectStringBuilder.OrderByobjects.SelectStringBuilderorderBy(String column, String ascOrDesc)Create order by clause.SelectStringBuilderorderBy(SelectStringBuilder.OrderBy... orderBys)Create order by clause.SelectStringBuilderselect(String... columns)Create select clause.StringtoPrettyString()Create prettified string.StringtoPrettyString(boolean prettyPrint)Create prettified or plain string.SelectStringBuilderwhere(String expr)Create where clause.SelectStringBuilderwhere(SelectStringBuilder.Condition condition)Create where clause.
-
-
-
メソッドの詳細
-
and
static SelectStringBuilder.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 SelectStringBuilder.Condition cond(String cond)
Creates
SelectStringBuilder.Conditioninstance.For example,
and(cond("id=?"), "name=?") returns "id=? and name=?"
-
cond
static SelectStringBuilder.Condition cond(String left, String op, String right)
-
create
static SelectStringBuilder create()
CreateSelectStringBuilderobject.- 戻り値:
-
or
static SelectStringBuilder.Condition or(Object... conds)
Creates OR condition with concatenating arguments.
For example,
or("id=?", "name=?") returns "id=? or name=?"
-
order
static SelectStringBuilder.OrderBy order(String column, String ascOrDesc)
CreateSelectStringBuilder.OrderByobjects.- パラメータ:
column-ascOrDesc-- 戻り値:
-
build
String build()
Creates a select SQL statement from the objects.- 戻り値:
-
distinct
SelectStringBuilder distinct()
Add distinct keyword to SQL.
-
from
SelectStringBuilder from(String table)
Create from clause.from("player") returns "from player"- パラメータ:
table-- 戻り値:
-
groupBy
SelectStringBuilder groupBy(String... columns)
Create group by clause.- パラメータ:
columns-- 戻り値:
-
having
SelectStringBuilder having(SelectStringBuilder.Condition condition)
Create having clause with the givenSelectStringBuilder.Condition.- パラメータ:
condition-- 戻り値:
-
having
SelectStringBuilder having(String expr)
Create having clause.- パラメータ:
expr-- 戻り値:
-
limit
SelectStringBuilder limit(int limit)
Create limit clause.- パラメータ:
limit-- 戻り値:
-
limit
SelectStringBuilder limit(int limit, int offset)
Create limit clause with offset.- パラメータ:
limit-- 戻り値:
-
orderBy
SelectStringBuilder orderBy(SelectStringBuilder.OrderBy... orderBys)
Create order by clause.- パラメータ:
orderBys-- 戻り値:
-
orderBy
SelectStringBuilder orderBy(String column, String ascOrDesc)
Create order by clause.- パラメータ:
column-ascOrDesc-- 戻り値:
-
select
SelectStringBuilder 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
SelectStringBuilder where(SelectStringBuilder.Condition condition)
Create where clause.- パラメータ:
condition-- 戻り値:
-
where
SelectStringBuilder where(String expr)
Create where clause.- パラメータ:
expr-- 戻り値:
-
-