摘要: 四个方面:事务的性质,事物的隔离级别,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) 编辑
摘要: org.springframework spring-test 5.0.2.RELEASE 阅读全文
posted @ 2019-04-11 18:30 小张candy 阅读(106) 评论(0) 推荐(0) 编辑
摘要: XML文档格式内容如下 <?xml version="1.0" encoding="UTF-8"?> <root> <field type="1" store="yes">title1</field> <field type="2" store="no">title2</field> <field  阅读全文
posted @ 2019-04-11 18:30 小张candy 阅读(400) 评论(0) 推荐(0) 编辑
摘要: package config;import com.mchange.v2.c3p0.ComboPooledDataSource;import org.apache.commons.dbutils.QueryRunner;import org.springframework.beans.factory 阅读全文
posted @ 2019-04-11 18:30 小张candy 阅读(356) 评论(0) 推荐(0) 编辑