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

Posted by Nigel on Stack Overflow See other posts from Stack Overflow or by Nigel
Published on 2010-04-29T23:22:10Z Indexed on 2010/04/29 23:27 UTC
Read the original article Hit count: 194

Hi

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?

Many thanks.

© Stack Overflow or respective owner

Related posts about nhibernate

Related posts about nhibernate-mapping