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()
IUpsert
public MySqlUpsert setDebug(boolean debug)
IUpsert
true
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 IUpsert
Throwable
public boolean isBatchSupported()
isBatchSupported
in interface IUpsert
public void addBatch() throws Throwable
public void executeBatch() throws Throwable
executeBatch
in interface IUpsert
Throwable
public MySqlUpsert clone()
public void close() throws Throwable
public void addExceptionProperties(DataException exception)
addExceptionProperties
in interface IUpsert
Copyright (c) 2006-2024 North Concepts Inc. All Rights Reserved.