Is there a way to configure EHcache using annotations.
I have a Spring/Hibernate project that has Cache enabled. Currently I am using ehcache.xml to define the configuration of how entities will be cached.
This is what my ehcache.xml looks like:
<ehcache xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="ehcache.xsd"
updateCheck="true"
monitoring="autodetect"
dynamicConfig="true">
<diskStore path="java.io.tmpdir/ehcache"/>
<defaultCache
.
.
.
</defaultCache>
<cache name="exmaple.model.User" maxEntriesLocalHeap="1000" eternal="false"
timeToIdleSeconds="120" timeToLiveSeconds="300">
<persistence strategy="localTempSwap"/>
</cache>
</ehcache>
I was wondering if this was possible to do the same with annotations on top of @Entity instead of using this xml file.