クラス SelectQuery<T>
- java.lang.Object
-
- org.nkjmlab.sorm4j.sqlstatement.SelectQuery<T>
-
- すべての実装されたインタフェース:
Query<T>
,SelectBuilder
,SqlWithNamedParameters
,SqlWithOrderedParameters
public class SelectQuery<T> extends Object implements SelectBuilder, SqlWithNamedParameters, SqlWithOrderedParameters, Query<T>
-
-
フィールドの概要
フィールド 修飾子とタイプ フィールド 説明 protected TypedOrmReader<T>
conn
-
コンストラクタの概要
コンストラクタ コンストラクタ 説明 SelectQuery(TypedOrmConnection<T> conn)
-
メソッドの概要
すべてのメソッド インスタンス・メソッド concreteメソッド 修飾子とタイプ メソッド 説明 OrderedParametersQuery<T>
add(Object parameter)
OrderedParametersQuery<T>
add(Object... parameters)
NamedParametersQuery<T>
bind(String key, Object value)
NamedParametersQuery<T>
bindAll(Map<String,Object> namedParams)
String
buildSql()
Creates a select SQL statement from the objects.SelectQuery<T>
distinct()
Add distinct keyword to SQL.SelectQuery<T>
from(String table)
Create from clause.SelectQuery<T>
groupBy(String... columns)
Create group by clause.SelectQuery<T>
having(String expr)
Create having clause.SelectQuery<T>
having(SelectBuilderImpl.Condition condition)
Create having clause with the givenSelectBuilderImpl.Condition
.SelectQuery<T>
limit(int limit)
Create limit clause.SelectQuery<T>
limit(int limit, int offset)
Create limit clause with offset.SelectQuery<T>
orderBy(String column, String ascOrDesc)
SelectQuery<T>
orderBy(SelectBuilderImpl.OrderBy... orderBys)
T
readFirst()
LazyResultSet<T>
readLazy()
List<T>
readList()
T
readOne()
SelectQuery<T>
select(String... columns)
Create select clause.String
toPrettyString()
Create prettified string.String
toPrettyString(boolean prettyPrint)
Create prettified or plain string.SqlStatement
toSqlStatement()
String
toString()
SelectQuery<T>
where(String expr)
Create where clause.SelectQuery<T>
where(SelectBuilderImpl.Condition condition)
Create where clause.
-
-
-
フィールドの詳細
-
conn
protected final TypedOrmReader<T> conn
-
-
コンストラクタの詳細
-
SelectQuery
public SelectQuery(TypedOrmConnection<T> conn)
-
-
メソッドの詳細
-
add
public OrderedParametersQuery<T> add(Object... parameters)
- 定義:
add
インタフェース内SqlWithOrderedParameters
-
add
public OrderedParametersQuery<T> add(Object parameter)
- 定義:
add
インタフェース内SqlWithOrderedParameters
-
bindAll
public NamedParametersQuery<T> bindAll(Map<String,Object> namedParams)
- 定義:
bindAll
インタフェース内SqlWithNamedParameters
-
bind
public NamedParametersQuery<T> bind(String key, Object value)
- 定義:
bind
インタフェース内SqlWithNamedParameters
-
toSqlStatement
public SqlStatement toSqlStatement()
- 定義:
toSqlStatement
インタフェース内SqlWithNamedParameters
- 定義:
toSqlStatement
インタフェース内SqlWithOrderedParameters
-
select
public SelectQuery<T> select(String... columns)
インタフェースからコピーされた説明:SelectBuilder
Create select clause.For example,
select("id","name","age") returns "select id, name, age"
- 定義:
select
インタフェース内SelectBuilder
- 戻り値:
-
distinct
public SelectQuery<T> distinct()
インタフェースからコピーされた説明:SelectBuilder
Add distinct keyword to SQL.- 定義:
distinct
インタフェース内SelectBuilder
-
from
public SelectQuery<T> from(String table)
インタフェースからコピーされた説明:SelectBuilder
Create from clause.from("player") returns "from player"
- 定義:
from
インタフェース内SelectBuilder
- 戻り値:
-
groupBy
public SelectQuery<T> groupBy(String... columns)
インタフェースからコピーされた説明:SelectBuilder
Create group by clause.- 定義:
groupBy
インタフェース内SelectBuilder
- 戻り値:
-
having
public SelectQuery<T> having(SelectBuilderImpl.Condition condition)
インタフェースからコピーされた説明:SelectBuilder
Create having clause with the givenSelectBuilderImpl.Condition
.- 定義:
having
インタフェース内SelectBuilder
- 戻り値:
-
having
public SelectQuery<T> having(String expr)
インタフェースからコピーされた説明:SelectBuilder
Create having clause.- 定義:
having
インタフェース内SelectBuilder
- 戻り値:
-
limit
public SelectQuery<T> limit(int limit)
インタフェースからコピーされた説明:SelectBuilder
Create limit clause.- 定義:
limit
インタフェース内SelectBuilder
- 戻り値:
-
limit
public SelectQuery<T> limit(int limit, int offset)
インタフェースからコピーされた説明:SelectBuilder
Create limit clause with offset.- 定義:
limit
インタフェース内SelectBuilder
- 戻り値:
-
orderBy
public SelectQuery<T> orderBy(String column, String ascOrDesc)
- 定義:
orderBy
インタフェース内SelectBuilder
-
orderBy
public SelectQuery<T> orderBy(SelectBuilderImpl.OrderBy... orderBys)
- 定義:
orderBy
インタフェース内SelectBuilder
-
buildSql
public String buildSql()
インタフェースからコピーされた説明:SelectBuilder
Creates a select SQL statement from the objects.- 定義:
buildSql
インタフェース内SelectBuilder
- 戻り値:
-
toPrettyString
public String toPrettyString()
インタフェースからコピーされた説明:SelectBuilder
Create prettified string.- 定義:
toPrettyString
インタフェース内SelectBuilder
- 戻り値:
-
toPrettyString
public String toPrettyString(boolean prettyPrint)
インタフェースからコピーされた説明:SelectBuilder
Create prettified or plain string.- 定義:
toPrettyString
インタフェース内SelectBuilder
- 戻り値:
-
where
public SelectQuery<T> where(SelectBuilderImpl.Condition condition)
インタフェースからコピーされた説明:SelectBuilder
Create where clause.- 定義:
where
インタフェース内SelectBuilder
- 戻り値:
-
where
public SelectQuery<T> where(String expr)
インタフェースからコピーされた説明:SelectBuilder
Create where clause.- 定義:
where
インタフェース内SelectBuilder
- 戻り値:
-
readLazy
public LazyResultSet<T> readLazy()
-
-