Hi guys. I've got a bunch of hibernate objects in my object graph that I want treated and cached as read-only when running in my webapp, but not when running in my command-line admin suite. Rather than maintain two sets of mapping files, I'm programmatically modifying the Configuration object in the webapp context to enable read-only caches for that portion of my objec graph. E.g.:
Code:
config.setCacheConcurrencyStrategy(Study.class, new ReadOnlyCache());
Questions arise:
1. Is this a good strategy for this use case? Any other best practices?
2. How to I programatically tell the Configuration that a class is immutable?