开发者

NHibernate Many-to-many with a boolean flag on the association table

I am doing some work on an application that uses an existing schema that cannot be altered. Whilst writing my NHibernate mappings I encountered a strange many-to-many relationship. The relationship is defined in the standard way as in this question with the addition of a boolean flag on the association table that signifies if the relationship is legal. This seems somewhat redundant but as I say, cannot be changed.

Is it possible to define this relationship in Nhibernate without resorting to using a third class to represent the association? Perhaps by applying a filter?

M开发者_Go百科any thanks.


This is something I run into quite a bit with NHibernate and keep coming back to the following resources. This article explains how you can create the Many-to-Many association and This Question shows how you can create the filter on your Many-to-Many without having to map the actual association class.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜