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 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.
|