Class SQLInsertStatement.SQLInsertStatementBuilder
java.lang.Object
com.github.tadukoo.database.mysql.syntax.statement.SQLInsertStatement.SQLInsertStatementBuilder
- All Implemented Interfaces:
SQLInsertStatement.Build,SQLInsertStatement.ColumnsAndValuesOrSelectStatement,SQLInsertStatement.Table
- Enclosing class:
- SQLInsertStatement
public static class SQLInsertStatement.SQLInsertStatementBuilder
extends Object
implements SQLInsertStatement.Table, SQLInsertStatement.ColumnsAndValuesOrSelectStatement, SQLInsertStatement.Build
A builder class used to build a
SQLInsertStatement. It takes the following parameters:
| Parameter | Description | Default or Required |
|---|---|---|
| table | The table to insert into |
Required |
| columns | The columns to insert into |
Defaults to empty list |
| values | The values to insert | Defaults to empty list - need either this or select statement |
| selectStmt | The select statement to use for values to insert |
Defaults to null - need either this or values |
- Version:
- Alpha v.0.3
- Author:
- Logan Ferree (Tadukoo)
-
Field Summary
FieldsModifier and TypeFieldDescriptionThecolumnsto insert intoprivate SQLSelectStatementTheselect statementto use for values to insertprivate TableRefThetableto insert intoThe values to insert -
Constructor Summary
ConstructorsModifierConstructorDescriptionprivateNot allowed to instantiate outside SQLInsertStatement -
Method Summary
Modifier and TypeMethodDescriptionbuild()Creates a newSQLInsertStatementafter checking for errorsprivate voidChecks for any errors and throws an IllegalArgumentException if any are foundselectStmt(SQLSelectStatement selectStmt)
-
Field Details
-
table
Thetableto insert into -
columns
Thecolumnsto insert into -
values
The values to insert -
selectStmt
Theselect statementto use for values to insert
-
-
Constructor Details
-
SQLInsertStatementBuilder
private SQLInsertStatementBuilder()Not allowed to instantiate outside SQLInsertStatement
-
-
Method Details
-
table
- Specified by:
tablein interfaceSQLInsertStatement.Table- Parameters:
table- Thetableto insert into- Returns:
- this, to continue building
-
columns
- Specified by:
columnsin interfaceSQLInsertStatement.ColumnsAndValuesOrSelectStatement- Parameters:
columns- Thecolumnsto insert into- Returns:
- this, to continue building
-
columns
- Specified by:
columnsin interfaceSQLInsertStatement.ColumnsAndValuesOrSelectStatement- Parameters:
columns- Acolumnto insert into- Returns:
- this, to continue building
-
values
- Specified by:
valuesin interfaceSQLInsertStatement.ColumnsAndValuesOrSelectStatement- Parameters:
values- The values to insert- Returns:
- this, to continue building
-
values
- Specified by:
valuesin interfaceSQLInsertStatement.ColumnsAndValuesOrSelectStatement- Parameters:
values- The values to insert- Returns:
- this, to continue building
-
selectStmt
- Specified by:
selectStmtin interfaceSQLInsertStatement.ColumnsAndValuesOrSelectStatement- Parameters:
selectStmt- Theselect statementto use for values to insert- Returns:
- this, to continue building
-
checkForErrors
private void checkForErrors()Checks for any errors and throws an IllegalArgumentException if any are found -
build
Creates a newSQLInsertStatementafter checking for errors- Specified by:
buildin interfaceSQLInsertStatement.Build- Returns:
- The newly built
SQLInsertStatement
-