HHH-2403 - Documentation, formatting

This commit is contained in:
Lukasz Antoniak 2011-11-09 00:47:53 +01:00 committed by Steve Ebersole
parent 00e32f5e7f
commit 72b2af3b0a
3 changed files with 54 additions and 11 deletions

View File

@ -822,6 +822,49 @@
</variablelist>
</section>
<section id="services-ImportSqlCommandExtractor">
<title><interfacename>org.hibernate.tool.hbm2ddl.ImportSqlCommandExtractor</interfacename></title>
<variablelist>
<varlistentry>
<term>Notes</term>
<listitem>
<para>
Contract for extracting statements from <literal>import.sql</literal> scripts.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term>Initiator</term>
<listitem>
<para>
<classname>org.hibernate.tool.hbm2ddl.ImportSqlCommandExtractorInitiator</classname>
</para>
</listitem>
</varlistentry>
<varlistentry>
<term>Implementations</term>
<listitem>
<para>
<classname>org.hibernate.tool.hbm2ddl.SingleLineSqlCommandExtractor</classname>
</para>
<para>
Treads each line as a complete SQL statement. Comment lines shall start with
<literal>--</literal>, <literal>//</literal> or <literal>/*</literal> character sequence.
</para>
</listitem>
<listitem>
<para>
<classname>org.hibernate.tool.hbm2ddl.MultipleLinesSqlCommandExtractor</classname>
</para>
<para>
Supports instructions/comments and quoted strings spread over multiple lines. Each
statement must end with semicolon.
</para>
</listitem>
</varlistentry>
</variablelist>
</section>
</section>

View File

@ -926,7 +926,7 @@ hibernate.dialect = org.hibernate.dialect.PostgreSQLDialect</programlisting>
also <classname>MultipleLinesSqlCommandExtractor</classname> which
supports instructions/comments and quoted strings spread over
multiple lines (mandatory semicolon at the end of each statement).
</para><para> <emphasis role="strong">e.g.</emphasis>
</para><para><emphasis role="strong">e.g.</emphasis>
<literal>classname.of.ImportSqlCommandExtractor</literal></para></entry>
</row>

View File

@ -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<String> statementList = new LinkedList<String>();
private List<String> statementList = new LinkedList<String>();
/** 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<String> getStatementList() {
return statementList;