Bosko Popovic (
https://hibernate.atlassian.net/secure/ViewProfile.jspa?accountId=5c975d8...
) *created* an issue
Hibernate ORM (
https://hibernate.atlassian.net/browse/HHH?atlOrigin=eyJpIjoiMWE5OTlkNDVm...
) / Bug (
https://hibernate.atlassian.net/browse/HHH-16995?atlOrigin=eyJpIjoiMWE5OT...
) HHH-16995 (
https://hibernate.atlassian.net/browse/HHH-16995?atlOrigin=eyJpIjoiMWE5OT...
) CLONE - ENUM column definitions cannot be customized (on MySQL/MariaDB) (
https://hibernate.atlassian.net/browse/HHH-16995?atlOrigin=eyJpIjoiMWE5OT...
)
Issue Type: Bug Affects Versions: 6.2.3 Assignee: Unassigned Created: 26/Jul/2023 01:14 AM
Priority: Major Reporter: Bosko Popovic (
https://hibernate.atlassian.net/secure/ViewProfile.jspa?accountId=5c975d8...
)
https://hibernate.atlassian.net/browse/HHH-15845 changed the generated schema on
MySQL/MariaDB when using @Enumerated(EnumType.STRING) to use its enum(...) types. I
previously did this manually using @Column(columnDefinition="enum(...)". Now
Hibernate ignores my specified column definition for all enum columns.
Since the new implementation always sorts the enum values alphapetically (see
NamedEnumValueConverter in the 6.2 branch), this makes it impossible to use the intended
ordinal-based sorting (
https://mariadb.com/kb/en/enum/#numeric-index ) with the optimized
enum types.
I haven’t checked the behaviour in the in-development 6.3 version, which changed a lot of
the involved code. (See
https://hibernate.atlassian.net/browse/HHH-16125 ) Since I haven’t
seen any comments about either the sorting behaviour or the columnDefinition overrides,
I’m assuming that this hasn’t (intentionally) changed.
TLDR: Two behaviours should be fixed:
* columnDefinition should always be respected.
* enum values should not be sorted alphabetically when generating enum(...) columns in
MariaDB/MySQL.
(
https://hibernate.atlassian.net/browse/HHH-16995#add-comment?atlOrigin=ey...
) Add Comment (
https://hibernate.atlassian.net/browse/HHH-16995#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#100233- sha1:62cfdef )