mybatis学习:十
来源:互联网 发布:触宝输入法软件 编辑:程序博客网 时间:2024/06/06 02:13
在mybatis中使用注解
1.定义接口,在接口上加入注解
public interface IStudentDao { @Insert("insert into student values(default,#{name},#{phone})") public int addStudent(Student student); @Delete("delete from student where id = #{id}") public int deleteStudent(int id); @Select("select * from student limit #{start},#{size}") public List<Student> selectPage(Map<String, Object> map); @Update("update student set name=#{name}, phone=#{phone} where id=#{id}") public int updateStudent(Student student);}
2.在配置文件中标签中加入,把接口注册
<mappers> <!-- <package name="com.han.dao"/> --> <mapper class="com.han.dao.IStudentDao"/> </mappers>
阅读全文
1 0
- mybatis学习:十
- MyBatis学习(十)-MyBatis批量操作
- MyBatis学习系列十:Spring集成
- MyBatis学习笔记(十)注解映射
- 查询缓存---Mybatis学习笔记(十)
- 查询缓存---Mybatis学习笔记(十)
- Mybatis学习(十)mybatis一些问题的总结
- mybatis学习笔记(十)一对多关联表查询
- jee、spring、spring mvc、mybatis 学习(十)
- MyBatis源码学习笔记(十)SQL执行流程分析
- Mybatis学习笔记(十)【订单商品数据模型分析】
- MyBatis日志之Log4j示例——MyBatis学习笔记之十
- mybatis学习教程中级(十)mybatis和ehcache缓存框架整合(重点)
- MyBatis(十) 缓存
- mybatis系列十:mybatis缓存机制
- J2EE系列之MyBatis学习笔记(十)-- 使用注解配置sql映射器
- Mybatis学习---了解Mybatis
- 【Mybatis学习】Mybatis缓存
- Qt+libvlc+rtsp:视频层上绘图探究
- 4 ElasticSearch java api封装工具类
- 909422229_kotlin第二节:练习代码分享
- iOS: 热门搜索标签界面(Swift3)
- 使用ajaxfileupload.js上传文件成功之后,不走success的解决方法
- mybatis学习:十
- stack 生长方向
- Runtime.getRuntime().addShutdownHook(new Thread())
- pdf预览兼容ie,chrome,Firefox,2345,360亲测
- CI Weekly #20 | 从持续集成的角度看 “云” 的价值
- Android
- 选择排序
- react-native 采用xxtea加密传值
- Python 发送带附件的邮件