Package com.github.eikecochu.sqlbuilder
Class Select
- java.lang.Object
-
- com.github.eikecochu.sqlbuilder.QueryPartImpl<Select>
-
- com.github.eikecochu.sqlbuilder.Select
-
- All Implemented Interfaces:
BeforeFrom<Select>,QueryPart,QueryPartLinked<Select>,QueryPartSQL<Select>
public class Select extends QueryPartImpl<Select> implements BeforeFrom<Select>
The SELECT expression. Start with this expression to prepare a SELECT query to select elements from the database.
-
-
Constructor Summary
Constructors Modifier Constructor Description protectedSelect(BeforeSelect<?> parent)Select(java.lang.String... columns)Create a new SELECT statement
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Selectall()Enable ALL selection.Selectcolumn(java.lang.String column)Select a column by nameSelectcolumn(java.lang.String column, java.lang.String alias)Select a column by nameSelectcolumns(java.lang.String... columns)Select multiple columns by nameSelectdistinct()Enable DISTINCT selection.java.lang.Stringstring(QueryOptions options)Transforms this statement into an SQL string-
Methods inherited from class com.github.eikecochu.sqlbuilder.QueryPartImpl
parent, sql
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface com.github.eikecochu.sqlbuilder.BeforeFrom
from, from, from, from, from, from, fromSQL
-
Methods inherited from interface com.github.eikecochu.sqlbuilder.QueryPartLinked
ext, parent, parent
-
Methods inherited from interface com.github.eikecochu.sqlbuilder.QueryPartSQL
sql
-
-
-
-
Constructor Detail
-
Select
public Select(java.lang.String... columns)
Create a new SELECT statement- Parameters:
columns- The column names to select
-
Select
protected Select(BeforeSelect<?> parent)
-
-
Method Detail
-
distinct
public Select distinct()
Enable DISTINCT selection. Disables ALL selection.- Returns:
- This SELECT statement
-
all
public Select all()
Enable ALL selection. Disables DISTINCT selection.- Returns:
- This SELECT statement
-
column
public Select column(java.lang.String column)
Select a column by name- Parameters:
column- The column name of the column to select- Returns:
- This SELECT statement
-
column
public Select column(java.lang.String column, java.lang.String alias)
Select a column by name- Parameters:
column- The column name of the column to selectalias- The column alias, will be appended to the column name- Returns:
- This SELECT statement
-
columns
public Select columns(java.lang.String... columns)
Select multiple columns by name- Parameters:
columns- The column names of the columns to select- Returns:
- This SELECT statement
-
string
public java.lang.String string(QueryOptions options)
Description copied from interface:QueryPartTransforms this statement into an SQL string
-
-