Class SelectStatement
- java.lang.Object
-
- com.mrivanplays.sqlhelper.statement.SelectStatement
-
public final class SelectStatement extends Object
Represents an sql "SELECT" statement
-
-
Constructor Summary
Constructors Constructor Description SelectStatement(SQLConnectionFactory connectionFactory, Executor async)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description SelectStatement
columns(String... columns)
Mark which columns we should select.SelectStatement
everything()
Mark that we should select every value in the table.StatementCompletionStage<StatementResultSet>
executeQuery()
Executes the query.SelectStatement
from(String table)
Mark the table from which we're going to selectSelectStatement
limit(int results)
Mark the results limit.SelectStatement
where(String[] keys, Object[] values)
Mark the condition which the select should follow.
-
-
-
Constructor Detail
-
SelectStatement
public SelectStatement(SQLConnectionFactory connectionFactory, Executor async)
-
-
Method Detail
-
everything
public SelectStatement everything()
Mark that we should select every value in the table.- Returns:
- this instance for chaining
-
columns
public SelectStatement columns(String... columns)
Mark which columns we should select.- Parameters:
columns
- the columns we want to select- Returns:
- this instance for chaining
-
from
public SelectStatement from(String table)
Mark the table from which we're going to select- Parameters:
table
- table name- Returns:
- this instance for chaining
-
where
public SelectStatement where(String[] keys, Object[] values)
Mark the condition which the select should follow.- Parameters:
keys
- keysvalues
- values- Returns:
- this instance for chaining.
-
limit
public SelectStatement limit(int results)
Mark the results limit.- Parameters:
results
- maximum queries we should get- Returns:
- this instance for chaining
-
executeQuery
public StatementCompletionStage<StatementResultSet> executeQuery()
Executes the query.- Returns:
- statement completion stage
-
-