public final class Insert extends CommandWithValues implements ResultTarget
valuesExpressionListcreate, parameters, prepareAlways, session, sqlStatement, sqlTokens| Constructor and Description |
|---|
Insert(SessionLocal session) |
| Modifier and Type | Method and Description |
|---|---|
void |
addAssignmentForDuplicate(Column column,
Expression expression)
Keep a collection of the columns to pass to update if a duplicate key
happens, for MySQL-style INSERT ...
|
void |
addRow(Value... values)
Add the row to the result set.
|
void |
collectDependencies(java.util.HashSet<DbObject> dependencies)
Find and collect all DbObjects, this Prepared depends on.
|
Value |
getOnDuplicateKeyValue(int columnIndex)
Get the value to use for the specified column in case of a duplicate key.
|
java.lang.String |
getPlanSQL(int sqlFlags)
Get the SQL statement with the execution plan.
|
long |
getRowCount()
Get the number of rows.
|
java.lang.String |
getStatementName()
Return the name of this statement.
|
Table |
getTable()
Return the target table.
|
int |
getType()
Get the command type as defined in CommandInterface
|
boolean |
isCacheable() |
void |
limitsWereApplied()
A hint that sorting, offset and limit may be ignored by this result
because they were applied during the query.
|
void |
setColumns(Column[] columns) |
void |
setCommand(Command command)
Set the command.
|
void |
setIgnore(boolean ignore)
Sets MySQL-style INSERT IGNORE mode or PostgreSQL-style ON CONFLICT
DO NOTHING.
|
void |
setInsertFromSelect(boolean value) |
void |
setOverridingSystem(java.lang.Boolean overridingSystem) |
void |
setQuery(Query query) |
void |
setTable(Table table) |
long |
update(ResultTarget deltaChangeCollector,
DataChangeDeltaTable.ResultOption deltaChangeCollectionMode)
Execute the statement with specified delta change collector and collection mode.
|
addRowisTransactional, prepare, queryMeta, updatecheckCanceled, checkParameters, getCteCleanups, getCurrentRowNumber, getDatabase, getObjectId, getParameters, getPersistedObjectId, getSession, getSimpleSQL, getSQL, getSQLTokens, isQuery, isReadOnly, isRetryable, isWithParamValues, needRecompile, query, setCteCleanups, setCurrentRowNumber, setParameterList, setPersistedObjectId, setPrepareAlways, setRow, setSession, setSQL, setWithParamValues, toStringpublic Insert(SessionLocal session)
public void setCommand(Command command)
PreparedsetCommand in class Preparedcommand - the new commandpublic Table getTable()
DataChangeStatementgetTable in class DataChangeStatementpublic void setTable(Table table)
public void setColumns(Column[] columns)
public void setIgnore(boolean ignore)
ignore - ignore duplicatespublic void setQuery(Query query)
public void setOverridingSystem(java.lang.Boolean overridingSystem)
public void addAssignmentForDuplicate(Column column, Expression expression)
column - the columnexpression - the expressionpublic long update(ResultTarget deltaChangeCollector, DataChangeDeltaTable.ResultOption deltaChangeCollectionMode)
DataChangeStatementupdate in class DataChangeStatementdeltaChangeCollector - target resultdeltaChangeCollectionMode - collection modepublic void addRow(Value... values)
ResultTargetaddRow in interface ResultTargetvalues - the valuespublic long getRowCount()
ResultTargetgetRowCount in interface ResultTargetpublic void limitsWereApplied()
ResultTargetlimitsWereApplied in interface ResultTargetpublic java.lang.String getPlanSQL(int sqlFlags)
PreparedgetPlanSQL in class PreparedsqlFlags - formatting flagspublic int getType()
Preparedpublic java.lang.String getStatementName()
DataChangeStatementgetStatementName in class DataChangeStatementpublic void setInsertFromSelect(boolean value)
public boolean isCacheable()
isCacheable in class DataChangeStatementpublic Value getOnDuplicateKeyValue(int columnIndex)
columnIndex - the column indexpublic void collectDependencies(java.util.HashSet<DbObject> dependencies)
PreparedcollectDependencies in class Prepareddependencies - collection of dependencies to populate