开发者

mapping entity from multiple table with NHibernate

开发者 https://www.devze.com 2023-01-05 16:29 出处:网络
I hope you can help somewhat novice to NHibernate with the following question. Suppose we have two table: Page and WorkPage. Page table contains unversioned data and WorkPage contains versioned D开发者

I hope you can help somewhat novice to NHibernate with the following question. Suppose we have two table: Page and WorkPage. Page table contains unversioned data and WorkPage contains versioned D开发者_如何学编程ata of the same Page, i.e. there is a relation one-to-many between Page and WorkPage.

In the code we have an entity containing all of the properties from Page and WorkPage tables, and what is more these properties are on a par - they are not grouped into any sub-entity for versioned data and unversioned data.

How would I map such an entity to these tables with NHibernate?


You wouldn't? Nor would I see why you would want to. It sounds like from an domain point of view you have two separate entities and possibly a third entity that is missing. The root which holds a Page and WorkPage.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号