Example usage for org.hibernate.engine.jdbc.internal DDLFormatterImpl format

List of usage examples for org.hibernate.engine.jdbc.internal DDLFormatterImpl format

Introduction

In this page you can find the example usage for org.hibernate.engine.jdbc.internal DDLFormatterImpl format.

Prototype

@Override
    public String format(String sql) 

Source Link

Usage

From source file:com.silverbaytech.blog.jpaschemas.ScriptExample3.java

License:Apache License

private static void pretty(String unformatted) {
    StringReader lowLevel = new StringReader(unformatted);
    BufferedReader highLevel = new BufferedReader(lowLevel);
    DDLFormatterImpl formatter = new DDLFormatterImpl();

    highLevel.lines().forEach(x -> {// ww  w  .j av  a2s  .c o  m
        String formatted = formatter.format(x + ";");
        System.out.println(formatted);
    });
}