0
添加新的列有3個表Order
表Product
表OrderProductMapping
表 那裏只有2實體clases是:Order
和Product
Order
和Product
表共享一個many-tomany
關係。這意味着1個訂單可以有多個產品,一個產品可以屬於多個訂單。 並繪製這個,有一個名爲第三個表OrderProductMapping
休眠:在連接表
下面是我從order.hbm
文件
<set name="product" table="OrderProductMapping">
<key column="orderId"/>
<many-to-many class="Product">
<column name="productId" />
</many-to-many>
</set>
下面的映射是從product.hbm
文件映射
<set name="order" table="OrderProductMapping" inverse="true">
<key>
<column name="orderId"/>
</key>
<many-to-many class="Product">
<column name="productId" />
</many-to-many>
</set>
現在我需要在映射表中引入一個新的列應該如何進行?任何幫助或指針都會很棒。