Last summer, I asked a question regarding how to add new object to an IList mapped as a one-to-many with NHibernate. One of the answers let me to this paragraph in the documentation:
Please note that NHibernate does not support bidirectional one-to-many associations with an indexed collection (list, map or array) as the "many" end, you have to use a set or bag mapping.
While I am pretty sure I understand what this paragraph says, I have no idea why or how to work around this limitation. As I am now again working with a model that seems to require a "bidirectional one-to-many association with an index collection", I figured the time was right for follow-up questions:
Why does NHibernate have this limitation on associations? It is my impression that the guys behind NHibernate are quite clever, so I assume there is a pretty good reason.
What are the common workarounds for this shortcoming? Making the collection a non-indexed bag and adding an explicit
Position
property to the child class? Any better solutions?