When using Hibernate, the dafault mapping strategy for ORDINAL enumerations. Since I think the STRING strategy is more reliable, I want to change the default matching strategy to make it profitable.
Currently, I should use the following on any enumeration:
@Enumerated(EnumType.STRING)
@Column(nullable=false)
private MyEnum myEnum;
Is there any way to say that hibernate always uses the STRING strategy? My research did not come up with any property that allows you to change this behavior.
Or is this not possible because the JPA indicates ORDINAL as the default and we must explicitly annotate it so that it remains neutral O / R-Mapper?
subes source
share