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
Modifier and TypeFieldDescriptionprivate List<EqualsStatement>
Thestatements
to set valuesprivate TableRef
Thetable
to updateprivate Conditional
Thewhere statement
-
Constructor Summary
ModifierConstructorDescriptionprivate
Not allowed to instantiate outside SQLUpdateStatement -
Method Summary
Modifier and TypeMethodDescriptionbuild()
Builds a newSQLUpdateStatement
based on the set parameters after checking for errorsprivate void
Throws an IllegalArgumentException if any errors are found in the parameterssetStatements
(EqualsStatement... setStatements) setStatements
(List<EqualsStatement> setStatements) whereStatement
(Conditional whereStatement)
-
Field Details
-
table
Thetable
to update -
setStatements
Thestatements
to set values -
whereStatement
Thewhere statement
-
-
Constructor Details
-
SQLUpdateStatementBuilder
private SQLUpdateStatementBuilder()Not allowed to instantiate outside SQLUpdateStatement
-
-
Method Details
-
table
- Specified by:
table
in interfaceSQLUpdateStatement.Table
- Parameters:
table
- Thetable
to update- Returns:
- this, to continue building
-
setStatements
- Specified by:
setStatements
in interfaceSQLUpdateStatement.SetStatements
- Parameters:
setStatements
- Thestatements
to set values- Returns:
- this, to continue building
-
setStatements
- Specified by:
setStatements
in interfaceSQLUpdateStatement.SetStatements
- Parameters:
setStatements
- Thestatements
to set values- Returns:
- this, to continue building
-
whereStatement
- Specified by:
whereStatement
in 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 newSQLUpdateStatement
based on the set parameters after checking for errors- Specified by:
build
in interfaceSQLUpdateStatement.WhereStatementAndBuild
- Returns:
- The newly built
SQLUpdateStatement
-