Class UpdateStatement
java.lang.Object
io.github.torand.fastersql.statement.UpdateStatement
- All Implemented Interfaces:
Sql
,PreparableStatement
Implements an UPDATE statement.
-
Method Summary
Modifier and TypeMethodDescriptionGets the statement parameters introduced by this fragment.set
(Column column, Expression value) Adds an expression value to be updated for a column.Adds a constant value to be updated for a column.Adds an optional value to be updated for a column.Formats object as an SQL fragment.toString()
final UpdateStatement
where
(OptionalPredicate... maybePredicates) Adds optional predicates to the WHERE clause if the wrapped predicates are present.Adds one or more predicates to the WHERE clause.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
Methods inherited from interface io.github.torand.fastersql.statement.PreparableStatement
aliasRefs, columnRefs, toString
-
Method Details
-
set
Adds an expression value to be updated for a column.- Parameters:
column
- the column.value
- the value.- Returns:
- the modified statement.
-
set
Adds a constant value to be updated for a column.- Parameters:
column
- the column.value
- the value.- Returns:
- the modified statement.
-
set
Adds an optional value to be updated for a column. The column is updated only if the optional value is present.- Parameters:
column
- the column.maybeValue
- the optional value.- Returns:
- the modified statement.
-
where
Adds one or more predicates to the WHERE clause.- Parameters:
predicates
- the predicates.- Returns:
- the modified statement.
-
where
Adds optional predicates to the WHERE clause if the wrapped predicates are present.- Parameters:
maybePredicates
- the optional predicates.- Returns:
- the modified statement.
-
sql
Description copied from interface:Sql
Formats object as an SQL fragment. -
params
Description copied from interface:Sql
Gets the statement parameters introduced by this fragment. -
toString
-