![](https://img-blog.csdnimg.cn/20201014180756916.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
mybatis
深海梨
a geek~
展开
-
MyBatis ( 三)分页查询
1.db.propertiesdriver=com.mysql.jdbc.Driver url=jdbc:mysql://localhost:3306/questions?characterEncoding=utf8 username=root password=1232.MyBatis-config.xml<?xml version="1.0" encoding="UTF-8"?> <!DOCTY原创 2017-09-04 13:45:53 · 234 阅读 · 0 评论 -
MyBatis-Spring(二)中的no declaration can be found for element 'context:annotation-con
tool 全部改成 context原创 2017-09-13 12:11:01 · 674 阅读 · 0 评论 -
MyBatis (四) 注解和存储过程
注解,存储过程原创 2017-09-08 12:28:32 · 3217 阅读 · 0 评论 -
MyBatis (一)基本步骤
1.com.pojo1) mybatis-config.xml<?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE configuration PUBLIC "-//mybatis.org//DTD Config 3.0//EN" "http://mybatis.org/dtd/mybatis-3-config.dtd"> <configuration>原创 2017-08-31 21:41:35 · 179 阅读 · 0 评论 -
MyBatis(二)mapper 代理
1.association & collection比如同时有A.java和B.java两个类,A.java如下: public class A{ private B b1; private List<B> b2; } 在映射b1属性时用association标签, 映射b2时用collection标签,分别是一对一,一对多的关系<有代理的步骤>1.mybatis-config.xm原创 2017-09-02 13:53:17 · 171 阅读 · 0 评论 -
MyBatis-Spring(一)
1.在lib 包中添加:主要是添加多一个1.3的 mybatis-spring jar 包 2.pojo 实体类–>mapper—>config.xml—>mapper/IMP—>applicationContext.xml其中 config.xml 中省略了连接数据库的操作,只需要保留typeAliases和mappers标签3.mapper 中的 IMP1)定义spring给mybatis提供原创 2017-09-11 14:49:35 · 335 阅读 · 0 评论 -
MyBatis-Spring(二)使用注解
在MyBatis-Spring(一)基础上的改进:1.1 在com.mapper.IMP下@Repository:用于标注数据访问组件,即 DAO 组件@Repository // 数据访问层:自动 new 一个 AccountMapperIMP,默认对象名字:accountMapperIMP'public class AccountMapperIMP implements AccountMapp原创 2017-09-12 17:20:51 · 206 阅读 · 0 评论