Top Description Constructors Methods
org.hibernate.jdbc.util

public Class DDLFormatterImpl

extends Object
implements Formatter
Class Inheritance
All Implemented Interfaces
org.hibernate.jdbc.util.Formatter
Imports
java.util.StringTokenizer

Performs formatting of DDL SQL statements.
Authors
Gavin King, Steve Ebersole

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public String
format(String
The statement to be fornmatted.
sql
)

Implements org.hibernate.jdbc.util.Formatter.format.

Format an SQL statement using simple rules
  • Insert newline after each comma
  • Indent three spaces after each inserted newline
private String
private String
private String
private static boolean
isBreak(String token)

private static boolean
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Constructor Detail

DDLFormatterImplback to summary
public DDLFormatterImpl()

Method Detail

formatback to summary
public String format(String sql)

Implements org.hibernate.jdbc.util.Formatter.format.

Format an SQL statement using simple rules

  • Insert newline after each comma
  • Indent three spaces after each inserted newline
If the statement contains single/double quotes return unchanged, it is too complex and could be broken by simple formatting.
Parameters
sql:String

The statement to be fornmatted.

formatAlterTableback to summary
private String formatAlterTable(String sql)
formatCommentOnback to summary
private String formatCommentOn(String sql)
formatCreateTableback to summary
private String formatCreateTable(String sql)
isBreakback to summary
private static boolean isBreak(String token)
isQuoteback to summary
private static boolean isQuote(String tok)