各位用户为了找寻关于mySQL 延迟 查询主表的资料费劲了很多周折。这里教程网为您整理了关于mySQL 延迟 查询主表的相关资料,仅供查阅,以下为您介绍关于mySQL 延迟 查询主表的详细内容

例: 

代码如下:

<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的话,在执行查询主表的同时,相应的子表也会查询,添加了许多无用功。