@Internal public final class TableInsertOrUpdateStatementExecutor extends Object implements JdbcBatchStatementExecutor<RowData>
JdbcBatchStatementExecutor
that provides upsert semantics by updating row if it exists
and inserting otherwise. Only used in Table/SQL API.Constructor and Description |
---|
TableInsertOrUpdateStatementExecutor(StatementFactory existStmtFactory,
StatementFactory insertStmtFactory,
StatementFactory updateStmtFactory,
JdbcRowConverter existSetter,
JdbcRowConverter insertSetter,
JdbcRowConverter updateSetter,
java.util.function.Function<RowData,RowData> keyExtractor) |
Modifier and Type | Method and Description |
---|---|
void |
addToBatch(RowData record) |
void |
closeStatements()
Close JDBC related statements.
|
void |
executeBatch()
Submits a batch of commands to the database for execution.
|
void |
prepareStatements(Connection connection)
Create statements from connection.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
keyed, simple
public TableInsertOrUpdateStatementExecutor(StatementFactory existStmtFactory, StatementFactory insertStmtFactory, StatementFactory updateStmtFactory, JdbcRowConverter existSetter, JdbcRowConverter insertSetter, JdbcRowConverter updateSetter, java.util.function.Function<RowData,RowData> keyExtractor)
public void prepareStatements(Connection connection) throws SQLException
JdbcBatchStatementExecutor
prepareStatements
in interface JdbcBatchStatementExecutor<RowData>
SQLException
public void addToBatch(RowData record) throws SQLException
addToBatch
in interface JdbcBatchStatementExecutor<RowData>
SQLException
public void executeBatch() throws SQLException
JdbcBatchStatementExecutor
executeBatch
in interface JdbcBatchStatementExecutor<RowData>
SQLException
public void closeStatements() throws SQLException
JdbcBatchStatementExecutor
closeStatements
in interface JdbcBatchStatementExecutor<RowData>
SQLException
Copyright © 2014–2023 The Apache Software Foundation. All rights reserved.