I’m trying to take a table with a column with an ENUM type and reverse engineer it into a JPA persistence class that has a type safe enum, but it comes out as a string instead.
I tried creating the Enum, putting it in the same directory, and putting it in the jpa.reveng.xml file, but I get an error saying:
java.lang.IllegalArgumentException: No enum const class ….
I saw some other posts that say we also need to manually put the @Enumerated(EnumType.STRING) before the getter like this:
@Enumerated(value=EnumType.STRING)
@Column(name = “type”, unique = false, nullable = false, insertable = true, updatable = true, length = 11)
public ContactDeviceType getType() {
return this.type;
}
However, that doesn’t seem to make a difference. What do I need to do to make this work?