I am working on augmenting our object model framework to support the addition of custom properties by an end user. The approach I am using is to have these additional properties accessible via a map on the object and mapped via a dynamic component similar to the approach shown here:
http://www.infoq.com/articles/hibernate-custom-fields
The difference between what is shown there and what we want to do is that we are using Spring and our out of the box hibernate config is driven via hibernate annotations. My plan is to override Springs AnnotationSessionFactoryBean.newSesionFactory(Configuration) method and augment the config here and build a new session factory with our augmented config. The problem I am running into is that there doesn't appear to be a way to annotate our customProperties Map component as a dynamic component (so that I can then add our custom properties to this component at runtime similar to the paper reference above). Is there a way to do this? If not, could I achieve similar functionality by manipulating the mapping model and adding the component for the customProperties map at runtime as well. Any other ideas?
Any thoughts are greatly appreciated. Thanks!