I am relatively new to NHberinate , and am using it as an alternative to EF cause it works nicely on Mono.
All my entities are mapped with AutoMapping.
The problem is I have a one to many relationship setup. One of Item class has an of localizedText class. I also setup a convention for Cascade all.
public class CascadeAll : IHasOneConvention, IHasManyConvention, IReferenceConvention
{
public void Apply(IOneToOneInstance instance)
{
instance.Cascade.All();
}
public void Apply(IOneToManyCollectionInstance instance)
{
instance.Cascade.All();
}
public void Apply(IManyToOneInstance instance)
{
instance.Cascade.All();
}
}
When I add a localizedText to my Item class, that works well, and the localizedText table gets values written into the table, however..the foreign key value "itemId" remains null. How can I make it work so that the localizedText items have an objectId when added?
Zack