摘要: spring IOC 控制反转 核心思想 了解IOC,首先需要了解DI 软件设计的重要思想 依赖注入 什么事依赖注入呢? 例子:设计行李箱类 传统写法:首先设计轮子,根据轮子设计底盘,根据底盘设计箱体。OK,设计完成。 换成java中类的描述:1.轮子类:Class Tire { int size; 阅读全文
posted @ 2019-08-31 12:08 小张candy 阅读(172) 评论(0) 推荐(0) 编辑
摘要: <?xml version="1.0" encoding="utf-8" ?><beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance 阅读全文
posted @ 2019-04-15 17:14 小张candy 阅读(582) 评论(1) 推荐(0) 编辑
摘要: 四个方面:事务的性质,事物的隔离级别,hibernate配置事务的隔离级别,使用事务小案例 1. 事务的性质: 四种性质:原子性,一致性,隔离性,持久性。 原子性:原子,不可再分。一个操作不能分为更小的操作。要不全部执行,要不全不执行。 一致性:事务在完成时,必须使得所有的数据保持一致的状态。(ps 阅读全文
posted @ 2019-04-11 18:33 小张candy 阅读(316) 评论(0) 推荐(0) 编辑
摘要: 缓存目的:提高效率。 sql语句与数据库交互,返回数据组装成对象存入session缓存中。程序查询时,优先访问缓存中是否存在id相同对象。 hibernate中session缓存(一级缓存)存在 阅读全文
posted @ 2019-04-11 18:33 小张candy 阅读(121) 评论(0) 推荐(0) 编辑
摘要: 配置文件 阅读全文
posted @ 2019-04-11 18:32 小张candy 阅读(148) 评论(0) 推荐(0) 编辑
摘要: HQL是针对封装好的对象。 HQL :hibernate自己用的sql语句 HQL不能出现表中的任何内容 不经常使用开发中 基本查询:String hql = "from com.sikiedu.domain.User"; 条件查询: 基本条件查询:hql = "from com.sikiedu.d 阅读全文
posted @ 2019-04-11 18:32 小张candy 阅读(669) 评论(0) 推荐(0) 编辑
摘要: 1.配置文件配置 阅读全文
posted @ 2019-04-11 18:31 小张candy 阅读(281) 评论(0) 推荐(0) 编辑
摘要: <?xml version="1.0" encoding="UTF-8"?><beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 阅读全文
posted @ 2019-04-11 18:31 小张candy 阅读(1389) 评论(0) 推荐(0) 编辑
摘要: <?xml version="1.0" encoding="UTF-8"?><beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 阅读全文
posted @ 2019-04-11 18:31 小张candy 阅读(336) 评论(0) 推荐(0) 编辑
摘要: public class Client { /** * 获取spring的IOC核心容器,并根据id获取对象 * ApplicationContext的三个常用实现类 * classPathXmlApplicationContext: 它可以加载路径下的配置文件,要求配置文件必须在类路径下。不在的话 阅读全文
posted @ 2019-04-11 18:31 小张candy 阅读(1184) 评论(0) 推荐(0) 编辑