AstVisitor, UpdateAsStep, UpdateFinalStep, UpdateFromStep, UpdateReturningStep, UpdateSetManyStep, UpdateSetStep, UpdateWhereFirstStep, UpdateWhereManySteps, Querypublic class UpdateImpl extends AbstractQuery implements UpdateAsStep, UpdateSetStep, UpdateSetManyStep, UpdateFromStep, UpdateWhereFirstStep, UpdateWhereManySteps, UpdateReturningStep
| Constructor | Description |
|---|---|
UpdateImpl(Expression table) |
|
UpdateImpl(Expression table,
boolean only) |
| Modifier and Type | Method | Description |
|---|---|---|
UpdateImpl |
and(Conditions conditions) |
For full information see the
Conditions.and(Conditions) method. |
<T> UpdateImpl |
and(T left,
T operator,
T right) |
For full information see the
Conditions.and(Object, Object, Object) method. |
UpdateImpl |
andExists(Query query) |
For full information see the
Conditions.andExists(Query) method. |
UpdateImpl |
andNot(Conditions conditions) |
For full information see the
Conditions.andNot(Conditions) method. |
<T> UpdateImpl |
andNot(T left,
T operator,
T right) |
For full information see the
Conditions.andNot(Object, Object, Object) method. |
UpdateImpl |
andNotExists(Query query) |
For full information see the
Conditions.andNotExists(Query) method. |
UpdateImpl |
as(java.lang.String alias) |
A substitute name for the target table.
|
void |
assemble(AbstractSyntaxTree tree) |
Visits SQL query making a tree from its clauses.
|
UpdateImpl |
from(java.lang.String... tables) |
Set list of tables that are used in WHERE or SET clauses.
|
UpdateImpl |
from(Expression... tables) |
Set list of tables that are used in WHERE or SET clauses.
|
UpdateImpl |
or(Conditions conditions) |
For full information see the
Conditions.or(Conditions) method. |
<T> UpdateImpl |
or(T left,
T operator,
T right) |
For full information see the
Conditions.or(Object, Object, Object) method. |
UpdateImpl |
orExists(Query query) |
For full information see the
Conditions.orExists(Query) method. |
UpdateImpl |
orNot(Conditions conditions) |
For full information see the
Conditions.orNot(Conditions) method. |
<T> UpdateImpl |
orNot(T left,
T operator,
T right) |
For full information see the
Conditions.orNot(Object, Object, Object) method. |
UpdateImpl |
orNotExists(Query query) |
For full information see the
Conditions.orNot(Conditions) method. |
UpdateImpl |
returning(Expression... output) |
Set list of expressions that to be computed after each row is updated.
|
<T> UpdateImpl |
returning(T... output) |
Set list of expressions that to be computed after each row is updated.
|
<T> UpdateImpl |
set(java.lang.String column,
T value) |
Set a column name and an expression that is be assigned to the column.
|
UpdateImpl |
set(Expression listColumns,
Query subSelect) |
Set a columns names and a sub-select that is be assigned to the columns.
|
UpdateImpl |
set(Expression listColumns,
Expression listValues) |
Set a columns names and an expression list that are be assigned to the columns.
|
UpdateImpl |
where(Conditions conditions) |
This function useful in a few case:
When the
conditions is a special case of condition,
like Queryman.conditionBetween(Object, Object, Object), or
Queryman.conditionSome(Object, Object, Query) etc. |
<T> UpdateImpl |
where(T left,
T operator,
T right) |
Example:
// SELECT * FROM book WHERE year > 2010
select("*")
.from("book")
.where("year", ">", "2010")
.sql()
|
UpdateImpl |
whereCurrentOf(java.lang.String cursorName) |
Set a cursor name created by DECLARE statement.
|
UpdateImpl |
whereExists(Query query) |
Example:
// SELECT * FROM book WHERE EXISTS (SELECT * FROM author)
select("*")
.from("book")
.whereExists(select("*").from("authors"))
.sql()
|
buildPreparedStatement, sql, toStringclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitbuildPreparedStatement, sqlpublic UpdateImpl(Expression table)
public UpdateImpl(Expression table, boolean only)
public void assemble(AbstractSyntaxTree tree)
AstVisitorassemble in interface AstVisitortree - - abstract syntax treepublic final UpdateImpl as(java.lang.String alias)
UpdateAsStepas in interface UpdateAsStepalias - aliaspublic final <T> UpdateImpl where(T left, T operator, T right)
UpdateWhereFirstStep
// SELECT * FROM book WHERE year > 2010
select("*")
.from("book")
.where("year", ">", "2010")
.sql()
where in interface UpdateWhereFirstStepT - String, Expression, Operator or Query objectleft - left operandoperator - operatorright - right operandpublic final UpdateImpl where(Conditions conditions)
UpdateWhereFirstStepconditions is a special case of condition,
like Queryman.conditionBetween(Object, Object, Object), or
Queryman.conditionSome(Object, Object, Query) etc.
See the first example.
conditions is a group of conditions are joined by AND, AND NOT,
OR and OR NOT operators. These conditions are being a grouped condition,
and will be surrounded by parentheses.
See the second example.
// SELECT * FROM book WHERE id BETWEEN 1 AND 10
select("*")
.from("book")
.where(conditionBetween("id", "1", "10"))
.sql()
The second example:
// SELECT * FROM book WHERE (id BETWEEN 1 AND 10 AND name = 'Advanced SQL')
select("*")
.from("book")
.where(
conditionBetween("id", "1", "10")
.and(asName("name"), operator("="), asString("Advanced SQL"))
)
.sql()
where in interface UpdateWhereFirstStepconditions - conditionQueryman.condition(Object, Object, Object)public final UpdateImpl whereExists(Query query)
UpdateWhereFirstStep
// SELECT * FROM book WHERE EXISTS (SELECT * FROM author)
select("*")
.from("book")
.whereExists(select("*").from("authors"))
.sql()
whereExists in interface UpdateWhereFirstStepquery - subquerypublic final UpdateImpl whereCurrentOf(java.lang.String cursorName)
UpdateWhereFirstStepwhereCurrentOf in interface UpdateWhereFirstStepcursorName - cursor name.Queryman.declare(String)public final <T> UpdateImpl and(T left, T operator, T right)
UpdateWhereManyStepsConditions.and(Object, Object, Object) method.and in interface UpdateWhereManyStepsT - String, Expression, Operator or Query objectleft - left operandoperator - operatorright - right operandpublic final UpdateImpl and(Conditions conditions)
UpdateWhereManyStepsConditions.and(Conditions) method.and in interface UpdateWhereManyStepsconditions - conditionspublic final UpdateImpl andExists(Query query)
UpdateWhereManyStepsConditions.andExists(Query) method.andExists in interface UpdateWhereManyStepsquery - subquerypublic final <T> UpdateImpl andNot(T left, T operator, T right)
UpdateWhereManyStepsConditions.andNot(Object, Object, Object) method.andNot in interface UpdateWhereManyStepsT - String, Expression, Operator or Query objectleft - left operandoperator - operatorright - right operandpublic final UpdateImpl andNot(Conditions conditions)
UpdateWhereManyStepsConditions.andNot(Conditions) method.andNot in interface UpdateWhereManyStepsconditions - conditionspublic final UpdateImpl andNotExists(Query query)
UpdateWhereManyStepsConditions.andNotExists(Query) method.andNotExists in interface UpdateWhereManyStepsquery - subquerypublic final <T> UpdateImpl or(T left, T operator, T right)
UpdateWhereManyStepsConditions.or(Object, Object, Object) method.or in interface UpdateWhereManyStepsT - String, Expression, Operator or Query objectleft - left operandoperator - operatorright - right operandpublic final UpdateImpl or(Conditions conditions)
UpdateWhereManyStepsConditions.or(Conditions) method.or in interface UpdateWhereManyStepsconditions - conditionspublic final UpdateImpl orExists(Query query)
UpdateWhereManyStepsConditions.orExists(Query) method.orExists in interface UpdateWhereManyStepsquery - subquerypublic final <T> UpdateImpl orNot(T left, T operator, T right)
UpdateWhereManyStepsConditions.orNot(Object, Object, Object) method.orNot in interface UpdateWhereManyStepsT - String, Expression, Operator or Query objectleft - left operandoperator - operatorright - right operandpublic final UpdateImpl orNot(Conditions conditions)
UpdateWhereManyStepsConditions.orNot(Conditions) method.orNot in interface UpdateWhereManyStepsconditions - conditionspublic final UpdateImpl orNotExists(Query query)
UpdateWhereManyStepsConditions.orNot(Conditions) method.orNotExists in interface UpdateWhereManyStepsquery - subquery@SafeVarargs public final <T> UpdateImpl returning(T... output)
UpdateReturningStepreturning in interface UpdateReturningStepoutput - list of output expressionsUpdateReturningStep.returning(Expression...)public final UpdateImpl returning(Expression... output)
UpdateReturningStepreturning in interface UpdateReturningStepoutput - list of output expressionspublic final <T> UpdateImpl set(java.lang.String column, T value)
UpdateSetStepset in interface UpdateSetStepcolumn - column namevalue - expression valuepublic final UpdateImpl set(Expression listColumns, Expression listValues)
UpdateSetStepset in interface UpdateSetSteplistColumns - columns nameslistValues - expressions listpublic final UpdateImpl set(Expression listColumns, Query subSelect)
UpdateSetStepset in interface UpdateSetSteplistColumns - columns namessubSelect - sub-selectpublic final UpdateImpl from(java.lang.String... tables)
UpdateFromStepfrom in interface UpdateFromSteptables - list of tablesUpdateFromStep.from(Expression...)public final UpdateImpl from(Expression... tables)
UpdateFromStepfrom in interface UpdateFromSteptables - list of tables