public class OracleUpsert extends Object implements IUpsert
A batch-able upsert strategy that relies on the SQL Merge statement.
Does not support key-only upsert due to a restriction Oracle has placed on columns referenced in the ON clause.
See: Restrictions on the merge_update_clause.
Sample Generated SQL:
MERGE INTO tableName target USING dual ON ( ID=? )
WHEN NOT MATCHED THEN INSERT (col1, col2, col3) VALUES (?, ?, ?)
WHEN MATCHED THEN UPDATE SET col1=?, col2=?, col3=?
Constructor and Description |
---|
OracleUpsert() |
Modifier and Type | Method and Description |
---|---|
void |
addBatch() |
void |
addExceptionProperties(DataException exception) |
OracleUpsert |
clone() |
void |
close() |
void |
executeBatch() |
void |
executeUpdate() |
String |
getMergeCondition() |
String |
getMergeSql() |
PreparedStatement |
getMergeStatement() |
boolean |
isBatchSupported() |
boolean |
isDebug()
Indicates if the generated SQL should be logged (default false).
|
boolean |
isTerminateWithSemicolon() |
void |
prepare(JdbcUpsertWriter writer,
Record record) |
OracleUpsert |
setDebug(boolean debug)
Set to
true to log generated SQL (default false). |
OracleUpsert |
setMergeCondition(String mergeCondition) |
OracleUpsert |
setTerminateWithSemicolon(boolean terminateWithSemicolon) |
void |
setValues(JdbcUpsertWriter writer,
Record record) |
public String getMergeSql()
public PreparedStatement getMergeStatement()
public String getMergeCondition()
public OracleUpsert setMergeCondition(String mergeCondition)
public boolean isTerminateWithSemicolon()
public OracleUpsert setTerminateWithSemicolon(boolean terminateWithSemicolon)
public boolean isDebug()
IUpsert
public OracleUpsert 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 OracleUpsert 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.