Hi,
I have a product that is used at a number of clients. I would like to add a feature to the application that allows clients to define custom properties on a few of the domain objects. Our domain model uses hibernate annotations and hibernate validator to provide all metadata to hibernate. I am not overly concerned with the ability to define new properties at run time, my main concern is to provide our clients with the capability to add custom attributes to these objects. It is fine for the client to request a new property, then have a developer make a configuration change and then restart the application to allow the sessions to all clear out and the session factory to be rebuilt from the configuration object. Furthermore, I do not want to move all of the "custom" fields in to the beans that make up our data model, nor do I want to branch the application for each client in order to support all of their individual needs.
This approach looks fairly close to what I would like:
http://www.infoq.com/articles/hibernate-custom-fields. The ability to load fields in the database in to a map of name / value pairs works great. However, that approach relies on dynamic-components, which as far as I can tell are not available via annotations.
I have also looked at switching the EntityMode of the application to map, but that does not appear to make much sense since all of our metedata is in annotations and we do not want to base the application off the "map of maps" data model.
If anyone has any ideas or feedback, it would be greatly appreciated.
Thanks,
Scott