NHibernate 多对多关系表中的附加字段 [英] additional fields in NHibernate many-to-many relation tables

查看:19
本文介绍了NHibernate 多对多关系表中的附加字段的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当我与 nhibernate 建立多对多关系并让 nhibernate 生成我的数据库架构时,它会添加一个包含相关实体主键的附加表.是否可以为此添加其他字段并访问它们而无需手动使用 sql?

when i have a many-to.many relation with nhibernate and let nhibernate generate my db schema, it adds an aditional table that contains the primary keys of the related entities. is it possible to add additional fields to this and access them without having to hassle around with sql manually?

推荐答案

我认为这不可能.如果您说该关系具有某种状态而不是本质上它本身就是一个对象,并且应该如此对待(映射).

I don't think thats possible. If you are saying that the relation has some state than in essence it is an object in it's own right and should be treated (mapped) as such.

这篇关于NHibernate 多对多关系表中的附加字段的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆