How can I edit this piece of code used with hibernate 3 in order to corresponds to hibernate 5.6.1 version.
I see that Formatter is now an interface with one single method.
For "basic SQL statements (DML + query)", please "try":
Formatter formatter = new org.hibernate.engine.jdbc.internal.BasicFormatterImpl(); formatter.format(query);
BasicFormatterImpl javadoc
For "DDL SQL statements", please:
Formatter formatter = org.hibernate.engine.jdbc.internal.DDLFormatterImpl.INSTANCE; formatter.format(query);
DDLFormatterImpl javadoc
For "indent-/initialString" please consider a custom implementation, you can base on((/see source code of) the mentioned:
For "basic SQL statements (DML + query)", please "try":
BasicFormatterImpl javadoc
For "DDL SQL statements", please:
DDLFormatterImpl javadoc
For "indent-/initialString" please consider a custom implementation, you can base on((/see source code of) the mentioned: