I've found a small gap in the documentation and/or functionality, and I'm curious what the behavior is in the following situation:
1. The Hibernate POJO model uses inheritance.
2. You wish to tune to EHCache settings specifically for subclasses.
In my experiments, the cache names are set as the subclasses, however, when tested, those caches are empty, whereas a cache named for the superclass is the one being populated and used.
What are the semantics here? In what order, or with which parameters do I specify to EHCache that Hibernate should use the subclass caches? Or can I?
Example:
Code:
public class Fragment extends Asset {
//...
}
Code:
public abstract class Asset {
//...
}
Code:
<cache name="com.sourcemedia.webpub.cms.model.content.Fragment"
maxElementsInMemory="1000" eternal="false" overflowToDisk="true" timeToIdleSeconds="120" timeToLiveSeconds="180" diskPersistent="false" memoryStoreEvictionPolicy="LFU" />
Code:
<cache name="com.sourcemedia.webpub.cms.model.content.Asset"
maxElementsInMemory="200" eternal="false" overflowToDisk="true" timeToIdleSeconds="120" timeToLiveSeconds="180" diskPersistent="false" memoryStoreEvictionPolicy="LFU" />
I've tried reversing the order of the two cache elements, and having just the first on its own. When it was the latter, there still was a cache named ...*.Asset, even though I had not specified it. Odd. Acts like it doesn't allow subclasses to have their own caches.
Hibernate version: 3.2.4.sp1
Mapping documents: None (Annotations)
Name and version of the database you are using: MySQL 5.0.27