您的位置:首页 > 移动开发

*-mapper.xml配置文件

2016-07-26 00:00 507 查看
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="stud">

<!-- 或

<mapper namespace="cn.mapper.StudMapper">

-->

<!-- 打开二级缓存 -->
<cache readOnly="true" eviction="FIFO" size="1000" flushInterval="100000"></cache>

<!-- 打开mybatis-ehcache二级缓存,需要在根目录下创建ehcache.xml

<cache type="org.mybatis.caches.ehcache.EhcacheCache" readOnly="true" eviction="FIFO" size="1000" flushInterval="100000"></cache>

-->
<select id="all" resultType="map" parameterType="java.lang.String">
select * from studs where stud_id=#{kkkk}
</select>

<insert id="save" parameterType="cn.test.Stud">

insert into studs(stud_id,stud_name,stud_age)

values(#{id},#{name},#{age})

</insert>

</mapper>
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: