// 增
public interface StudentMapper{
@Insert("insert into student (stud_id, name, email, addr_id, phone)values(#{studId},#{name},#{email},#{address.addrId},#{phone})")
int insertStudent(Student student);
}
public interface StudentMapper{
@Insert("insert into student (name,email,addr_id,phone)values(#{name},#{email},#{address.addrId},#{phone})")
@Options(useGeneratedKeys=true,keyProperty="studId")
int insertStudent(Student student);
}
public interface StudentMapper{
@Insert("insert into student (name,email,addr_id,phone)values(#{name},#{email},#{address.addrId},#{phone})")
@SelectKey(statement="select stud_id_seq.nextval from dual",keyProperty="studId",resultType=int.calss,before=true)
int insertStudent(Student student);
}

// 改
@Update("update students set name=#{name},email=#{email}")
int updateStudent(Student student);

// 删
@Delete("delete form students where stud_id=#{studId}")
int deleteStudent(int studId)

// 查
@Select("select name,email,phone from students where stud_id=#{studId}")
Student findStudentById(Integer studId);

推荐使用xml文件进行配置,方面后续修改容易

最新文章

  1. ImageView属性
  2. laravel中的错误与日志
  3. [充电]C++ string字符串替换
  4. GIS开源软件大全
  5. 【bzoj1027】合金
  6. android如何播放资源文件夹raw中的视频
  7. JAVA 一个特殊的类 Object
  8. [原]Water Water Search Problems' Set~Orz【updating...】
  9. vs2010 调试C++程序 快捷键
  10. linux文件权限位SUID,SGID,sticky的设置理解
  11. android使用adb installapk出现can't find **.apk to install
  12. 利用Keil u4调试,精确实现软件延时
  13. 如何成为CSDN博客专家
  14. 如何检测被锁住的Oracle存储过程及处理办法汇总(转)
  15. css ie6最小高度问题
  16. SpringMVC 教程 - Handler Method
  17. 怎样用命令行开启或关闭Windows服务
  18. (链表) leetcode 21. Merge Two Sorted Lists
  19. [学习笔记]Java作用域变量申明和C、C++的差异性
  20. VC下加载JPG/GIF/PNG图片的两种方法

热门文章

  1. iOS开发实践之GET和POST请求
  2. nj08---process、console
  3. The in operator
  4. BZOJ 2049 LCT
  5. MetaSploit攻击实例讲解------Metasploit自动化攻击(包括kali linux 2016.2(rolling) 和 BT5)
  6. HibernateProperties 配置属性
  7. Intellij使用"easyexplore"
  8. pandas学习系列(一):时间序列
  9. vue 学习笔记1 入门
  10. sed命令的介绍