パッケージ org.nkjmlab.sorm4j.sql

クラス SelectSql.Builder

java.lang.Object
org.nkjmlab.sorm4j.sql.SelectSql.Builder
含まれているクラス:
SelectSql

public static class SelectSql.Builder extends Object
  • メソッドの詳細

    • build

      public String build()
      Creates a select SQL statement from the objects.
      戻り値:
    • distinct

      public SelectSql.Builder distinct()
      Add distinct keyword to SQL.
    • from

      public SelectSql.Builder from(String table)
      Creates from clause.

       from("player") returns "from player"
       
      パラメータ:
      table -
      戻り値:
    • groupBy

      public SelectSql.Builder groupBy(String... columns)
      Creates group by clause.
      パラメータ:
      columns -
      戻り値:
    • having

      public SelectSql.Builder having(SelectSql.Condition condition)
      Creates having clause with the given SelectSql.Condition.
      パラメータ:
      condition -
      戻り値:
    • having

      public SelectSql.Builder having(String expr)
      Creates having clause.
      パラメータ:
      expr -
      戻り値:
    • limit

      public SelectSql.Builder limit(int limit)
      Creates limit clause.
      パラメータ:
      limit -
      戻り値:
    • limit

      public SelectSql.Builder limit(int limit, int offset)
      Creates limit clause with offset.
      パラメータ:
      limit -
      戻り値:
    • orderBy

      public SelectSql.Builder orderBy(SelectSql.OrderBy... orderBys)
      Creates order by clause.
      パラメータ:
      orderBys -
      戻り値:
    • orderBy

      public SelectSql.Builder orderBy(String column, String ascOrDesc)
      Creates order by clause.
      パラメータ:
      column -
      ascOrDesc -
      戻り値:
    • select

      public SelectSql.Builder select(String... columns)
      Creates select clause. The default value is "*".

      For example,

       select("id","name","age") returns "select id, name, age"
       
      パラメータ:
      columns -
      戻り値:
    • toPrettyString

      public String toPrettyString()
      Creates prettified string.
      戻り値:
    • toPrettyString

      public String toPrettyString(boolean prettyPrint)
      Creates prettified or plain string.
      パラメータ:
      prettyPrint -
      戻り値:
    • toString

      public String toString()
      オーバーライド:
      toString クラス内 Object
    • where

      public SelectSql.Builder where(SelectSql.Condition condition)
      Creates where clause.
      パラメータ:
      condition -
      戻り値:
    • where

      public SelectSql.Builder where(String expr)
      Creates where clause.
      パラメータ:
      expr -
      戻り値: