I have two classes and mapping for the collection:

class User
{
    Guid ID;
    string Name;
}

class Group
{
    Guid ID;
    string Name;
    IList<User> Members;
}

// GroupMap
HasMany(x=>x.Members).Inverse().Cascade.AllDeleteOrhpan().etc.

This one works. When I add a User to the Members collection NHibernate 
cascades the operation. Same for deletes and updates.

Now I want to change my model a bit and this will change also the mapping. 
The collection is IList<Guid>. What I really want is the cascade to remain. 
That means that I have to do some custom persister or IUserType. The 
mapping should tell the object type like HasMany(x=>x.Members) and the 
collection will hold the IDs

class User
{
    Guid ID;
    string Name;
}

class Group
{
    Guid ID;
    string Name;
    IList<Guid> Members;
}

// GroupMap
HasMany<User>(x=>x.Members).Inverse().Cascade.AllDeleteOrhpan().etc.

Any ideas where can I start from? I think that there is no out of the box 
solution but who knows...


PS: This is cross post: 
http://stackoverflow.com/questions/11074610/strange-mapping-requirement

-- 
You received this message because you are subscribed to the Google Groups 
"nhusers" group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/nhusers/-/qI6uK8B6fGYJ.
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.

Reply via email to