I have an existing POCO class library where children collections are all stored in arrays. For instance, the Customer class has a Invoice[] array to hold its invoices:
class Customer
{
public int ID;
public Invoice[] _invoices;
}
class Invoice
{
public int ID;
public int CustomerID;
public string SomeData;
}
I cannot change those classes and I want to map them to an existing database using NHibernate.
I looked at the <array>
mapping but it seem to require an <index>
element. In my database, the [Invoice]
table does not have an index column. When Invoices of a Customer are loaded, I don't expect them to be at any specific position in the array.
What are my options?