用于映射表的附加列的子类
我有实体类 A 和 Fluent NHibernate 映射 AMap ,它映射数据库表中的一些列(缺少一些字段)。我想创建从 A 继承的类 B (为了不破坏与其他实体的关系)并对其进行映射以允许访问未由基类映射的列。问题是我无法更改基类(A 和 AMap)中的任何代码行。这个问题有什么解决办法吗?
I have entity class A and Fluent NHibernate map for it AMap which maps some columns from database table (a few fields are missing). I would like to create class B which inherits from A (to not break relations with other entities) and map for it to allow access to columns not mapped by base class. The problem is that I cannot change any line of code in base classes (A and AMap). Is there any solution for this problem?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
我不确定你想如何使用它,但这可以做到
,那么这应该是可能的,
但不知道未来是否有问题
im not sure how you wanna use it but this could do
then this should be possible
dont know if there are problems down the road though
据我了解要求,这是一个简单的 每个类层次结构的表< /a> 映射。为此,您需要一个鉴别器列。
有关映射,请参阅该页面上的最后一个示例:Fluent Wiki。
As far as I understand the requirement, this is a simple table per class hierarchy mapping. You'll need a discriminator column for that.
For the mapping see the last example on that page: Fluent Wiki.