public class UpdateTransformer extends Session.AbstractResultSetReader
Session.ResultSetReader
that writes the read rows as UPDATE statements
into the export-script.Constructor and Description |
---|
UpdateTransformer(Table table,
java.util.Set<Column> columns,
java.io.OutputStreamWriter scriptFileWriter,
int maxBodySize,
Session session,
DBMS targetDBMSConfiguration,
ImportFilterTransformer importFilterTransformer,
boolean inSourceSchema,
java.lang.String reason,
ExecutionContext executionContext)
Constructor.
|
Modifier and Type | Method and Description |
---|---|
void |
close()
Flushes the export-reader.
|
protected java.lang.String |
convertToSql(CellContentConverter cellContentConverter,
java.sql.ResultSet resultSet,
int i,
java.lang.Object content)
Converts cell content to SQL literals.
|
void |
flush()
Flushes the export-reader.
|
void |
readCurrentRow(java.sql.ResultSet resultSet)
Reads result-set and writes into export-script.
|
getCellContentConverter, getMetaData, init
public UpdateTransformer(Table table, java.util.Set<Column> columns, java.io.OutputStreamWriter scriptFileWriter, int maxBodySize, Session session, DBMS targetDBMSConfiguration, ImportFilterTransformer importFilterTransformer, boolean inSourceSchema, java.lang.String reason, ExecutionContext executionContext) throws java.sql.SQLException
table
- the table to read fromscriptFileWriter
- the file to write tomaxBodySize
- maximum length of SQL values list (for generated inserts)session
- the sessiontargetDBMSConfiguration
- configuration of the target DBMSinSourceSchema
- if true
, use source-schema-mapping, else use schema-mappingreason
- to be written as commentjava.sql.SQLException
protected java.lang.String convertToSql(CellContentConverter cellContentConverter, java.sql.ResultSet resultSet, int i, java.lang.Object content) throws java.sql.SQLException
cellContentConverter
- converterresultSet
- points to current rowi
- current result set indexcontent
- cell contentjava.sql.SQLException
public void readCurrentRow(java.sql.ResultSet resultSet) throws java.sql.SQLException
resultSet
- the result-setjava.sql.SQLException
public void flush()
public void close()
close
in interface Session.ResultSetReader
close
in class Session.AbstractResultSetReader