diff --git a/documentation/src/main/docbook/devguide/en-US/Services.xml b/documentation/src/main/docbook/devguide/en-US/Services.xml index ba1b611acd..329a186079 100644 --- a/documentation/src/main/docbook/devguide/en-US/Services.xml +++ b/documentation/src/main/docbook/devguide/en-US/Services.xml @@ -822,6 +822,49 @@ +
+ <interfacename>org.hibernate.tool.hbm2ddl.ImportSqlCommandExtractor</interfacename> + + + Notes + + + Contract for extracting statements from import.sql scripts. + + + + + Initiator + + + org.hibernate.tool.hbm2ddl.ImportSqlCommandExtractorInitiator + + + + + Implementations + + + org.hibernate.tool.hbm2ddl.SingleLineSqlCommandExtractor + + + Treads each line as a complete SQL statement. Comment lines shall start with + --, // or /* character sequence. + + + + + org.hibernate.tool.hbm2ddl.MultipleLinesSqlCommandExtractor + + + Supports instructions/comments and quoted strings spread over multiple lines. Each + statement must end with semicolon. + + + + +
+ diff --git a/documentation/src/main/docbook/manual/en-US/content/configuration.xml b/documentation/src/main/docbook/manual/en-US/content/configuration.xml index 7fd5709e00..0cc87eea0a 100644 --- a/documentation/src/main/docbook/manual/en-US/content/configuration.xml +++ b/documentation/src/main/docbook/manual/en-US/content/configuration.xml @@ -926,7 +926,7 @@ hibernate.dialect = org.hibernate.dialect.PostgreSQLDialect also MultipleLinesSqlCommandExtractor which supports instructions/comments and quoted strings spread over multiple lines (mandatory semicolon at the end of each statement). - e.g. + e.g. classname.of.ImportSqlCommandExtractor diff --git a/hibernate-core/src/main/antlr/sql-stmt.g b/hibernate-core/src/main/antlr/sql-stmt.g index f21a668b3b..567cac718e 100644 --- a/hibernate-core/src/main/antlr/sql-stmt.g +++ b/hibernate-core/src/main/antlr/sql-stmt.g @@ -40,23 +40,23 @@ options { public void throwExceptionIfErrorOccurred() { if ( errorHandler.hasErrors() ) { - throw new StatementParserException(errorHandler.getErrorMessage()); + throw new StatementParserException( errorHandler.getErrorMessage() ); } } /** List of all SQL statements. */ - private List statementList = new LinkedList(); + private List statementList = new LinkedList(); - /** Currently processing SQL statement. */ - private StringBuilder current = new StringBuilder(); + /** Currently processing SQL statement. */ + private StringBuilder current = new StringBuilder(); - protected void out(String stmt) { - current.append( stmt ); - } + protected void out(String stmt) { + current.append( stmt ); + } - protected void out(Token token) { - out( token.getText() ); - } + protected void out(Token token) { + out( token.getText() ); + } public List getStatementList() { return statementList;