What is the appropriate way for bulk inserted objects that contain collections of other objects ( HasMany ) using stateless sessions?
eg. The parent class is displayed as follows:
class ParentMap : ClassMap<Parent> { public ParentMap() { Id(x => x.Id) .GeneratedBy.Increment(); HasMany(x => x.ChildNodes) .KeyColumns.Add("Parent_id") .Cascade.All(); } }
A stateless session ignores the Cascade parameter, so child nodes are not automatically saved. I myself could iterate through the collection, but then I canβt establish a relationship because the Parent_id column Parent_id not exist as a property that I could write.
Did I miss something?
c # nhibernate fluent-nhibernate cascade
Groo
source share