Hello, I still haven't been able to figure out why this happens. I anyone able to offer any pointers? Any help would be much appreciated. Or please just tell me if my question is too difficult or too stupid.
Thank you, Øyvind On Apr 20, 1:02 pm, Øyvind <[email protected]> wrote: > Hello, > > I've got a user and a place entity, and a relationship mapped between > them using a 'UserPlace' entity (A user can belong to many places). > The mapping, with FluentNH, is below. This works fine, but I've > noticed that every time I modify a User's UserPlace (setting a place > as default or selected) the entire collection of UserPlace is first > deleted from the database, and then reinserted. I assume it's because > NHibernate doesn't know enough about what distinguishes one row from > another, so how can I change my mapping to prevent a complete deletion > and re-insertion of all rows? > > public class UserMap : ClassMap<User> > { > HasMany(x => x.Neighbourhood) > .Component(c => > { > c.Map(x => x.IsDefault).Not.Nullable(); > c.Map(x => x.Selected).Not.Nullable().Default("0"); > c.References(x => x.Place).Fetch.Join(); > } > ).Not.LazyLoad().Cascade.SaveUpdate(); > > > > > > > > } -- 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.
