MySQL延迟 查询主表
2024-08-22 09:48:35
在主外键表存在关系的时候如果加上"lazy=true"的话,则表明延迟,即只查询主表中的内容,而不查询外键表中的内容。
<hibernate-mapping>
<class name="com.pojo.Sortp" table="sortp" catalog="shjdc">
<id name="id" type="java.lang.Integer">
<column name="Id" />
<generator class="assigned" />
</id>
<property name="name" type="java.lang.String">
<column name="Name" length="40" not-null="true" />
</property>
<set name="productses" inverse="true" cascade="all" lazy="true">
<key>
<column name="Sortid" not-null="true" />
</key>
<one-to-many class="com.pojo.Products" />
</set>
</class>
</hibernate-mapping>
一般情况下就是把lazy设为true,而不是false,因为,假如设为false的话,在执行查询主表的同时,相应的子表也会查询,添加了许多无用功。
最新文章
- Coursera-Getting and Cleaning Data-week4-R语言中的正则表达式以及文本处理
- 烂泥:虚拟化KVM安装与配置
- PHP memcached 扩展的安装
- UVA 1639(组合数学)
- 调用webservice,解析返回数据为xml格式的字符串,进行数据绑定
- 外星人的供给站	(区间覆盖 t贪心)
- 嵌入式学习笔记(虚拟机共享文件夹配置-Ubuntu系统中)
- CSS3 总结-2
- Linux下NC反弹shell命令
- Lintcode373 Partition Array by Odd and Even solution 题解
- Cocos2dx使用TextField实现输入框
- Linux 多进程实现方法
- IDEA2017安装actibpmn插件中文乱码问题解决
- linux 信号处理 四
- 从volatile说到i++的线程安全问题
- get 方法向后台提交中文乱码问题
- PIE SDK介绍
- linux设备驱动的分层设计思想--input子系统及RTC
- path.join()和path.resolve()区别
- 《C#高效编程》读书笔记03-推荐使用is或as操作符而不是强制类型转换
热门文章
- 【转】Axure RP9.0.0.3661Team Edition激活码
- javascript添加到收藏夹写法
- Deepin15.11源码安装Nginx17.5包括stream模块和njs模块
- 【LeetCode】无重复字符的最长子串【滑动窗口法】
- ForEach Controller学习
- Java开发笔记(一百二十六)Swing的窗口
- python 之 Django框架(路由系统、include、命名URL和URL反向解析、命名空间模式)
- T100-----调试程序,快速定位到错误行
- JMeter中文乱码的解决
- JavaJDK多任务执行框架(六)