• 博客园logo
  • 会员
  • 众包
  • 新闻
  • 博问
  • 闪存
  • 赞助商
  • HarmonyOS
  • Chat2DB
    • 搜索
      所有博客
    • 搜索
      当前博客
  • 写随笔 我的博客 短消息 简洁模式
    用户头像
    我的博客 我的园子 账号设置 会员中心 简洁模式 ... 退出登录
    注册 登录
rongmuping
博客园 首页 新随笔 联系 订阅 订阅 管理

2022年4月10日

17.DAO层管理session
摘要: 一、hibernate获取 二、配置 / util编写 1.hbm.xml 1 <!-- 开启session的线程管理模式 --> 2 <property name="current_session_context_class">thread</property> 2.util 1 package 阅读全文
posted @ 2022-04-10 22:45 荣慕平 阅读(72) 评论(0) 推荐(0)
 
16.hql查询优化
摘要: 概述 1 @Test 2 public void testQuChong(){ 3 4 SessionFactory sessionFactory = getSessionFactory(); 5 Session session = sessionFactory.openSession(); 6 T 阅读全文
posted @ 2022-04-10 22:20 荣慕平 阅读(37) 评论(0) 推荐(0)
 
15.开启二级缓存
摘要: 一、导入依赖 1 <!-- https://mvnrepository.com/artifact/org.hibernate/hibernate-ehcache --> 2 <dependency> 3 <groupId>org.hibernate</groupId> 4 <artifactId>h 阅读全文
posted @ 2022-04-10 21:48 荣慕平 阅读(101) 评论(0) 推荐(0)
 
14.hibernate二级缓存初步
摘要: 一、初步 阅读全文
posted @ 2022-04-10 17:02 荣慕平 阅读(17) 评论(0) 推荐(0)
 
13.hibernate批量操作
摘要: 一、批量插入 1 @Test 2 public void saveAll(){ 3 4 SessionFactory sessionFactory = getSessionFactory(); 5 Session session = sessionFactory.openSession(); 6 T 阅读全文
posted @ 2022-04-10 16:32 荣慕平 阅读(20) 评论(0) 推荐(0)
 
12.连接查询
摘要: 一、查询策略 二、无迫切连接查询 1 @Test 2 public void test1(){ 3 4 SessionFactory sessionFactory = getSessionFactory(); 5 Session session = sessionFactory.openSessio 阅读全文
posted @ 2022-04-10 14:43 荣慕平 阅读(23) 评论(0) 推荐(0)
 
11.命名查询
摘要: 一、hbm.xml 1 <?xml version='1.0' encoding='utf-8'?> 2 <!DOCTYPE hibernate-mapping PUBLIC 3 "-//Hibernate/Hibernate Mapping DTD 3.0//EN" 4 "http://www.h 阅读全文
posted @ 2022-04-10 11:28 荣慕平 阅读(30) 评论(0) 推荐(0)
 
10.hql查询
摘要: 一、hql查询初步 二、demo 1.修改demo 1 @Test 2 public void testCRUD_CRU(){ 3 4 SessionFactory sessionFactory = getSessionFactory(); 5 Session session = sessionFa 阅读全文
posted @ 2022-04-10 09:28 荣慕平 阅读(43) 评论(0) 推荐(0)
 
 

公告


博客园  ©  2004-2025
浙公网安备 33010602011771号 浙ICP备2021040463号-3