public class DMLTransformer extends Session.AbstractResultSetReader
Session.ResultSetReader
that writes the read rows as DML-statements
into the export-script.Modifier and Type | Class and Description |
---|---|
static class |
DMLTransformer.Factory
Factory.
|
Modifier and Type | Field and Description |
---|---|
static java.util.concurrent.atomic.AtomicLong |
numberOfExportedLOBs
Counts the exported LOBs.
|
protected Quoting |
quoting
For quoting of column names.
|
Modifier | Constructor and Description |
---|---|
protected |
DMLTransformer(Table table,
java.io.OutputStreamWriter scriptFileWriter,
boolean upsertOnly,
int maxBodySize,
Session session,
DBMS targetDBMSConfiguration,
ImportFilterTransformer importFilterTransformer,
java.util.concurrent.atomic.AtomicReference<Table> identityInsertTable,
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,
int callerId,
java.lang.String suffix)
Converts cell content to SQL literals.
|
protected Quoting |
createQuoting(Session session) |
void |
flush()
Flushes the export-reader.
|
protected java.lang.String |
qualifiedTableName(Table t)
Gets qualified table name.
|
void |
readCurrentRow(java.sql.ResultSet resultSet)
Reads result-set and writes into export-script.
|
getCellContentConverter, getMetaData, init
public static final java.util.concurrent.atomic.AtomicLong numberOfExportedLOBs
protected Quoting quoting
protected DMLTransformer(Table table, java.io.OutputStreamWriter scriptFileWriter, boolean upsertOnly, int maxBodySize, Session session, DBMS targetDBMSConfiguration, ImportFilterTransformer importFilterTransformer, java.util.concurrent.atomic.AtomicReference<Table> identityInsertTable, 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)upsertOnly
- use 'upsert' statements for all entitiessession
- the sessiontargetDBMSConfiguration
- configuration of the target DBMSexecutionContext
- java.sql.SQLException
protected Quoting createQuoting(Session session) throws java.sql.SQLException
java.sql.SQLException
public void readCurrentRow(java.sql.ResultSet resultSet) throws java.sql.SQLException
resultSet
- the result-setjava.sql.SQLException
protected java.lang.String convertToSql(CellContentConverter cellContentConverter, java.sql.ResultSet resultSet, int i, java.lang.Object content, int callerId, java.lang.String suffix) throws java.sql.SQLException
cellContentConverter
- converterresultSet
- points to current rowi
- current result set indexcontent
- cell contentjava.sql.SQLException
protected java.lang.String qualifiedTableName(Table t)
t
- the tablepublic void flush()
public void close()
close
in interface Session.ResultSetReader
close
in class Session.AbstractResultSetReader