Joined: Fri Dec 04, 2009 4:51 pm Posts: 1
|
I'm using the hibernate tools, along with the maven hibernate tools plugin to generate JPA entities directly from my database schema.
I have a few columns that are enumerated values (e.g. a status column) define as simple varchars and the status' are defined in java enumerations. I want to have the generated classes use the enums instead of a string to force stronger typing. I don't want to use an ENUM type for the column in the database; this makes changes to the enumerated types more of a pain to manage since it requires a database migration.
If I add a column override and set the hibernate type to my enum class it generates the correct code however this does not work with the database. I need the JPA annotation @Enumerated(EnumType.String) however I can find no way in the reverse engineering file to force this to be created.
Anyone have any ideas?
|
|