可能我表述有问题, 加载所有的liveinfo的数据 其实我是一条数据都没有 控制台出来的sql语句。 Hibernate: select liveinfo_s0_.room_id as room5_1_, liveinfo_s0_.live_id as live1_1_, liveinfo_s0_.live_id as live1_10_0_, liveinfo_s0_.check_in_date as check2_10_0_, liveinfo_s0_.check_out_date as check3_10_0_, liveinfo_s0_.emp_id as emp4_10_0_, liveinfo_s0_.room_id as room5_10_0_ from live_info liveinfo_s0_ where liveinfo_s0_.room_id=? Hibernate: select liveinfo_s0_.room_id as room5_1_, liveinfo_s0_.live_id as live1_1_, liveinfo_s0_.live_id as live1_10_0_, liveinfo_s0_.check_in_date as check2_10_0_, liveinfo_s0_.check_out_date as check3_10_0_, liveinfo_s0_.emp_id as emp4_10_0_, liveinfo_s0_.room_id as room5_10_0_ from live_info liveinfo_s0_ where liveinfo_s0_.room_id=? Hibernate: select liveinfo_s0_.room_id as room5_1_, liveinfo_s0_.live_id as live1_1_, liveinfo_s0_.live_id as live1_10_0_, liveinfo_s0_.check_in_date as check2_10_0_, liveinfo_s0_.check_out_date as check3_10_0_, liveinfo_s0_.emp_id as emp4_10_0_, liveinfo_s0_.room_id as room5_10_0_ from live_info liveinfo_s0_ where liveinfo_s0_.room_id=? Hibernate: select liveinfo_s0_.room_id as room5_1_, liveinfo_s0_.live_id as live1_1_, liveinfo_s0_.live_id as live1_10_0_, liveinfo_s0_.check_in_date as check2_10_0_, liveinfo_s0_.check_out_date as check3_10_0_, liveinfo_s0_.emp_id as emp4_10_0_, liveinfo_s0_.room_id as room5_10_0_ from live_info liveinfo_s0_ where liveinfo_s0_.room_id=? Hibernate: select liveinfo_s0_.room_id as room5_1_, liveinfo_s0_.live_id as live1_1_, liveinfo_s0_.live_id as live1_10_0_, liveinfo_s0_.check_in_date as check2_10_0_, liveinfo_s0_.check_out_date as check3_10_0_, liveinfo_s0_.emp_id as emp4_10_0_, liveinfo_s0_.room_id as room5_10_0_ from live_info liveinfo_s0_ where liveinfo_s0_.room_id=? Hibernate: select liveinfo_s0_.room_id as room5_1_, liveinfo_s0_.live_id as live1_1_, liveinfo_s0_.live_id as live1_10_0_, liveinfo_s0_.check_in_date as check2_10_0_, liveinfo_s0_.check_out_date as check3_10_0_, liveinfo_s0_.emp_id as emp4_10_0_, liveinfo_s0_.room_id as room5_10_0_ from live_info liveinfo_s0_ where liveinfo_s0_.room_id=? Hibernate: select liveinfo_s0_.room_id as room5_1_, liveinfo_s0_.live_id as live1_1_, liveinfo_s0_.live_id as live1_10_0_, liveinfo_s0_.check_in_date as check2_10_0_, liveinfo_s0_.check_out_date as check3_10_0_, liveinfo_s0_.emp_id as emp4_10_0_, liveinfo_s0_.room_id as room5_10_0_ from live_info liveinfo_s0_ where liveinfo_s0_.room_id=? ...... 还有很多。 上千条 估计是每个room_id查一遍。 lazy="true"or lazy="false"都试过了没用,只有 liveinfo_set所有属性全部删除...... 上边的才没有。 本人基础不是很好可能哪里搞砸了。 room实例 测试的数据库里有 1000多条。 感觉这样 影响 服务器资源,看看不删掉liveinfo_set的前提下 不加载这个数据可行瓦。
<set name="liveinfo_set" inverse="true" lazy="true">
<key column="room_id" ></key>
<one-to-many class="Liveinfo" />
</set>
可能我表述有问题,
加载所有的liveinfo的数据 其实我是一条数据都没有
控制台出来的sql语句。
Hibernate: select liveinfo_s0_.room_id as room5_1_, liveinfo_s0_.live_id as live1_1_, liveinfo_s0_.live_id as live1_10_0_, liveinfo_s0_.check_in_date as check2_10_0_, liveinfo_s0_.check_out_date as check3_10_0_, liveinfo_s0_.emp_id as emp4_10_0_, liveinfo_s0_.room_id as room5_10_0_ from live_info liveinfo_s0_ where liveinfo_s0_.room_id=?
Hibernate: select liveinfo_s0_.room_id as room5_1_, liveinfo_s0_.live_id as live1_1_, liveinfo_s0_.live_id as live1_10_0_, liveinfo_s0_.check_in_date as check2_10_0_, liveinfo_s0_.check_out_date as check3_10_0_, liveinfo_s0_.emp_id as emp4_10_0_, liveinfo_s0_.room_id as room5_10_0_ from live_info liveinfo_s0_ where liveinfo_s0_.room_id=?
Hibernate: select liveinfo_s0_.room_id as room5_1_, liveinfo_s0_.live_id as live1_1_, liveinfo_s0_.live_id as live1_10_0_, liveinfo_s0_.check_in_date as check2_10_0_, liveinfo_s0_.check_out_date as check3_10_0_, liveinfo_s0_.emp_id as emp4_10_0_, liveinfo_s0_.room_id as room5_10_0_ from live_info liveinfo_s0_ where liveinfo_s0_.room_id=?
Hibernate: select liveinfo_s0_.room_id as room5_1_, liveinfo_s0_.live_id as live1_1_, liveinfo_s0_.live_id as live1_10_0_, liveinfo_s0_.check_in_date as check2_10_0_, liveinfo_s0_.check_out_date as check3_10_0_, liveinfo_s0_.emp_id as emp4_10_0_, liveinfo_s0_.room_id as room5_10_0_ from live_info liveinfo_s0_ where liveinfo_s0_.room_id=?
Hibernate: select liveinfo_s0_.room_id as room5_1_, liveinfo_s0_.live_id as live1_1_, liveinfo_s0_.live_id as live1_10_0_, liveinfo_s0_.check_in_date as check2_10_0_, liveinfo_s0_.check_out_date as check3_10_0_, liveinfo_s0_.emp_id as emp4_10_0_, liveinfo_s0_.room_id as room5_10_0_ from live_info liveinfo_s0_ where liveinfo_s0_.room_id=?
Hibernate: select liveinfo_s0_.room_id as room5_1_, liveinfo_s0_.live_id as live1_1_, liveinfo_s0_.live_id as live1_10_0_, liveinfo_s0_.check_in_date as check2_10_0_, liveinfo_s0_.check_out_date as check3_10_0_, liveinfo_s0_.emp_id as emp4_10_0_, liveinfo_s0_.room_id as room5_10_0_ from live_info liveinfo_s0_ where liveinfo_s0_.room_id=?
Hibernate: select liveinfo_s0_.room_id as room5_1_, liveinfo_s0_.live_id as live1_1_, liveinfo_s0_.live_id as live1_10_0_, liveinfo_s0_.check_in_date as check2_10_0_, liveinfo_s0_.check_out_date as check3_10_0_, liveinfo_s0_.emp_id as emp4_10_0_, liveinfo_s0_.room_id as room5_10_0_ from live_info liveinfo_s0_ where liveinfo_s0_.room_id=?
......
还有很多。
上千条 估计是每个room_id查一遍。 lazy="true"or lazy="false"都试过了没用,只有 liveinfo_set所有属性全部删除......
上边的才没有。
本人基础不是很好可能哪里搞砸了。
room实例 测试的数据库里有 1000多条。
感觉这样 影响 服务器资源,看看不删掉liveinfo_set的前提下 不加载这个数据可行瓦。
<many-to-one name="room" column="room_id" class="Room" />
...
原来的struts.xml
<action name="viewRoom"
class="cn.sws.action.RoomManagerAction" method="viewRoom">
<result name="success" type="json">
<param name="includeProperties">
room.*,
ajaxResult
</param>
<param name="noCache">true</param>
<param name="ignoreHierarchy">false</param>
<param name="excludeNullProperties">true</param>
</result>
</action>
修改后的struts.xml
<action name="viewRoom"
class="cn.sws.action.RoomManagerAction" method="viewRoom">
<result name="success" type="json">
<param name="includeProperties">
room\.roomid,
room\.darea\.d_area_name, ajaxResult
</param>
<param name="noCache">true</param>
<param name="ignoreHierarchy">false</param>
<param name="excludeNullProperties">true</param>
</result>
</action>