- 博客(6)
- 收藏
- 关注
原创 Spring学习笔记五 JDBC DAO
1.直接使用JDBCTemplate A.手动实例化数据源 B.手动实例化JdbcTemplate Spring环境下,所有的JavaBean都应该交给IOC容器进行管理。 那就意味着DataSource的初始化以及为DAO层注入DataSource都需要通过容器来完成 要求要在DAO增使用JdbcTemplate必须继承:JdbcDAOSupport系列的基础类。 2.集成Spring DA...
2019-04-10 20:12:30
198
原创 Spring学习笔记四 AOP Advisor 注解
注解spring AOP Advisor 1.第一步 1.导入jar包 2.编写目标方法 @Service public class StudentService { public boolean save(String name) { System.out.println("StudentService...save"); return true; } } 3.配置...
2019-04-10 10:19:12
1019
原创 Spring学习笔记三 注解AOP
一.第一步 1.导入jar包 2.编写目标方法 @Service public class StudentService { public boolean save(String name) { System.out.println("StudentService...save"); return true; } } 3.配置文件 <?xml version=...
2019-04-10 10:11:08
139
原创 Spring学习笔记二 AOP
1.Spring AOP(基于AspectJ框架的AOP使用) 1.1实现步骤 导入jar包 添加命名空间 配置bean <bean id="MyAdvice" class="cn.wang.advice.MyAdvice"></bean> <bean id="PersonService" class="cn.wang.service.PersonService"&g...
2019-04-10 10:08:12
131
原创 Spring学习笔记一 实例化Bean的三种方式
1.Spring IOC入门案例 A.添加spring开发环境 B.编写spring与DAO C.编写配置文件,将service与dao交给spring管理 D.测试 //加载classPath下的文件 //ApplicationContext ac = new ClassPathXmlApplicationContext("applicationContext.xml"); Applica...
2019-04-10 09:44:14
183
原创 Hibernate_学习笔记_级联关系
级联关系 一对多 多对一 一对一 多对多 好处: 加载其中一个实体的时候,可以直接使用实体所关联的其他实体 单项的多对一(使用的频率最高) 实现步骤 1.修改实体类 a.去掉实体类生成的外键 b.增加“一”的一方最为成员变量(getter和setter) 2.修改映射文件 a.去掉原有的关联外键的property配置 b.增加many-to-one标签 <many...
2019-03-28 16:04:45
200
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人
RSS订阅