public abstract class AbstractStatementsWriter extends Object implements StatementsWriter
StatementsWriter.| Modifier and Type | Class and Description |
|---|---|
protected static class |
AbstractStatementsWriter.AbstractTableStatement
Base class for insert and update statements.
|
protected static class |
AbstractStatementsWriter.InsertStatement
Holds the information for an SQL Insert statement.
|
protected static class |
AbstractStatementsWriter.PlainStatement
A single (unparsed) SQL statement.
|
protected static class |
AbstractStatementsWriter.UpdateStatement
Holds the information for an SQL update statement.
|
| Constructor and Description |
|---|
AbstractStatementsWriter() |
| Modifier and Type | Method and Description |
|---|---|
void |
close() |
TableStatement |
createInsertStatement(GeneratorDialect dialect,
GeneratorTable table)
Creates a container for a dedicated "insert into table" statement.
|
EntityStatement |
createPlainStatement(GeneratorDialect dialect,
String sql)
Creates a container for a plain SQL statement, which is just executed "as is".
|
TableStatement |
createUpdateStatement(GeneratorDialect dialect,
GeneratorTable table,
GeneratorColumn idColumn,
ColumnExpression idValue)
Creates a container for a dedicated "update table" statement.
|
void |
flush()
Flushes any open statements.
|
void |
writeComment(String comment)
Writes a SQL comment to the target.
|
void |
writeSectionSeparator()
Writes a new line to the target file to separate different sections in the SQL file.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waittruncateTables, writePlainStatement, writeStatementpublic void close()
throws IOException
close in interface Closeableclose in interface AutoCloseableIOExceptionpublic TableStatement createInsertStatement(GeneratorDialect dialect, GeneratorTable table)
StatementsWritercreateInsertStatement in interface StatementsWriterdialect - the current database dialecttable - the name of the tablepublic EntityStatement createPlainStatement(GeneratorDialect dialect, String sql)
StatementsWritercreatePlainStatement in interface StatementsWriterdialect - the current database dialectsql - the content of the sql statement (without any delimiter)public TableStatement createUpdateStatement(GeneratorDialect dialect, GeneratorTable table, GeneratorColumn idColumn, ColumnExpression idValue)
StatementsWritercreateUpdateStatement in interface StatementsWriterdialect - the current database dialecttable - the name of the affected tableidColumn - the column that contains the id of the changed entityidValue - the expression for the id of the changed entitypublic void flush()
throws IOException
StatementsWriterflush in interface StatementsWriterIOException - if the target throws an exceptionpublic void writeComment(String comment) throws IOException
StatementsWriterwriteComment in interface StatementsWritercomment - the comment to writeIOException - if the target throws an exceptionpublic void writeSectionSeparator()
throws IOException
StatementsWriterwriteSectionSeparator in interface StatementsWriterIOException - if the target throws such an exceptionCopyright © 2022 fastnate.org. All rights reserved.