Unfortunately, “I don’t see how it makes sense …” is not a valid argument in this discussion. I would like to provide some valid argumentation to consider in this topic:
In any relational database there is an option to do:
SELECTmax(int) FROM X
Hibernate is the framework which has one job, this job is the O/R Mapping. That’s what the entity code I posted does:
The above proves the framework does not do what it is designed for. I would expect if the defined mapping is supported, everything that uses the O/R Mapping also should be supported. In this particular case if my int column is mapped to Enum, I should be able to work with the Enums in the code and those should also be properly mapped.
Moreover, the functionalities around the Enums are inconsistent as, the above example is not possible, while the code below is:
@Query("select s from SomeDbo s where enum = int")
List<SomeDbo> findSomeOfTypeOne();
This is also a regression to the previous versions where that functionality was supported.
Last, but not least, if the Hibernate Team decided to not support it anymore, this should be documented and properly described in the Migration Guide, which currently is not the case.