In my project we are using ehcache for second level caching, We mentioned <defaultCache> tag and some <cache> attributes as well.
sample of ehcache.xml
<ehcache> <defaultCache maxEntriesLocalHeap="10000" eternal="false" timeToIdleSeconds="120" timeToLiveSeconds="120" maxEntriesLocalDisk="10000000" diskExpiryThreadIntervalSeconds="120" memoryStoreEvictionPolicy="LRU" /> <cache name="com.test.First" maxEntriesLocalHeap="10000" eternal="false" timeToIdleSeconds="120" timeToLiveSeconds="120" /> <cache name="com.test.Second" maxEntriesLocalHeap="10000" eternal="false" timeToIdleSeconds="120" timeToLiveSeconds="120" /> </ehcache> sample of hibernate.cfg.xml
<class-cache class="com.test.First" usage="read-only"/> <class-cache class="com.test.Second" usage="read-only"/> <class-cache class="com.test.Third" usage="read-only"/> here we have added <class-cache> tag for com.test.Third, which is not mentioned in ehcache.xml file.
Will this com.test.Third class also be cached by using defaultCache?