public class ConnectedEntitySqlGenerator extends EntitySqlGenerator
EntitySqlGenerator which writes the SQL statements directly to a database connection.| Constructor and Description |
|---|
ConnectedEntitySqlGenerator(Connection connection)
Creates a new generator that writes to a database connection.
|
ConnectedEntitySqlGenerator(Connection connection,
GeneratorContext context)
Creates a new generator that writes to a database connection.
|
| Modifier and Type | Method and Description |
|---|---|
void |
close()
Writes any missing SQL and closes any open resources.
|
Connection |
getConnection()
The database connection that was used when creating this generator.
|
long |
getStatementsCount()
The count of statements that we executed up to now.
|
void |
writeComment(String comment)
Writes a SQL comment to the target writer.
|
void |
writeSectionSeparator()
Writes a new line to the target to separate different sections in the SQL file.
|
void |
writeStatement(EntityStatement stmt) |
findEntity, flush, getContext, getWriter, markExistingEntities, markExistingEntity, write, write, writeAlignmentStatements, writePlainStatementpublic ConnectedEntitySqlGenerator(Connection connection) throws SQLException
connection - the database connectionSQLException - if the connection is invalidpublic ConnectedEntitySqlGenerator(Connection connection, GeneratorContext context) throws SQLException
connection - the database connectioncontext - used to keep the state of indices and to store any configuration.SQLException - if the connection is invalidpublic void close()
throws IOException
EntitySqlGeneratorclose in interface Closeableclose in interface AutoCloseableclose in class EntitySqlGeneratorIOException - if the target writer throws onepublic void writeComment(String comment) throws IOException
EntitySqlGeneratorgetWriter().writeComment(comment).writeComment in class EntitySqlGeneratorcomment - the comment to writeIOException - if the writer throws onepublic void writeSectionSeparator()
throws IOException
EntitySqlGeneratorgetWriter().writeSectionSeparator().writeSectionSeparator in class EntitySqlGeneratorIOException - if the writer throws such an exceptionpublic void writeStatement(EntityStatement stmt) throws IOException
IOException@Generated(value="lombok") public Connection getConnection()
@Generated(value="lombok") public long getStatementsCount()
Copyright © 2018 fastnate.org. All rights reserved.