我已经在数据库表NHibernate - 映射组件集合?
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
我知道我们可以使用“组件”映射到地图单行成不同的对象,但它可能以下如上所述映射一组对象?
非常感谢
詹姆斯
是否有一个原因,你不希望使用一个真正的集合映射到适当的表?这将是推荐的解决方案。 – 2009-06-12 18:42:24
这是一个遗留表,我害怕,所以我坚持下去。我显然不会这样设计它:) – James 2009-06-14 10:15:26