public enum DisplayNameMode extends Enum<DisplayNameMode>
This mode determines the "visual style" of the output - whether to show raw SQL form with quotes, clean display form without quotes, or canonical form.
Note: This is separate from DisplayNamePolicy which determines
"which occurrence to use" when the same object appears multiple times with
different spellings.
SQL: SELECT [OrderID] FROM [dbo].[SalesOrder]
DISPLAY: dbo.SalesOrder, OrderID (quotes stripped, case preserved)
SQL_RENDER: [dbo].[SalesOrder], [OrderID] (quotes preserved)
CANONICAL: dbo.SalesOrder, OrderID (SQL Server stores names as written,
so its canonical form folds nothing and matches DISPLAY here)
The same names under Oracle, where unquoted identifiers DO fold:
SQL: SELECT OrderID, "Order Date" FROM SalesOrder
DISPLAY: SalesOrder, OrderID, Order Date
CANONICAL: SALESORDER, ORDERID, Order Date ("Order Date" was quoted, so it keeps its case)
DisplayNamePolicy,
DisplayNameNormalizer| Enum Constant and Description |
|---|
CANONICAL
Canonical mode: apply vendor-specific case folding.
|
DISPLAY
Display mode: strip delimiters, preserve original case.
|
SQL_RENDER
SQL render mode: the name written as valid SQL for the vendor.
|
| Modifier and Type | Method and Description |
|---|---|
static DisplayNameMode |
valueOf(String name)
Returns the enum constant of this type with the specified name.
|
static DisplayNameMode[] |
values()
Returns an array containing the constants of this enum type, in
the order they are declared.
|
public static final DisplayNameMode DISPLAY
Recommended for debugging and test output. Produces clean, readable output that reflects what the user wrote (minus the quote noise).
Examples:
[OrderID] → OrderID`kalyan-DB` → kalyan-DB"MyTable" → MyTablepublic static final DisplayNameMode SQL_RENDER
"Valid SQL that names this object" is a constraint, not a value: dbo,
[dbo] and "dbo" all satisfy it. The spelling is therefore GENERATED by
rule rather than echoed from whichever reference was read, and
SqlNameGenerator.QuotePolicy is the parameter that makes it unique:
WHEN_NEEDED (default): delimit only where the bare word would be invalid,
would denote another object, or is a keyword.
[dbo].[Sales Order] → dbo.[Sales Order];
MySQL `t`.`date` → t.`date`ALWAYS: delimit every segment. dbo.T → [dbo].[T]A name written without delimiters is returned as written: it is already valid SQL for
that object, and folding its case would need the catalog's stored case, which SQL text
does not reveal. One object written several ways still yields ONE listing row, chosen by
DisplayNamePolicy.
public static final DisplayNameMode CANONICAL
Produces output matching the database's internal canonical form. Useful for comparing against metadata or catalog information.
Examples (vendor-dependent):
MyTable → MYTABLE (unquoted folds to upper)MyTable → mytable (unquoted folds to lower)MyTable → MyTable (case-sensitive)public static DisplayNameMode[] values()
for (DisplayNameMode c : DisplayNameMode.values()) System.out.println(c);
public static DisplayNameMode valueOf(String name)
name - the name of the enum constant to be returned.IllegalArgumentException - if this enum type has no constant with the specified nameNullPointerException - if the argument is null