public class MySqlUpsert extends Object implements IUpsert
A batch-able upsert strategy where when a row to be inserted would cause a duplicate value in a UNIQUE index or PRIMARY KEY, an UPDATE of the old row occurs.
Sample Generated SQL:
INSERT INTO tableName (col1, col2, col3) VALUES (?, ?, ?)
ON DUPLICATE KEY UPDATE col1=?, col2=?, col3=?
| Constructor and Description |
|---|
MySqlUpsert() |
| Modifier and Type | Method and Description |
|---|---|
void |
addBatch() |
void |
addExceptionProperties(DataException exception) |
MySqlUpsert |
clone() |
void |
close() |
void |
executeBatch() |
void |
executeUpdate() |
boolean |
isBatchSupported() |
boolean |
isDebug()
Indicates if the generated SQL should be logged (default false).
|
void |
prepare(JdbcUpsertWriter writer,
Record record) |
MySqlUpsert |
setDebug(boolean debug)
Set to
true to log generated SQL (default false). |
void |
setValues(JdbcUpsertWriter writer,
Record record) |
public boolean isDebug()
IUpsertpublic MySqlUpsert setDebug(boolean debug)
IUpserttrue to log generated SQL (default false).public void prepare(JdbcUpsertWriter writer, Record record) throws Throwable
public void setValues(JdbcUpsertWriter writer, Record record) throws Throwable
public void executeUpdate()
throws Throwable
executeUpdate in interface IUpsertThrowablepublic boolean isBatchSupported()
isBatchSupported in interface IUpsertpublic void addBatch()
throws Throwable
public void executeBatch()
throws Throwable
executeBatch in interface IUpsertThrowablepublic MySqlUpsert clone()
public void close()
throws Throwable
public void addExceptionProperties(DataException exception)
addExceptionProperties in interface IUpsertCopyright (c) 2006-2025 North Concepts Inc. All Rights Reserved.