Hi vinit,
you just have to declare regions where to put the entities:
example:
Code:
@Entity
@Cache(usage = CacheConcurrencyStrategy.READ_WRITE, region="Eternal")
public class FirstEntityClazz {
...
}
@Entity
@Cache(usage = CacheConcurrencyStrategy.READ_WRITE, region="Eternal")
public class YourSecondEntityClazz {
...
}
Each "region" must correspond to a cache-element in ehcache.xml:
Code:
...
<cache name="Eternal"
maxElementsInMemory="40000"
eternal="true"
overflowToDisk="false"
memoryStoreEvictionPolicy="LRU">
</cache>