I have an existing view which has too much data in it. Unfortunately I
cannot get rid of it so I need to try to work around it using my
NHibernate mapping. The idea is to have NH issue the following query:

SELECT DISTINCT User_Id, Module_Id, Application_Id, RightsMask
FROM V_UserApplicationPermissions
WHERE User_Id = ?

My current mapping for this list of AccessControlEntry types looks
like this:

HasMany<AccessControlEntry>(x => x.Rights)
    .WithTableName("V_UserApplicationPermissions")
    .KeyColumnNames.Add("User_Id")
    .Component(c =>
    {
        c.Map(x => x.Module, "Module_Id");
        c.Map(x => x.Application, "App_Id");
        c.Map(x => x.Rights,
"RightsMask").CustomTypeIs<ApplicationRightsType>();
    })
    .Not.LazyLoad();

Any thoughts on how to have NHibernate put a DISTINCT keyword in there
during the query?

-- 
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.

Reply via email to