NHibernate多对多与第三张桌子 [英] NHibernate Many to Many with third table

查看:80
本文介绍了NHibernate多对多与第三张桌子的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我是休眠世界的新手.我有一个场景,我的多对多关系表不仅具有主键.我有一个关系表,用于定义我所有具有类型ID的关系,以标识关系的类型和创建关系的日期.结构将是parentId,ChildId,RelationShipTypeId,UpdateDateTime和UpdateUserId

前任.订单,发票,订单明细,客户和产品关系. ProductRlationship表具有parentid,childid,RelationshipTypeid.订单将与使用不同typeid的其他表有关系.

如何使用nhib查询和更新此模型.

预先感谢您的帮助.

Hi I am new to the nhibernate world. I have a scenario where my many to many relationship table has more than just the primary keys. I have one relationship table that defines all my relationship with the type id, to identify the type of relationship and the date when the relationship was created. Structure will be, parentId, ChildId, RelationShipTypeId, UpdateDateTime and UpdateUserId

Ex. Order, Invoice, Orderdetails,Customer and ProductRelationship. ProductRlationship table has parentid, childid,RelationshipTypeid. Order will have a relationship with other tables using different typeid''s.

How do I use nhib to QUERY AND UPDATE this model.

Thanks in advance for your help.

推荐答案

您可以使用NHibernate定义这种关系,但是我不记得怎么做!中间表称为交叉引用(或XRef)表,但通常不包含关系日期.

最好的选择是在NHibernate论坛上发帖,因为它专门介绍NHibernate:-).
You can use NHibernate to define this relationship, but I cannot remember how! The Intermediate Table is called a Cross-Ref (or XRef) table, but normally this does not contain the relationship date.

Your best bet is to post on the NHibernate forum as this specialises in NHibernate :-).


这篇关于NHibernate多对多与第三张桌子的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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