I am using annotation based configuration to configure the cache strategy for all hibernate entities like as below
@Entity
@Table(name = "EMP")
@Cache(usage = CacheConcurrencyStrategy.READ_WRITE)
public class EMPLOYEE extends AbstractEntity {
We have common project to maintain all hibernate entity clasess. we will building a jar and using it in different applications. We are using this entity jar in two applications. I have to use different caching strategies for two applications. For application1 , i have to use @Cache(usage = CacheConcurrencyStrategy.READ_WRITE) and for application 2, i have to use @Cache(usage = CacheConcurrencyStrategy.READ_ONLY).
So i would like to change these configuration settings dynamically at run time for application2.
Appreciated , if anyone can suggest the approach.