Formatting SQL Queries
Say you have some SQL queries that you want to execute.
Further these queries are generated at runtime and you want to log them.
If you just log the SQL strings, it would be pretty difficult to read them later on.
Hibernate has a nice utility here (which is internally used by Hibernate too) to format any SQL.
To format any insert/update/get query (like Hibernate), use the following:
For DML queries, use the following:
The FormatStyle class can be found in: