Suppose I have this class:
public class GroceryListItem()
{
public GroceryList { get; private set; }
public GroceryListItem(GroceryList groceryList)
{
GroceryList = groceryList;
}
}
What is the NHibernate mapping file access strategy for this scenario? (i.e. <one-to-many name=”GroceryList” column=”XXX” access=”?????” />)
It turns out the answer is pretty simple — no special access is required. NHibernate is smart enough to work this out on its own. In other words, the code in my question works correctly with the following line in the mapping file: