public interface SqlWriterConfig
SqlWriter and SqlPrettyWriter.| Modifier and Type | Interface and Description |
|---|---|
static class |
SqlWriterConfig.LineFolding
Policy for how to do deal with long lines.
|
| Modifier and Type | Method and Description |
|---|---|
boolean |
alwaysUseParentheses()
Returns whether expressions should always be included in parentheses.
|
boolean |
caseClausesOnNewLines()
Returns whether the WHEN, THEN and ELSE clauses of a CASE expression
appear at the start of a new line.
|
boolean |
clauseEndsLine()
Returns whether a clause (FROM, WHERE, GROUP BY, HAVING, WINDOW,
ORDER BY) is followed by a new line.
|
boolean |
clauseStartsLine()
Returns whether a clause (FROM, WHERE, GROUP BY, HAVING, WINDOW,
ORDER BY) starts a new line.
|
SqlDialect |
dialect()
Returns the dialect.
|
int |
foldLength()
Returns the line length at which items are chopped or folded (for clauses
that have chosen
SqlWriterConfig.LineFolding.CHOP or SqlWriterConfig.LineFolding.FOLD). |
SqlWriterConfig.LineFolding |
fromFolding()
Returns the line-folding policy for the FROM clause (and JOIN).
|
SqlWriterConfig.LineFolding |
groupByFolding()
Returns the line-folding policy for the GROUP BY clause.
|
SqlWriterConfig.LineFolding |
havingFolding()
Returns the line-folding policy for the HAVING clause.
|
int |
indentation()
Returns the number of spaces indentation.
|
boolean |
keywordsLowerCase()
Returns whether to print keywords (SELECT, AS, etc.) in lower-case.
|
boolean |
leadingComma()
Returns whether commas in SELECT, GROUP BY and ORDER clauses should
appear at the start of the line.
|
SqlWriterConfig.LineFolding |
lineFolding()
Returns the line-folding policy for lists in the SELECT, GROUP BY and
ORDER clauses, for items in the SET clause of UPDATE, and for items in
VALUES.
|
int |
lineLength()
Returns the maximum line length.
|
SqlWriterConfig.LineFolding |
matchFolding()
Returns the line-folding policy for the MATCH_RECOGNIZE clause.
|
SqlWriterConfig.LineFolding |
orderByFolding()
Returns the line-folding policy for the ORDER BY clause.
|
SqlWriterConfig.LineFolding |
overFolding()
Returns the line-folding policy for the OVER clause or a window
declaration.
|
boolean |
quoteAllIdentifiers()
Returns whether to quote all identifiers, even those which would be
correct according to the rules of the
SqlDialect if quotation
marks were omitted. |
SqlWriterConfig.LineFolding |
selectFolding()
Returns the line-folding policy for the SELECT clause.
|
boolean |
selectListExtraIndentFlag()
Returns whether to use a fix for SELECT list indentations.
|
boolean |
selectListItemsOnSeparateLines()
Returns whether each item in a SELECT list, GROUP BY list, or ORDER BY
list is on its own line.
|
SqlWriter.SubQueryStyle |
subQueryStyle()
Returns the sub-query style.
|
SqlWriterConfig.LineFolding |
updateSetFolding()
Returns the line-folding policy for the SET clause of an UPDATE statement.
|
boolean |
updateSetListNewline()
Returns whether each assignment in the SET clause of an UPDATE or MERGE
statement should be on its own line.
|
SqlWriterConfig.LineFolding |
valuesFolding()
Returns the line-folding policy for the VALUES expression.
|
boolean |
valuesListNewline()
Returns whether each row in a VALUES clause should be on its own
line.
|
SqlWriterConfig.LineFolding |
whereFolding()
Returns the line-folding policy for the WHERE clause.
|
boolean |
whereListItemsOnSeparateLines()
Returns whether to print a newline before each AND or OR (whichever is
higher level) in WHERE clauses.
|
boolean |
windowDeclListNewline()
Returns whether each declaration in a WINDOW clause should be on its own
line.
|
SqlWriterConfig.LineFolding |
windowFolding()
Returns the line-folding policy for the WINDOW clause.
|
boolean |
windowNewline()
Returns whether a WINDOW clause should start its own line.
|
SqlWriterConfig |
withAlwaysUseParentheses(boolean alwaysUseParentheses)
Sets
alwaysUseParentheses(). |
SqlWriterConfig |
withCaseClausesOnNewLines(boolean caseClausesOnNewLines)
Sets
caseClausesOnNewLines(). |
SqlWriterConfig |
withClauseEndsLine(boolean clauseEndsLine)
Sets
clauseEndsLine(). |
SqlWriterConfig |
withClauseStartsLine(boolean clauseStartsLine)
Sets
clauseStartsLine(). |
SqlWriterConfig |
withDialect(SqlDialect dialect)
Sets
dialect(). |
SqlWriterConfig |
withFoldLength(int lineLength)
Sets
foldLength(). |
SqlWriterConfig |
withFromFolding(SqlWriterConfig.LineFolding lineFolding)
Sets
fromFolding(). |
SqlWriterConfig |
withGroupByFolding(SqlWriterConfig.LineFolding lineFolding)
Sets
groupByFolding(). |
SqlWriterConfig |
withHavingFolding(SqlWriterConfig.LineFolding lineFolding)
Sets
havingFolding(). |
SqlWriterConfig |
withIndentation(int indentation)
Sets
indentation(). |
SqlWriterConfig |
withKeywordsLowerCase(boolean keywordsLowerCase)
Sets
keywordsLowerCase(). |
SqlWriterConfig |
withLeadingComma(boolean leadingComma)
Sets
leadingComma(). |
SqlWriterConfig |
withLineFolding(SqlWriterConfig.LineFolding lineFolding)
Sets
lineFolding(). |
SqlWriterConfig |
withLineLength(int lineLength)
Sets
lineLength(). |
SqlWriterConfig |
withMatchFolding(SqlWriterConfig.LineFolding lineFolding)
Sets
matchFolding(). |
SqlWriterConfig |
withOrderByFolding(SqlWriterConfig.LineFolding lineFolding)
Sets
orderByFolding(). |
SqlWriterConfig |
withOverFolding(SqlWriterConfig.LineFolding lineFolding)
Sets
overFolding(). |
SqlWriterConfig |
withQuoteAllIdentifiers(boolean quoteAllIdentifiers)
Sets
quoteAllIdentifiers(). |
SqlWriterConfig |
withSelectFolding(SqlWriterConfig.LineFolding lineFolding)
Sets
selectFolding(). |
SqlWriterConfig |
withSelectListExtraIndentFlag(boolean selectListExtraIndentFlag)
|
SqlWriterConfig |
withSelectListItemsOnSeparateLines(boolean selectListItemsOnSeparateLines)
|
SqlWriterConfig |
withSubQueryStyle(SqlWriter.SubQueryStyle subQueryStyle)
Sets
subQueryStyle(). |
SqlWriterConfig |
withUpdateSetFolding(SqlWriterConfig.LineFolding lineFolding)
Sets
updateSetFolding(). |
SqlWriterConfig |
withUpdateSetListNewline(boolean updateSetListNewline)
Sets
updateSetListNewline(). |
SqlWriterConfig |
withValuesFolding(SqlWriterConfig.LineFolding lineFolding)
Sets
valuesFolding(). |
SqlWriterConfig |
withValuesListNewline(boolean valuesListNewline)
Sets
valuesListNewline(). |
SqlWriterConfig |
withWhereFolding(SqlWriterConfig.LineFolding lineFolding)
Sets
whereFolding(). |
SqlWriterConfig |
withWhereListItemsOnSeparateLines(boolean whereListItemsOnSeparateLines)
|
SqlWriterConfig |
withWindowDeclListNewline(boolean windowDeclListNewline)
Sets
windowDeclListNewline(). |
SqlWriterConfig |
withWindowFolding(SqlWriterConfig.LineFolding lineFolding)
Sets
windowFolding(). |
SqlWriterConfig |
withWindowNewline(boolean windowNewline)
Sets
windowNewline(). |
SqlDialect dialect()
SqlWriterConfig withDialect(SqlDialect dialect)
dialect().boolean keywordsLowerCase()
SqlWriterConfig withKeywordsLowerCase(boolean keywordsLowerCase)
keywordsLowerCase().boolean quoteAllIdentifiers()
SqlDialect if quotation
marks were omitted. Default is true.SqlWriterConfig withQuoteAllIdentifiers(boolean quoteAllIdentifiers)
quoteAllIdentifiers().int indentation()
SqlWriterConfig withIndentation(int indentation)
indentation().boolean clauseStartsLine()
SqlWriterConfig withClauseStartsLine(boolean clauseStartsLine)
clauseStartsLine().boolean clauseEndsLine()
SqlWriterConfig withClauseEndsLine(boolean clauseEndsLine)
clauseEndsLine().boolean selectListItemsOnSeparateLines()
Default is false;
this property is superseded by selectFolding(),
groupByFolding(), orderByFolding().
SqlWriterConfig withSelectListItemsOnSeparateLines(boolean selectListItemsOnSeparateLines)
SqlWriterConfig.LineFolding lineFolding()
SqlWriterConfig withLineFolding(SqlWriterConfig.LineFolding lineFolding)
lineFolding().SqlWriterConfig.LineFolding selectFolding()
lineFolding() is used.SqlWriterConfig withSelectFolding(SqlWriterConfig.LineFolding lineFolding)
selectFolding().SqlWriterConfig.LineFolding fromFolding()
lineFolding() is used.SqlWriterConfig withFromFolding(SqlWriterConfig.LineFolding lineFolding)
fromFolding().SqlWriterConfig.LineFolding whereFolding()
lineFolding() is used.SqlWriterConfig withWhereFolding(SqlWriterConfig.LineFolding lineFolding)
whereFolding().SqlWriterConfig.LineFolding groupByFolding()
lineFolding() is used.SqlWriterConfig withGroupByFolding(SqlWriterConfig.LineFolding lineFolding)
groupByFolding().SqlWriterConfig.LineFolding havingFolding()
lineFolding() is used.SqlWriterConfig withHavingFolding(SqlWriterConfig.LineFolding lineFolding)
havingFolding().SqlWriterConfig.LineFolding windowFolding()
lineFolding() is used.SqlWriterConfig withWindowFolding(SqlWriterConfig.LineFolding lineFolding)
windowFolding().SqlWriterConfig.LineFolding matchFolding()
lineFolding() is used.SqlWriterConfig withMatchFolding(SqlWriterConfig.LineFolding lineFolding)
matchFolding().SqlWriterConfig.LineFolding orderByFolding()
lineFolding() is used.SqlWriterConfig withOrderByFolding(SqlWriterConfig.LineFolding lineFolding)
orderByFolding().SqlWriterConfig.LineFolding overFolding()
lineFolding() is used.SqlWriterConfig withOverFolding(SqlWriterConfig.LineFolding lineFolding)
overFolding().SqlWriterConfig.LineFolding valuesFolding()
lineFolding() is used.SqlWriterConfig withValuesFolding(SqlWriterConfig.LineFolding lineFolding)
valuesFolding().SqlWriterConfig.LineFolding updateSetFolding()
lineFolding() is used.SqlWriterConfig withUpdateSetFolding(SqlWriterConfig.LineFolding lineFolding)
updateSetFolding().boolean selectListExtraIndentFlag()
SELECT
A as A,
B as B,
C as C,
D
SELECT
A as A,
B as B,
C as C,
D
SqlWriterConfig withSelectListExtraIndentFlag(boolean selectListExtraIndentFlag)
boolean windowDeclListNewline()
Default is true;
this property is superseded by windowFolding().
SqlWriterConfig withWindowDeclListNewline(boolean windowDeclListNewline)
windowDeclListNewline().boolean valuesListNewline()
Default is true;
this property is superseded by valuesFolding().
SqlWriterConfig withValuesListNewline(boolean valuesListNewline)
valuesListNewline().boolean updateSetListNewline()
Default is true;
this property is superseded by updateSetFolding().
SqlWriterConfig withUpdateSetListNewline(boolean updateSetListNewline)
updateSetListNewline().boolean windowNewline()
SqlWriterConfig withWindowNewline(boolean windowNewline)
windowNewline().boolean leadingComma()
SqlWriterConfig withLeadingComma(boolean leadingComma)
leadingComma().SqlWriter.SubQueryStyle subQueryStyle()
SqlWriter.SubQueryStyle.HYDE.SqlWriterConfig withSubQueryStyle(SqlWriter.SubQueryStyle subQueryStyle)
subQueryStyle().boolean whereListItemsOnSeparateLines()
NOTE: Ignored when alwaysUseParentheses is set to true.
SqlWriterConfig withWhereListItemsOnSeparateLines(boolean whereListItemsOnSeparateLines)
boolean alwaysUseParentheses()
SqlWriterConfig withAlwaysUseParentheses(boolean alwaysUseParentheses)
alwaysUseParentheses().int lineLength()
SqlWriterConfig withLineLength(int lineLength)
lineLength().int foldLength()
SqlWriterConfig.LineFolding.CHOP or SqlWriterConfig.LineFolding.FOLD).
Default is 80.SqlWriterConfig withFoldLength(int lineLength)
foldLength().boolean caseClausesOnNewLines()
SqlWriterConfig withCaseClausesOnNewLines(boolean caseClausesOnNewLines)
caseClausesOnNewLines().Copyright © 2012-2020 Apache Software Foundation. All Rights Reserved.