https://discourse.hibernate.org/t/hibernate-6-cannot-persist-enum-as-ordinal-in-varchar-column/7775/17 As discussed in this thread, in Hibernate 6 if a column is VARCHAR, but actually contains integers meant to be mapped with @Enumerated(value = EnumType.ORDINAL) then you’ll get an exception caused by it using the char value of the int from the db as the ordinal index. So a 0 in the db becomes a 48.
In Hibernate 5, this worked without issue. I have created a reproducer which I will link to in a few minutes. |