I'm using FluentNHibernate to map a bi-directional one-to-many
relationship where ordering is important, so I'm using a list:
HasMany(x => x.Children)
.AsList(index => index.Column("CHILD_INDEX"))
.KeyColumn("PARENT_ID")
.Not.LazyLoad()
.Access.CamelCaseField()
.Cascade.AllDeleteOrphan();
On the other side, it's mapped like this:
References(x => x.Parent)
.Column("PARENT_ID")
.Not.Nullable()
.Fetch.Join()
.Not.LazyLoad()
.Cascade.SaveUpdate();
Now in my actual database, the CHILD_INDEX column is not nullable.
However, when NHibernate persists the child elements during an insert,
it doesn't insert the CHILD_INDEX column. It then performs an UPDATE
to set the CHILD_INDEX. This is odd to me, as it certainly has the
index value when it does the insert.
Is there a way to tell NHibernate to write the index column during the
insert?
--
You received this message because you are subscribed to the Google Groups
"nhusers" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/nhusers?hl=en.