Identifier quoting delimits table and column names so reserved words, unusual characters, whitespace, or letter case survive ORM-to-SQL mapping. section 5.3.1
Hibernate and Spring Data JPA with Hibernate support several quoting strategies:
- Enable automatic quoting with hibernate.auto_quote_keyword=true; the configured dialect identifies reserved keywords and selects the database’s native quote character. section 5.3.1
- Quote a mapped name with backticks for Hibernate-specific behavior, or escape double quotes for JPA-standard delimited identifiers. section 5.3.1
- Add <delimited-identifiers/> under persistence-unit-defaults in orm.xml to enforce quoting for every SQL identifier. section 5.3.1
Quoting a reserved table name
Map a table named USER with @Table(name = "`USER`") for Hibernate-specific quoting, or @Table(name = "\"USER\"") for JPA-compliant delimited naming. Hibernate converts the mapping to the dialect’s native SQL syntax. section 5.3.1
