首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 软件管理 > 软件架构设计 >

hibernate question please help

2012-10-24 
hibernate question please help.Hi,I have a question that bother me two days and I have no clue how

hibernate question please help.
Hi,

I have a question that bother me two days and I have no clue how it works.

Two object: orderItem, warehouseItem. OrderItem has reference to warehouseItem.
they both refer to an object called vendorInfo.

public class VendorInfo {
...
List<Guest> guests = new ArrayList<Guest>();

...
}

the mapping is in OrderItem.html.xml (as follows) but no mapping in (warehouseItem.hbm.xml):

OrderItem.hbm.xml:

<bag name="guests" table="order_item_unit" lazy="true" inverse="true" cascade="all">
<key column="order_item_id" />
<one-to-many />
</bag>

The question is when I commit a update transaction on warehouseItem, will the value of guests change? My obersavation is it is changed ( the id of guest is null now). 
In the log I saw the update sql ( after I turn on the display sql). My question si why the guests is changed? The mapping is on the OrderItem, I debug and don't do any thing on the orderItem. ( the hiberation session I used to operate on warehouseItem is different with the hiberanation session of orderItem is using). How the id of guest become to null?

Sorry I can't try Chinese now but I need help desperately. If anybody can help please send me an email at this site.

Thank you very very much,
Ada

热点排行