【发布时间】:2009-06-13 02:50:32
【问题描述】:
我有以下数据库表
CREATE TABLE ProductPrice
ProductID
Qty1
Price1
Qty2
Price2
Qty3
Price3
我的域类看起来像这样
Class ProductPrice
ProductID As Integer
PriceBands As IList(of PriceBand)
End Class
Class PriceBand
Qty As Integer
Price As Decimal
End Class
我知道我们可以使用“组件”映射将单行映射到不同的对象,但是否可以如上所述映射对象集合?
非常感谢
詹姆斯
【问题讨论】:
-
您是否有理由不希望使用映射到正确表的真实集合?这将是推荐的解决方案。
-
恐怕这是一张旧表,所以我坚持使用它。我显然不会这样设计 :)
标签: nhibernate nhibernate-mapping