Package org.h2.command.dml
Class Update
- java.lang.Object
-
- org.h2.command.Prepared
-
- org.h2.command.dml.DataChangeStatement
-
- org.h2.command.dml.FilteredDataChangeStatement
-
- org.h2.command.dml.Update
-
public final class Update extends FilteredDataChangeStatement
This class represents the statement UPDATE
-
-
Field Summary
Fields Modifier and Type Field Description private TableFilter
fromTableFilter
private Insert
onDuplicateKeyInsert
private SetClauseList
setClauseList
-
Fields inherited from class org.h2.command.dml.FilteredDataChangeStatement
condition, fetchExpr, targetTableFilter
-
Fields inherited from class org.h2.command.Prepared
create, parameters, prepareAlways, session, sqlStatement, sqlTokens
-
-
Constructor Summary
Constructors Constructor Description Update(SessionLocal session)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description void
collectDependencies(java.util.HashSet<DbObject> dependencies)
Find and collect all DbObjects, this Prepared depends on.(package private) static void
doUpdate(Prepared prepared, SessionLocal session, Table table, LocalResult rows)
Insert
getOnDuplicateKeyInsert()
java.lang.String
getPlanSQL(int sqlFlags)
Get the SQL statement with the execution plan.java.lang.String
getStatementName()
Return the name of this statement.int
getType()
Get the command type as defined in CommandInterfacevoid
prepare()
Prepare this statement.void
setFromTableFilter(TableFilter tableFilter)
(package private) void
setOnDuplicateKeyInsert(Insert onDuplicateKeyInsert)
void
setSetClauseList(SetClauseList setClauseList)
long
update(ResultTarget deltaChangeCollector, DataChangeDeltaTable.ResultOption deltaChangeCollectionMode)
Execute the statement with specified delta change collector and collection mode.-
Methods inherited from class org.h2.command.dml.FilteredDataChangeStatement
appendFilterCondition, getCondition, getTable, getTableFilter, nextRow, setCondition, setFetch, setTableFilter
-
Methods inherited from class org.h2.command.dml.DataChangeStatement
isCacheable, isTransactional, queryMeta, update
-
Methods inherited from class org.h2.command.Prepared
checkCanceled, checkParameters, getCteCleanups, getCurrentRowNumber, getObjectId, getParameters, getPersistedObjectId, getSession, getSimpleSQL, getSQL, getSQLTokens, isQuery, isReadOnly, needRecompile, query, setCommand, setCteCleanups, setCurrentRowNumber, setParameterList, setPersistedObjectId, setPrepareAlways, setRow, setSession, setSQL, toString
-
-
-
-
Field Detail
-
setClauseList
private SetClauseList setClauseList
-
onDuplicateKeyInsert
private Insert onDuplicateKeyInsert
-
fromTableFilter
private TableFilter fromTableFilter
-
-
Constructor Detail
-
Update
public Update(SessionLocal session)
-
-
Method Detail
-
setSetClauseList
public void setSetClauseList(SetClauseList setClauseList)
-
setFromTableFilter
public void setFromTableFilter(TableFilter tableFilter)
-
update
public long update(ResultTarget deltaChangeCollector, DataChangeDeltaTable.ResultOption deltaChangeCollectionMode)
Description copied from class:DataChangeStatement
Execute the statement with specified delta change collector and collection mode.- Specified by:
update
in classDataChangeStatement
- Parameters:
deltaChangeCollector
- target resultdeltaChangeCollectionMode
- collection mode- Returns:
- the update count
-
doUpdate
static void doUpdate(Prepared prepared, SessionLocal session, Table table, LocalResult rows)
-
getPlanSQL
public java.lang.String getPlanSQL(int sqlFlags)
Description copied from class:Prepared
Get the SQL statement with the execution plan.- Overrides:
getPlanSQL
in classPrepared
- Parameters:
sqlFlags
- formatting flags- Returns:
- the execution plan
-
prepare
public void prepare()
Description copied from class:Prepared
Prepare this statement.
-
getType
public int getType()
Description copied from class:Prepared
Get the command type as defined in CommandInterface
-
getStatementName
public java.lang.String getStatementName()
Description copied from class:DataChangeStatement
Return the name of this statement.- Specified by:
getStatementName
in classDataChangeStatement
- Returns:
- the short name of this statement.
-
collectDependencies
public void collectDependencies(java.util.HashSet<DbObject> dependencies)
Description copied from class:Prepared
Find and collect all DbObjects, this Prepared depends on.- Overrides:
collectDependencies
in classPrepared
- Parameters:
dependencies
- collection of dependencies to populate
-
getOnDuplicateKeyInsert
public Insert getOnDuplicateKeyInsert()
-
setOnDuplicateKeyInsert
void setOnDuplicateKeyInsert(Insert onDuplicateKeyInsert)
-
-