Ordinal enum mapping with hibernate 6.5
I’m upgrading hibernate from 6.1.7
to 6.5.2
, there are many enum columns in my entities marked with
@Enumerated(EnumType.ORDINAL)
. My codebase has to run against both oracle and sqlserver.
The problem is change in hibernate to map enums from SMALLINT
to TINYINT
(if enums have only few values).
I already have DB schema fixed for oracle as NUMBER(10, 0)
and for sqlserver as INT
for ordinal enums.
I can’t seem to find solution to map enums with annotations that would work for both DBs at the same time.
Currently it works for oracle, but schema validation for sql server throws: