Available in versions: Dev (3.20) | Latest (3.19) | 3.18 | 3.17 | 3.16 | 3.15 | 3.14 | 3.13 | 3.12 | 3.11 | 3.10
Identifier style
Applies to ✅ Open Source Edition ✅ Express Edition ✅ Professional Edition ✅ Enterprise Edition
By default, jOOQ will always generate quoted names for all identifiers (even if this manual omits this for readability). For instance:
SELECT "TABLE"."COLUMN" FROM "TABLE" -- SQL standard style SELECT `TABLE`.`COLUMN` FROM `TABLE` -- MySQL style SELECT [TABLE].[COLUMN] FROM [TABLE] -- SQL Server style
Quoting has the following effect on identifiers in most (but not all) databases:
- It allows for using reserved names as object names, e.g. a table called
"FROM"
is usually possible only when quoted. - It allows for using special characters in object names, e.g. a column called
"FIRST NAME"
can be achieved only with quoting. - It turns what are mostly case-insensitive identifiers into case-sensitive ones, e.g.
"name"
and"NAME"
are different identifiers, whereasname
andNAME
are not. Please consider your database manual to learn what the proper default case and default case sensitivity is.
The renderNameStyle
setting allows for overriding the name of all identifiers in jOOQ to a consistent style. Possible options are:
-
QUOTED
(the default): This will generate all names in their proper case with quotes around them. -
AS_IS
: This will generate all names in their proper case without quotes. -
LOWER
: This will transform all names to lower case. -
UPPER
: This will transform all names to upper case.
Example configuration
Settings settings = new Settings() .withRenderNameStyle(RenderNameStyle.AS_IS); // Defaults to QUOTED
Feedback
Do you have any feedback about this page? We'd love to hear it!