zoukankan      html  css  js  c++  java
  • cache

    二级缓存

    <mapper namespace="com.abc.dao.IStudentDao">
        
        <!-- 开启二级缓存 -->
        <cache size="512" eviction="LRU" flushInterval="100000"/>
    
        <insert id="insertStudent" flushCache="false">
            insert into student(name,age,score) values(#{name}, #{age}, #{score})
        </insert>
        
        <delete id="deleteById">
            delete from student where id=#{xxx}
        </delete>
        
        <update id="updateStudent">
            update student set name=#{name}, age=#{age}, score=#{score} where id=#{id}
        </update>
        
        <select id="selectStudentById" resultType="Student">
            select id,name,age,score from student where id=#{ooo}
        </select>
        
        <select id="selectStudentById2" resultType="Student">
            select id,name,age,score from student where id=#{ooo}
        </select>
        
    </mapper>
    <mapper namespace="com.abc.dao.IStudentDao">
        
        <!-- 开启二级缓存 -->
        <cache type="org.mybatis.caches.ehcache.EhcacheCache">
            <property name="maxElementsInMemory" value="1000"/>
            <property name="timeToLiveSeconds" value="240"/>
        </cache>
    
        <insert id="insertStudent" flushCache="false">
            insert into student(name,age,score) values(#{name}, #{age}, #{score})
        </insert>
        
        <delete id="deleteById">
            delete from student where id=#{xxx}
        </delete>
        
        <update id="updateStudent">
            update student set name=#{name}, age=#{age}, score=#{score} where id=#{id}
        </update>
        
        <select id="selectStudentById" resultType="Student" useCache="false">
            select id,name,age,score from student where id=#{ooo}
        </select>
        
        <select id="selectStudentById2" resultType="Student">
            select id,name,age,score from student where id=#{ooo}
        </select>
        
    </mapper>
  • 相关阅读:
    jquery的$().each,$.each的区别
    前端面试题整理
    JS中Null与Undefined的区别
    LESS介绍及其与Sass的差异(转载自伯乐在线,原文链接:http://blog.jobbole.com/24671/)
    APP 弱网测试
    ADB命令
    pytest之参数化parametrize的使用
    APP测试
    python 异常捕捉
    pip 安装依赖 requirements.txt
  • 原文地址:https://www.cnblogs.com/csslcww/p/9912403.html
Copyright © 2011-2022 走看看