Jluc. (
https://hibernate.atlassian.net/secure/ViewProfile.jspa?accountId=557058%...
) *created* an issue
Hibernate ORM (
https://hibernate.atlassian.net/browse/HHH?atlOrigin=eyJpIjoiOTY2MTAwOWI0...
) / Bug (
https://hibernate.atlassian.net/browse/HHH-16516?atlOrigin=eyJpIjoiOTY2MT...
) HHH-16516 (
https://hibernate.atlassian.net/browse/HHH-16516?atlOrigin=eyJpIjoiOTY2MT...
) Adding quoteOnNonIdentifierChar flag to org.hibernate.boot.model.naming.Identifier
breaks backwards compatibility (
https://hibernate.atlassian.net/browse/HHH-16516?atlOrigin=eyJpIjoiOTY2MT...
)
Issue Type: Bug Affects Versions: 6.1.7 Assignee: Unassigned Components: hibernate-core
Created: 25/Apr/2023 08:50 AM Environment: jvm17
Priority: Major Reporter: Jluc. (
https://hibernate.atlassian.net/secure/ViewProfile.jspa?accountId=557058%...
)
We upgraded to Hibernate 6.1.7 and it broke our application.
We use Oracle, and some tables have name following such format “NAME*$*NAME”
Previously Hibernate didn’t try to quote it’s name, it only lowercased it, so it worked
fine.
But after adding *quoteOnNonIdentifierChar* flag to
*org.hibernate.boot.model.naming.Identifier* methods, it tries to quote it because the
name contains ‘$' char *org.hibernate.boot.model.naming.Identifier* : *112*.
So query ends up with lowercased and quoted table name, and Oracle can’t recognize such
table.
After investigation I found that it was caused by this commit:
https://github.com/hibernate/hibernate-orm/commit/cbcec73d4fa4ca0845d0f8c...
The worst is user has no control over this flag, and can’t disable this behavior.
Currently we found workaround by extending CamelCaseToUnderscoresNamingStrategy and
overriding isCaseInsensitive to return *false* (instead of hardcoded true), so quoted
table name works because it is not lowercased.
(
https://hibernate.atlassian.net/browse/HHH-16516#add-comment?atlOrigin=ey...
) Add Comment (
https://hibernate.atlassian.net/browse/HHH-16516#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#100223- sha1:cdc0af3 )