Bump.

I guess maybe this is the wrong place to have this discussion, since it's
about a contribution to NH instead of an issue using it. Should I create a
ticket in Jira and conduct the discussion there? Or is this the correct
forum?

On Mon, Aug 22, 2011 at 2:45 PM, [email protected] <[email protected]>wrote:

> I know this question has been asked before, but I wanted to get a good
> sense of how to approach it patchwise. Basically, I have entity tables
> and localization tables and every translatable property is a column in
> the localization table. So there's an A, ALoc, B, BLoc, etc, and
> expect that when I get an A it does A inner join ALoc on on
> A.ID=ALoc.ID and ALoc.Language='en'.
>
> So far, I've approached this by mapping ALoc explicitly, making an
> A.Localizations collection, making it non-lazy, adding a <filter> to
> the collection, and using some DynamicProxy logic in an interceptor to
> fill out the class, but what I'd really like to do is use a <join>
> with a <filter>. There are two reasons for that: 1) it's a whole lot
> cleaner and 2) my implementation does poorly when I explicitly join A
> and B, because it strings together 4 outer joins instead of using
> nested joins, which would be way better:
>
> from
> (A inner join ALoc on A.ID = ALoc.ID and ALoc.Language='en') as AFull
> left outer join
> (B inner join BLoc on B.ID = BLoc.ID and BLoc.Language='en') as BFull
> on AFull.BID = BFull.ID  --or however my explicit join worked
>
> So first question, disregarding the filtering part, do entities that
> use <join> do this nested join thing? Should they?
>
> Anyway, I've seen two options suggested for how to accomplish this
> mapping:
>
> 1. Filter at the class level, so A just knows it should only get stuff
> in English. This is the approach discussed here:
>
> http://groups.google.com/group/nhusers/browse_thread/thread/1259723b6d11a16e/d064b3d8b4406a46?lnk=gst&q=join+filter#d064b3d8b4406a46
> ,
> and it doesn't work because the filter will assume the Language column
> is on A instead of ALoc. In other words, the <filter> is unaware of
> the <join>.
>
> 2. Make <join> explicitly support <filter>. That's the approach
> discussed here:
>
> http://groups.google.com/group/nhusers/browse_thread/thread/173a59028f16a366/8503949c460c181c?lnk=gst&q=join+filter#8503949c460c181c
> .
> It just isn't implemented.
>
> So let's say I really want to be able to do this and I'm willing to
> patch NH to that end. Which approach should I take? Assuming it was
> well written, would such a patch be accepted? Also, since this is my
> first foray into NH's codebase, any pointers on how to do the patch
> would be appreciated.
>
> Thanks!
> Isaac
>
> --
> 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.

Reply via email to