Juri Berlanda (
https://hibernate.atlassian.net/secure/ViewProfile.jspa?accountId=557058%...
) *created* an issue
Hibernate ORM (
https://hibernate.atlassian.net/browse/HHH?atlOrigin=eyJpIjoiMGYwMTU5YTkz...
) / New Feature (
https://hibernate.atlassian.net/browse/HHH-13903?atlOrigin=eyJpIjoiMGYwMT...
) HHH-13903 (
https://hibernate.atlassian.net/browse/HHH-13903?atlOrigin=eyJpIjoiMGYwMT...
) Automatically quote if keywords are used as identifiers (
https://hibernate.atlassian.net/browse/HHH-13903?atlOrigin=eyJpIjoiMGYwMT...
)
Issue Type: New Feature Affects Versions: 5.4.12 Assignee: Unassigned Created: 24/Mar/2020
09:09 AM Priority: Major Reporter: Juri Berlanda (
https://hibernate.atlassian.net/secure/ViewProfile.jspa?accountId=557058%...
)
Currently, at least using Oracle 12c Dialect, table names are not automatically quoted (or
escaped/modified in any other way for that matter) if keywords are used as name for the
respective @Entity class.
Manually quoting using @Table(name ="...") is a bit cumbersome, especially if
the relevant keyword is not a keyword in all supported databases (e.g. level is keyword in
Oracle, but not in PostgreSQL), since then the identifier has to be quoted on every query
on every database system, regardless whether it is a keyword in that particular database
system or not (see the "level" example from before).
Therefore I would propose to introduce some automatic escaping/modifying of identifiers if
they happen to be a keyword on the particular database system.
OpenJPA for example, appends a 0 (as in Zero) in this case, still sticking to the level
example this would lead to a unquoted Level0 on Oracle, while on PostgreSQL it would be
Level.
(
https://hibernate.atlassian.net/browse/HHH-13903#add-comment?atlOrigin=ey...
) Add Comment (
https://hibernate.atlassian.net/browse/HHH-13903#add-comment?atlOrigin=ey...
)
Get Jira notifications on your phone! Download the Jira Cloud app for Android (
https://play.google.com/store/apps/details?id=com.atlassian.android.jira....
) or iOS (
https://itunes.apple.com/app/apple-store/id1006972087?pt=696495&ct=Em...
) This message was sent by Atlassian Jira (v1001.0.0-SNAPSHOT#100122- sha1:092c6a7 )