NHibernate (fluent) and many to many mappings with extra metadata?

This answer is general to ORM and not specific to FNH.

This answer is general to ORM and not specific to FNH In the (very good) book Nbernate In Action (see Section 6.3.2) the authors express the opinion that it's almost never worthwile using a many-many mapping because you'll almost always discover (maybe later) that you want to attach extra meta-data to the 'link' between the two entities and so you may as well model this an an entitiy in it's own right (as you say have done in your question). As you've discovered already, you need to create the StoreProducts entity and a many-one and a one-many to complete the association. ...just though you'd like to confirmation that this is a 'recommended' approach :-).

Your going to have to map a 3rd entity, I don't think the built in Many To Many functionality supports that. Would be cool if someone proved me wrong though.

Yup - I have come to that conclusion myself with Store having a collection of StoreProducts where I carry the specific store/product specific data and this in turn references the Product – Shaun Wilde Oct 14 '09 at 9:39.

I cant really gove you an answer,but what I can give you is a way to a solution, that is you have to find the anglde that you relate to or peaks your interest. A good paper is one that people get drawn into because it reaches them ln some way.As for me WW11 to me, I think of the holocaust and the effect it had on the survivors, their families and those who stood by and did nothing until it was too late.

Related Questions