
ibatis
文章平均质量分 87
a8366
这个作者很懒,什么都没留下…
展开
-
第1,2讲 --准备ibatis环境和查询表中所有的对象
基于以下的对话,决定看看ibatis 这个东东 ℡封号 17:21:41ibatis 和hibernate那个快?? 螃蟹 17:22:06各有特点 ℡封号 17:22:24多表查询 螃蟹 17:22:30ibatis的sql是自己写的,好优化,hibernate的sql不好控制 螃蟹 17:22:38多表的话当然是iba...2009-06-11 23:36:56 · 98 阅读 · 0 评论 -
第9讲 --ibatis优点总结
优点:l 与JDBC相比较减少了61%的代码量(不知道怎么算的这 么准:>>)l 简单l 架构级性能增强l sql语句与程序代码分离l 简化项目中的分工l 增强了移植性 缺点:l sql...2009-06-17 07:09:19 · 155 阅读 · 0 评论 -
第8讲 --sql主键生成方式
补充: Oracle中的序列 转载:http://onlylovexue.iteye.com/blog/266990Oracle中的序列号顾名思义就是创建一个序列号,可以在插入或者更新的时候调用,相当于是一个生成器 创建语法: create sequence myse increment by 1 --增长度 start with 1 --从哪里增...2009-06-17 07:06:10 · 167 阅读 · 0 评论 -
第7讲 --模糊查询实体对象
步骤:1.增加 Student.xml中 对模糊查询对象的支持 注意:模糊差用要使用到sql关键字 like ,并且要使用 $ $ 来引用参数而不是##,并且使用 ' ' <select id="selectStudentByName" resultClass="Student" parameterClass="String"> ...2009-06-16 08:16:01 · 201 阅读 · 0 评论 -
第6讲 --修改实体对象
步骤:1.增加 Student.xml中 对修改单个对象的支持 ,注意标签是 update <update id="updateStudentById" parameterClass="Student"> update student set sname=#sname#,major=#major#,birth=#birth#,score=#sc...2009-06-16 07:56:52 · 126 阅读 · 0 评论 -
第5讲 --删除指定id的单个对象
步骤:1.增加 Student.xml中 对删除单个对象的支持 ,注意标签是 delete <delete id="deleteStudentById" parameterClass="int"> delete from student where sid=#sid# </delete> 2.在实现类中 public voi...2009-06-16 07:34:37 · 260 阅读 · 0 评论 -
第4讲 --插入一个实体对象
步骤:1.增加 Student.xml中 对插入单个对象的支持 ,注意标签是 insert <insert id="insertStudent" parameterClass="Student"> insert into student values (#sid#,#sname#,#major#,#birth#,#score#) ...2009-06-16 07:28:24 · 299 阅读 · 0 评论 -
第3讲 --查询指定id的单个对象
步骤:1.增加 Student.xml中 对查找制定Id的单个对象的支持 <!-- parameterClass 指定参数的类型,#sid# 的写法是从外部等到参数值--><select id="selectStudentById" resultClass="Student" parameterClass="int"> select * f...2009-06-16 07:08:41 · 169 阅读 · 0 评论 -
什么是iBATIS
iBATIS就是我们通常所说的数据映射器(data mapper)。Martin Fowler在他的著作Patterns of Enterprise Application Architecture(Addison-Wesley Professional, 2002)中,对数据映射器模式是这样描述的:所谓映射器,是用于在对象和数据库之间搬运数据,同时保证对象、数据库以及映射器本身都相互独...原创 2009-06-15 19:30:26 · 263 阅读 · 0 评论 -
第10讲 --iBATIS查询条件为多个参数
当查询记录的时候,过滤记录的条件为多个的时候你就不能使用 parameterClass=int 等了,这个参数只能使用一次。 有两种解决方案:1.使用对象构造查询参数 步骤:a.改写student.xml <select id="selectStudentByIdAndName" resultClass="Student" parameterCla...2009-06-17 07:21:05 · 203 阅读 · 0 评论