Explorar el Código

dao层使用ehcache

shuzheng hace 9 años
padre
commit
34233e79de

+ 1 - 1
cms/cms-dao/src/main/java/com/zheng/cms/dao/mapper/BookMapper.xml

@@ -184,5 +184,5 @@
       name = #{name,jdbcType=VARCHAR}
     where id = #{id,jdbcType=INTEGER}
   </update>
-  <cache eviction="LRU" flushInterval="60000" readOnly="true" size="1024" />
+  <cache type="org.mybatis.caches.ehcache.LoggingEhcache" />
 </mapper>

+ 1 - 1
cms/cms-dao/src/main/java/com/zheng/cms/dao/mapper/CmsArticleCategoryMapper.xml

@@ -186,5 +186,5 @@
       category_id = #{categoryId,jdbcType=INTEGER}
     where article_category_id = #{articleCategoryId,jdbcType=INTEGER}
   </update>
-  <cache eviction="LRU" flushInterval="60000" readOnly="true" size="1024" />
+  <cache type="org.mybatis.caches.ehcache.LoggingEhcache" />
 </mapper>

+ 1 - 1
cms/cms-dao/src/main/java/com/zheng/cms/dao/mapper/CmsArticleMapper.xml

@@ -469,5 +469,5 @@
       orders = #{orders,jdbcType=BIGINT}
     where article_id = #{articleId,jdbcType=INTEGER}
   </update>
-  <cache eviction="LRU" flushInterval="60000" readOnly="true" size="1024" />
+  <cache type="org.mybatis.caches.ehcache.LoggingEhcache" />
 </mapper>

+ 1 - 1
cms/cms-dao/src/main/java/com/zheng/cms/dao/mapper/CmsArticleTagMapper.xml

@@ -186,5 +186,5 @@
       tag_id = #{tagId,jdbcType=INTEGER}
     where article_tag_id = #{articleTagId,jdbcType=INTEGER}
   </update>
-  <cache eviction="LRU" flushInterval="60000" readOnly="true" size="1024" />
+  <cache type="org.mybatis.caches.ehcache.LoggingEhcache" />
 </mapper>

+ 1 - 1
cms/cms-dao/src/main/java/com/zheng/cms/dao/mapper/CmsCategoryMapper.xml

@@ -293,5 +293,5 @@
       orders = #{orders,jdbcType=BIGINT}
     where category_id = #{categoryId,jdbcType=INTEGER}
   </update>
-  <cache eviction="LRU" flushInterval="60000" readOnly="true" size="1024" />
+  <cache type="org.mybatis.caches.ehcache.LoggingEhcache" />
 </mapper>

+ 1 - 1
cms/cms-dao/src/main/java/com/zheng/cms/dao/mapper/CmsCategoryTagMapper.xml

@@ -186,5 +186,5 @@
       tag_id = #{tagId,jdbcType=INTEGER}
     where category_tag_id = #{categoryTagId,jdbcType=INTEGER}
   </update>
-  <cache eviction="LRU" flushInterval="60000" readOnly="true" size="1024" />
+  <cache type="org.mybatis.caches.ehcache.LoggingEhcache" />
 </mapper>

+ 1 - 1
cms/cms-dao/src/main/java/com/zheng/cms/dao/mapper/CmsCommentMapper.xml

@@ -328,5 +328,5 @@
       ctime = #{ctime,jdbcType=BIGINT}
     where comment_id = #{commentId,jdbcType=INTEGER}
   </update>
-  <cache eviction="LRU" flushInterval="60000" readOnly="true" size="1024" />
+  <cache type="org.mybatis.caches.ehcache.LoggingEhcache" />
 </mapper>

+ 1 - 1
cms/cms-dao/src/main/java/com/zheng/cms/dao/mapper/CmsTagMapper.xml

@@ -263,5 +263,5 @@
       orders = #{orders,jdbcType=BIGINT}
     where tag_id = #{tagId,jdbcType=INTEGER}
   </update>
-  <cache eviction="LRU" flushInterval="60000" readOnly="true" size="1024" />
+  <cache type="org.mybatis.caches.ehcache.LoggingEhcache" />
 </mapper>

+ 1 - 1
cms/cms-dao/src/main/java/com/zheng/cms/dao/mapper/UserMapper.xml

@@ -292,5 +292,5 @@
       ctime = #{ctime,jdbcType=BIGINT}
     where id = #{id,jdbcType=INTEGER}
   </update>
-  <cache eviction="LRU" flushInterval="60000" readOnly="true" size="1024" />
+  <cache type="org.mybatis.caches.ehcache.LoggingEhcache" />
 </mapper>

+ 5 - 0
cms/cms-dao/src/main/resources/generatorConfig.xml

@@ -29,10 +29,15 @@
 
 		<!-- 生成在XML中的<cache>元素 -->
 		<plugin type="org.mybatis.generator.plugins.CachePlugin">
+			<!-- 使用ehcache -->
+			<property name="cache_type" value="org.mybatis.caches.ehcache.LoggingEhcache" />
+			<!-- 内置cache配置 -->
+			<!--
 			<property name="cache_eviction" value="LRU" />
 			<property name="cache_flushInterval" value="60000" />
 			<property name="cache_readOnly" value="true" />
 			<property name="cache_size" value="1024" />
+			-->
 		</plugin>
 
 		<!-- Java模型生成equals和hashcode方法 -->