Class SQLUpdateStatement.SQLUpdateStatementBuilder
java.lang.Object
com.github.tadukoo.database.mysql.syntax.statement.SQLUpdateStatement.SQLUpdateStatementBuilder
- All Implemented Interfaces:
SQLUpdateStatement.SetStatements,SQLUpdateStatement.Table,SQLUpdateStatement.WhereStatementAndBuild
- Enclosing class:
- SQLUpdateStatement
public static class SQLUpdateStatement.SQLUpdateStatementBuilder
extends Object
implements SQLUpdateStatement.Table, SQLUpdateStatement.SetStatements, SQLUpdateStatement.WhereStatementAndBuild
A builder to use to build a
SQLUpdateStatement. It takes the following parameters:
| Parameter Name | Description | Default or Required |
|---|---|---|
| table | The table to update |
Required |
| setStatements | The statements to set values |
Required |
| whereStatement | The where statement |
Defaults to null |
- Version:
- Alpha v.0.3
- Author:
- Logan Ferree (Tadukoo)
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate List<EqualsStatement>Thestatementsto set valuesprivate TableRefThetableto updateprivate ConditionalThewhere statement -
Constructor Summary
ConstructorsModifierConstructorDescriptionprivateNot allowed to instantiate outside SQLUpdateStatement -
Method Summary
Modifier and TypeMethodDescriptionbuild()Builds a newSQLUpdateStatementbased on the set parameters after checking for errorsprivate voidThrows an IllegalArgumentException if any errors are found in the parameterssetStatements(EqualsStatement... setStatements) setStatements(List<EqualsStatement> setStatements) whereStatement(Conditional whereStatement)
-
Field Details
-
table
Thetableto update -
setStatements
Thestatementsto set values -
whereStatement
Thewhere statement
-
-
Constructor Details
-
SQLUpdateStatementBuilder
private SQLUpdateStatementBuilder()Not allowed to instantiate outside SQLUpdateStatement
-
-
Method Details
-
table
- Specified by:
tablein interfaceSQLUpdateStatement.Table- Parameters:
table- Thetableto update- Returns:
- this, to continue building
-
setStatements
- Specified by:
setStatementsin interfaceSQLUpdateStatement.SetStatements- Parameters:
setStatements- Thestatementsto set values- Returns:
- this, to continue building
-
setStatements
- Specified by:
setStatementsin interfaceSQLUpdateStatement.SetStatements- Parameters:
setStatements- Thestatementsto set values- Returns:
- this, to continue building
-
whereStatement
- Specified by:
whereStatementin interfaceSQLUpdateStatement.WhereStatementAndBuild- Parameters:
whereStatement- Thewhere statement- Returns:
- this, to continue building
-
checkForErrors
private void checkForErrors()Throws an IllegalArgumentException if any errors are found in the parameters -
build
Builds a newSQLUpdateStatementbased on the set parameters after checking for errors- Specified by:
buildin interfaceSQLUpdateStatement.WhereStatementAndBuild- Returns:
- The newly built
SQLUpdateStatement
-