上一页 1 ··· 9 10 11 12 13 14 15 16 17 ··· 67 下一页
摘要: 官网: http://mybatis.org/spring/zh/getting-started.html 过程 1、导入jar包 junit mybatis mysql spring aop mybatis-spring 2、编写配置文件 3、测试 二、过程 1、maven <!-- 依赖--> 阅读全文
posted @ 2020-07-19 16:25 市丸银 阅读(120) 评论(0) 推荐(0) 编辑
摘要: 三种方式 第二个比较好 导入包 <!-- https://mvnrepository.com/artifact/org.aspectj/aspectjweaver --> <dependency> <groupId>org.aspectj</groupId> <artifactId>aspectjw 阅读全文
posted @ 2020-07-19 14:01 市丸银 阅读(132) 评论(0) 推荐(0) 编辑
摘要: 注意:动态代理代理的是接口 一、过程 1、接口类 2、普通类继承接口 3、ProxyInvocationHandler.java(固定格式) 4、应用类 二、案例 public interface User { void add(); void delete(); void update(); vo 阅读全文
posted @ 2020-07-19 11:58 市丸银 阅读(136) 评论(0) 推荐(0) 编辑
摘要: 官网:https://docs.spring.io/spring/docs/5.2.7.RELEASE/spring-framework-reference/core.html#beans-java javaConfig 阅读全文
posted @ 2020-07-18 23:43 市丸银 阅读(113) 评论(0) 推荐(0) 编辑
摘要: 一、环境 1、导入包 maven 2、xml配置文件 <?xml version="1.0" encoding="UTF-8"?> <beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3. 阅读全文
posted @ 2020-07-18 23:25 市丸银 阅读(99) 评论(0) 推荐(0) 编辑
摘要: 官网:https://docs.spring.io/spring/docs/5.2.7.RELEASE/spring-framework-reference/core.html#beans-annotation-config 1、导入约束 2、配置注解支持 <?xml version="1.0" e 阅读全文
posted @ 2020-07-18 22:52 市丸银 阅读(138) 评论(0) 推荐(0) 编辑
摘要: 两种方式 byName:自动查找容器上下文,set方法名 与 bean id 名相同 byType: 自动查找容器上下文, class名称与类名相同 案例 人有猫和狗 1、pojo cat.java package com.wt.pojo; public class Cat { public voi 阅读全文
posted @ 2020-07-18 22:29 市丸银 阅读(120) 评论(0) 推荐(0) 编辑
摘要: ScopeDescription singleton (Default) Scopes a single bean definition to a single object instance for each Spring IoC container. prototype Scopes a sin 阅读全文
posted @ 2020-07-18 21:53 市丸银 阅读(110) 评论(0) 推荐(0) 编辑
摘要: 1、官网 https://docs.spring.io/spring/docs/5.2.7.RELEASE/spring-framework-reference/core.html#beans-dependencies 2、构造器注入(前面有) 3、Set方式注入(重点) A、依赖 : bean对象 阅读全文
posted @ 2020-07-18 20:39 市丸银 阅读(134) 评论(0) 推荐(0) 编辑
摘要: 1、别名 <alias name="" alias=""/> name 原名 alias 别名 2、beans <bean id="teacher" class="com.wt.pojo.Teacher" name="t1 t2"> id 在IOC容器的名称, class 对应的类, name 对应 阅读全文
posted @ 2020-07-18 19:28 市丸银 阅读(86) 评论(0) 推荐(0) 编辑
上一页 1 ··· 9 10 11 12 13 14 15 16 17 ··· 67 下一页