摘要:
XML方式的配置实现插入数据是自动获取插入数据的ID值并封装到Bean对象中 <insert id="add" parameterType="com.itheima.domain.User"> <selectKey keyProperty="id" keyColumn="id" order="AFT 阅读全文
摘要:
Maven的pom.xml 坐标配置 <?xml version="1.0" encoding="UTF-8"?> <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSche 阅读全文
摘要:
整合的配置文件: spring (applicationContext.xml) <?xml version="1.0" encoding="UTF-8"?> <beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi=" 阅读全文
摘要:
:首先理解什么叫维护关系: 就是维护关系的一方需要在数据库表中建立外键! 学生的表(外键sgid) 班级的表 这里是学生(多的一方) 维护着关系 %%%%%%%%%%%%%%%%%%一的一方包含多的一方resultMap——list的写法 %%%%%%%%%%%%%%%%%%%%%%%%%%%% < 阅读全文
摘要:
1需求:根据id查询学生的身份证信息 学生实体Bean public class Student { private Integer id; private String name; private Card card; //关联的身份证对象 学生的Mapper(注意当学生类中包含其他类的bean对 阅读全文
摘要:
1导入jar包 2编写配置文件 <?xml version="1.0" encoding="UTF-8"?> <beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XM 阅读全文
摘要:
1:当传入的参数为 对象类型时 的动态语句 查询: <?xml version="1.0" encoding="UTF-8" ?> <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd 阅读全文
摘要:
select xx.empno,xx.empname,.....xx.deptno form (select rownum, id, emp.* from emp where rownum < size) xx where id > start start=(当前页-1)* size 阅读全文
摘要:
附加:mybatis配置文件 <?xml version="1.0" encoding="UTF-8" ?> <!DOCTYPE configuration PUBLIC "-//mybatis.org//DTD Config 3.0//EN" "http://mybatis.org/dtd/myb 阅读全文
摘要:
1:导入mybatis相关jar 2:编写Mybatis配置文件(mybatis.xml 名字任意取都行) (最主要的配置 连接数据库 和关联 实体与数据库的映射文件) <?xml version="1.0" encoding="UTF-8" ?> <!DOCTYPE configuration P 阅读全文