The MyBatis EHCache integration

The EHCache integration is built on top of the ehcache-core and comes without any EHCache 3rd part applications.

Users that want to use EHCache into their applications, have to download the 1.0.0 zip bundle, decompress it
and add the jars in the classpath.

just configure it in the mapper XML:
<mapper namespace="org.acme.FooMapper">
<cache type="org.mybatis.ehcache.EhcacheCache"/>
...
</mapper>

If users need to log cache operations, they can plug the Cache logging version:
<mapper namespace="org.acme.FooMapper">
<cache type="org.mybatis.ehcache.LoggingEhcache"/>
...
</mapper>

Users that need to configure EHCache through XML configuration file, have to put in the classpath the /ehcache.xml resource; please refeer to the official EHCache documentation to know more details.
If the /ehcache.xml resource is not found or something goes wrong while loading it, the default configuration will be used.

猜你喜欢

转载自wjacketcn.iteye.com/blog/1559626