public class PostgreSqlBulkWriter extends FileStatementsWriter
StatementsWriter that writes bulk text files for each table, and references them in "COPY
INTO".AbstractStatementsWriter.AbstractTableStatement, AbstractStatementsWriter.InsertStatement, AbstractStatementsWriter.PlainStatement, AbstractStatementsWriter.UpdateStatement| Constructor and Description |
|---|
PostgreSqlBulkWriter(File sqlFile)
Creates a new instance for a SQL file with UTF-8 encoding.
|
PostgreSqlBulkWriter(File sqlFile,
Charset encoding)
Creates a new instance for a SQL file.
|
PostgreSqlBulkWriter(File directory,
Writer writer,
Charset encoding)
Creates a new instance of
PostgreSqlBulkWriter. |
| Modifier and Type | Method and Description |
|---|---|
void |
close() |
void |
flush()
Flushes any open statements.
|
File |
getDirectory()
The directory for the bulk files.
|
Charset |
getEncoding()
The encoding of the bulk files.
|
List<File> |
getGeneratedFiles()
All files generated by this writer.
|
int |
getStatementsCount()
The count of written statements.
|
void |
writePlainStatement(GeneratorDialect dialect,
String sql)
Writes a plain SQL statement.
|
void |
writeStatement(EntityStatement stmt)
Writes the given statement to a file or database.
|
getStatementSeparator, getWriter, setStatementSeparator, write, writeComment, writeSectionSeparatorcreateInsertStatement, createPlainStatement, createUpdateStatementclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waittruncateTablespublic PostgreSqlBulkWriter(File sqlFile) throws FileNotFoundException
sqlFile - the file that is feeded with all plain statementsFileNotFoundException - if the directory is not availablepublic PostgreSqlBulkWriter(File sqlFile, Charset encoding) throws FileNotFoundException
sqlFile - the file that is feeded with all plain statementsencoding - the encoding of all written filesFileNotFoundException - if the directory is not availablepublic PostgreSqlBulkWriter(File directory, Writer writer, Charset encoding)
PostgreSqlBulkWriter.directory - the directory for the bulk fileswriter - the SQL file which contains the plain and the "COPY" statementsencoding - The encoding of the bulk files.public void close()
throws IOException
close in interface Closeableclose in interface AutoCloseableclose in class FileStatementsWriterIOExceptionpublic void flush()
throws IOException
StatementsWriterflush in interface StatementsWriterflush in class FileStatementsWriterIOException - if the target throws an exceptionpublic void writePlainStatement(GeneratorDialect dialect, String sql) throws IOException
StatementsWriterwriteStatement(createPlainStatement(sql), dialect).writePlainStatement in interface StatementsWriterwritePlainStatement in class FileStatementsWriterdialect - the current database dialectsql - the content of the SQL statementIOException - if the file or database throws an exceptionpublic void writeStatement(EntityStatement stmt) throws IOException
StatementsWriterwriteStatement in interface StatementsWriterwriteStatement in class FileStatementsWriterstmt - contains the values to writeIOException - if the file or database throws an exception@Generated(value="lombok") public File getDirectory()
@Generated(value="lombok") public Charset getEncoding()
@Generated(value="lombok") public List<File> getGeneratedFiles()
@Generated(value="lombok") public int getStatementsCount()
getStatementsCount in class FileStatementsWriterCopyright © 2018 fastnate.org. All rights reserved.