Class SQLSelectStatement.SQLSelectStatementBuilder
java.lang.Object
com.github.tadukoo.database.mysql.syntax.statement.SQLSelectStatement.SQLSelectStatementBuilder
- All Implemented Interfaces:
SQLSelectStatement.Build
,SQLSelectStatement.ColumnsOrTables
,SQLSelectStatement.DistinctOrColumnsOrTables
,SQLSelectStatement.FromTables
,SQLSelectStatement.WhereStatementAndBuild
- Enclosing class:
- SQLSelectStatement
public static class SQLSelectStatement.SQLSelectStatementBuilder
extends Object
implements SQLSelectStatement.DistinctOrColumnsOrTables, SQLSelectStatement.ColumnsOrTables, SQLSelectStatement.FromTables, SQLSelectStatement.WhereStatementAndBuild, SQLSelectStatement.Build
A builder to build a
SQLSelectStatement
. It takes the following parameters:
Parameter | Description | Required or Default |
---|---|---|
distinct | Whether to select distinct columns or not | Defaults to false |
returnColumns | The columns to be selected | Defaults to an empty list (will select all then) |
fromTables | The tables to grab data from | Required |
whereStatement | The conditional where statement | Defaults to null |
- Version:
- Alpha v.0.3
- Author:
- Logan Ferree (Tadukoo)
-
Field Summary
Modifier and TypeFieldDescriptionprivate boolean
Whether to select distinct columns or notThe tables to grab data fromThe columns to be selectedprivate Conditional
The conditional where statement -
Constructor Summary
ModifierConstructorDescriptionprivate
Not allowed to instantiate outside SQLSelectStatement -
Method Summary
Modifier and TypeMethodDescriptionbuild()
Builds a newSQLSelectStatement
using the set parametersprivate void
Checks for any errors with the set parametersdistinct()
Sets distinct to true for this select statementfromTables
(TableRef... fromTables) fromTables
(List<TableRef> fromTables) returnColumns
(ColumnRef... returnColumns) returnColumns
(List<ColumnRef> returnColumns) whereStatement
(Conditional whereStatement)
-
Field Details
-
distinct
private boolean distinctWhether to select distinct columns or not -
returnColumns
The columns to be selected -
fromTables
The tables to grab data from -
whereStatement
The conditional where statement
-
-
Constructor Details
-
SQLSelectStatementBuilder
private SQLSelectStatementBuilder()Not allowed to instantiate outside SQLSelectStatement
-
-
Method Details
-
distinct
Sets distinct to true for this select statement- Specified by:
distinct
in interfaceSQLSelectStatement.DistinctOrColumnsOrTables
- Returns:
- this, to continue building
-
returnColumns
- Specified by:
returnColumns
in interfaceSQLSelectStatement.ColumnsOrTables
- Parameters:
returnColumns
- The columns to be selected- Returns:
- this, to continue building
-
returnColumns
- Specified by:
returnColumns
in interfaceSQLSelectStatement.ColumnsOrTables
- Parameters:
returnColumns
- The columns to be selected- Returns:
- this, to continue building
-
fromTables
- Specified by:
fromTables
in interfaceSQLSelectStatement.FromTables
- Parameters:
fromTables
- The tables to grab data from- Returns:
- this, to continue building
-
fromTables
- Specified by:
fromTables
in interfaceSQLSelectStatement.FromTables
- Parameters:
fromTables
- The tables to grab data from- Returns:
- this, to continue building
-
whereStatement
- Specified by:
whereStatement
in interfaceSQLSelectStatement.WhereStatementAndBuild
- Parameters:
whereStatement
- The conditional where statement- Returns:
- this, to continue building
-
checkForErrors
private void checkForErrors()Checks for any errors with the set parameters -
build
Builds a newSQLSelectStatement
using the set parameters- Specified by:
build
in interfaceSQLSelectStatement.Build
- Returns:
- The newly built
SQLSelectStatement
-