I have an Order mapping with many OrderItems. The mapping correctly saves both the Order and OrderItems to the database when I do a save on just the Order, but when I reload that order, the List of OrderItems that the order contains is filled with null values (for all the othe order items in the table) until it reaches the OrderItem that has the Order's foreign key. So the total count of null order items is the row count of the OrderItems table, (sans the actual order items that are related to the Order). Here's my mappings:
Order:
<list name="OrderItems" table="OrderItems" cascade="all" inverse="true" >
<key column="OrderID"/>
<index column="OrderItemID" />
<one-to-many class="OrderItem" not-found="ignore" />
</list>
OrderItem:
<many-to-one name="Order" class="Order" column="OrderID" not-null="true" />
Here's the Order's class implementation:
public class Order : {
private IList<OrderItem> orderItems = new List<OrderItem>();
I read that nHibernate doesn't support Lists as the many part of a relationship, but the save works correctly, just not the load. Do I have to convert everything over to Sets in order for this to work?