Thanks for your reply Fabio. I guess that means I have to use HBM rather
than FluentNHibernate as I can't find support for IdBag.
On Apr 22, 2011 7:03pm, Fabio Maulo <[email protected]> wrote:
sorry I meanIdBag
On Fri, Apr 22, 2011 at 3:03 PM, Fabio Maulo [email protected]> wrote:
IdMap
On Wed, Apr 20, 2011 at 9:02 AM, Ø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
{
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.
--
Fabio Maulo
--
Fabio Maulo
--
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.
--
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.