use a <bag> mapped to a private field and expose the array in your class. An array has index, a bag is an unordered, not indexed, "bolsa de gatos"
2009/11/28 RedHotSLy <[email protected]> > Hi, > > I have an existing POCO class library that uses arrays for children > collections and I have an exiting database that I cannot change. > > I want to use the <array> mapping but it requires an <index> element. > In my existing database, the children tables do not have index > columns. For instance, when the Invoices of a Customer are loaded, I > don't expect them to be at any specific position in the array. > > I think I need a IUserCollectionType to solve this problem. I'd need a > collection type that satisfies the <array> mapping; a type similar to > the nhibernate array type but that produces index value on-the-fly > (and that wouldn't try to save it to the database). > > Has this been done before? Is there any chance I could get the source > code for such a collection type? This is my first nhibernate project > so I'd rather not have to understand the inner workings at this point. > It'd be great if I could just get started and later learn how to > extend nhibernate. > > Thanks a lot > > - Sly > > By the way, I have posted a very similar question on SO and this is > where I was told about IUserCollectionType. > See > http://stackoverflow.com/questions/1746414/how-configure-nhibernate-to-map-to-an-array-if-there-is-no-index-in-the-table > > -- > > You received this message because you are subscribed to the Google Groups > "nhusers" group. > To post to this group, send email to [email protected]. > To unsubscribe from this group, send email to > [email protected]<nhusers%[email protected]> > . > For more options, visit this group at > http://groups.google.com/group/nhusers?hl=en. > > > -- Fabio Maulo -- You received this message because you are subscribed to the Google Groups "nhusers" group. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/nhusers?hl=en.
