源码网商城,靠谱的源码在线交易网站 我的订单 购物车 帮助

源码网商城

mySQL 延迟 查询主表

  • 时间:2020-10-15 18:12 编辑: 来源: 阅读:
  • 扫一扫,手机访问
摘要:mySQL 延迟 查询主表
例:
[u]复制代码[/u] 代码如下:
<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的话,在执行查询主表的同时,相应的子表也会查询,添加了许多无用功。
  • 全部评论(0)
联系客服
客服电话:
400-000-3129
微信版

扫一扫进微信版
返回顶部