首页 > 代码库 > mybatis-oracle(ssi2)批量删除
mybatis-oracle(ssi2)批量删除
student类
package com.test.hou.po; public class Student { private int sid; private String sname; private int sage; public int getSid() { return sid; } public void setSid(int sid) { this.sid = sid; } public String getSname() { return sname; } public void setSname(String sname) { this.sname = sname; } public int getSage() { return sage; } public void setSage(int sage) { this.sage = sage; } }
2.StudentAction类
public String batchDeleteStudent(){ List<Student> studentslist=studentService.selectStudent(); studentService.batchDeleteStudent(studentslist); return "batchinsertstudent"; }
3.StudentMapperXml类
<delete id="batchDeleteStudent" parameterType="java.util.List"> delete from student <where> <foreach collection="list" open="(" separator="or" close=")" item="item" index="index"> sid =#{item.sid} </foreach> </where> </delete>
本文出自 “大话程序” 博客,请务必保留此出处http://houqida.blog.51cto.com/8877896/1562453
mybatis-oracle(ssi2)批量删除
声明:以上内容来自用户投稿及互联网公开渠道收集整理发布,本网站不拥有所有权,未作人工编辑处理,也不承担相关法律责任,若内容有误或涉及侵权可进行投诉: 投诉/举报 工作人员会在5个工作日内联系你,一经查实,本站将立刻删除涉嫌侵权内容。