在主外键表存在关系的时候如果加上"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的话,在执行查询主表的同时,相应的子表也会查询,添加了许多无用功。

最新文章

  1. Coursera-Getting and Cleaning Data-week4-R语言中的正则表达式以及文本处理
  2. 烂泥:虚拟化KVM安装与配置
  3. PHP memcached 扩展的安装
  4. UVA 1639(组合数学)
  5. 调用webservice,解析返回数据为xml格式的字符串,进行数据绑定
  6. 外星人的供给站 (区间覆盖 t贪心)
  7. 嵌入式学习笔记(虚拟机共享文件夹配置-Ubuntu系统中)
  8. CSS3 总结-2
  9. Linux下NC反弹shell命令
  10. Lintcode373 Partition Array by Odd and Even solution 题解
  11. Cocos2dx使用TextField实现输入框
  12. Linux 多进程实现方法
  13. IDEA2017安装actibpmn插件中文乱码问题解决
  14. linux 信号处理 四
  15. 从volatile说到i++的线程安全问题
  16. get 方法向后台提交中文乱码问题
  17. PIE SDK介绍
  18. linux设备驱动的分层设计思想--input子系统及RTC
  19. path.join()和path.resolve()区别
  20. 《C#高效编程》读书笔记03-推荐使用is或as操作符而不是强制类型转换

热门文章

  1. 【转】Axure RP9.0.0.3661Team Edition激活码
  2. javascript添加到收藏夹写法
  3. Deepin15.11源码安装Nginx17.5包括stream模块和njs模块
  4. 【LeetCode】无重复字符的最长子串【滑动窗口法】
  5. ForEach Controller学习
  6. Java开发笔记(一百二十六)Swing的窗口
  7. python 之 Django框架(路由系统、include、命名URL和URL反向解析、命名空间模式)
  8. T100-----调试程序,快速定位到错误行
  9. JMeter中文乱码的解决
  10. JavaJDK多任务执行框架(六)