<set name="productInfos" inverse="true" order-by="productInfoId" >
<key>
<column name="ProductCategoryCode" length="20" />
</key>
<one-to-many class="com.sitow.bakeproduct.hibernate.vo.ProductInfo" />
</set>
order-by="productInfoId" 加一个order-by属性,他的值是set集合中的对象的一个字段
<key>
<column name="ProductCategoryCode" length="20" />
</key>
<one-to-many class="com.sitow.bakeproduct.hibernate.vo.ProductInfo" />
</set>
order-by="productInfoId" 加一个order-by属性,他的值是set集合中的对象的一个字段
ORM配置详解
本文介绍了一种在Hibernate中配置实体关联关系的方法,通过设置order-by属性来指定集合中元素的排序方式,确保数据的一致性和易读性。
514

被折叠的 条评论
为什么被折叠?



