Package org.approvej.database.jdbc
Class SqlPrintFormat
java.lang.Object
org.approvej.database.jdbc.SqlPrintFormat
- All Implemented Interfaces:
org.approvej.print.PrintFormat<String>
@NullMarked
public class SqlPrintFormat
extends Object
implements org.approvej.print.PrintFormat<String>
PrintFormat implementation for SQL strings that formats them with line breaks and
indentation for readability.
Major SQL clauses (SELECT, FROM, WHERE, etc.) are placed on their own lines. Column lists and conditions are indented. This makes it easy to review SQL in approved files.
For example, SELECT id, name FROM users WHERE active = 1 ORDER BY name becomes:
SELECT id, name FROM users WHERE active = 1 ORDER BY name
-
Field Summary
Fields inherited from interface org.approvej.print.PrintFormat
DEFAULT_FILENAME_EXTENSION -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionorg.approvej.print.Printer<String> printer()static SqlPrintFormatsql()Creates and returns a newSqlPrintFormatinstance.
-
Constructor Details
-
SqlPrintFormat
public SqlPrintFormat()Default constructor.
-
-
Method Details
-
printer
- Specified by:
printerin interfaceorg.approvej.print.PrintFormat<String>
-
filenameExtension
- Specified by:
filenameExtensionin interfaceorg.approvej.print.PrintFormat<String>
-
sql
Creates and returns a newSqlPrintFormatinstance.- Returns:
- the new instance
-