I'm using a domain model approach (which basically means I use POJOs that know nothing about persistence) an and handling persistence with hibernate. I came across the same problem and decided to create static enumarations built into the doamain model (i.e a Rate object will have a static Currency enumeration).
I am aware and agree with you in the dissadvantages this approach has, BUT the main reason I didnt want to use hibernate PersistentEnums
is that persistence detail will start creeping their way to the domain layer.
If you someday need to stop using hibernate (although in my experience hasnt been the case) and change your persistence mechanism (i.e: beguin to use JDO) then you will have to make changes to your domain model.
As for reports, we are using Jasper Reports, which could enable us to generate reports using POJOs but we want to talk directly to the DB for performance reasons so we also have the enumarations in the tables and just use joins.
Oh.. if you insert data only through your java app, you could gain a little performance in the DB side by removing any insert referential constraints.
Quote:
I just don't see this functionality as best handled within Hibernate itself. This is application logic, not domain/mapping logic.
It would be nice to have a feature like this in hibernate... , instead of declaring a property as a persistenenum, declare an entity, load changes on startup and cache it!