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.
|
void |
writeSectionSeparator()
Writes a new line to the target to separate different sections in the SQL file.
|
void |
writeStatement(EntityStatement stmt)
Writes the given statement to the target.
|
findEntity, getContext, markExistingEntities, markExistingEntity, write, write, writeAlignmentStatementspublic 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
EntitySqlGeneratorwriteComment in class EntitySqlGeneratorcomment - the comment to writeIOException - if the target throws onepublic void writeSectionSeparator()
throws IOException
EntitySqlGeneratorwriteSectionSeparator in class EntitySqlGeneratorIOException - if the target throws such an exceptionpublic void writeStatement(EntityStatement stmt) throws IOException
EntitySqlGeneratorwriteStatement in class EntitySqlGeneratorstmt - the SQL statement to writeIOException - if the target throws one@Generated(value="lombok") public Connection getConnection()
@Generated(value="lombok") public long getStatementsCount()
Copyright © 2017 fastnate.org. All rights reserved.