I think i understand it partly...Using NH you have something like
     IList<Accreditation> employee.Accreditations as property .
The problem is, you have no easy possibility to take care of the
collection loading process...sorting, filtering etc. Sure, you may have
an order-by attribute in your mapping using a bag and you may have
filter definitions for the session etc. I'm aware that this is
a consequence of PI but i think it often introduces more problems
than necessary.
Anyway, since the sorting is in most cases a UI thing you can easylie
do something like

IList<Accreditation> pList = employee.Accreditations;
...
var pResult = from a in pList
                    order by a.ValidFrom
                    select a;
or simply

pResult = pList.OrderBy( a => e.ValidaFrom);

and then use pResult.ToList() for data binding;

2010/4/18 Fabio Maulo <[email protected]>

> To me it sound as a salad with: strawberry yogurt, anchovies, chocolate,
> hog rib, ice creme coffee, black olives, chorizo colorado.
>
> Can you try to re-elaborate your question maintain it to OOP ?
>
> On Fri, Apr 16, 2010 at 1:23 PM, Mazhar <[email protected]> wrote:
>
>> Any thoughts...
>>
>>
>> On Fri, Apr 16, 2010 at 4:39 AM, Mazhar <[email protected]> wrote:
>>
>>> Hi, this may be a pretty basic questions but I am quite new to
>>> NHibernate and feeling a little bit lost. I am building my business
>>> layer back powered by NHibernate. I am seeing no way to load child
>>> objects against a foreign key. I have googled a lot but unable to find
>>> something that comforts me.
>>>
>>> Example scenario is that I have an Employee entity having one to many
>>> relation with EmployeeAccreditation tables. On my UI screen I need to
>>> show accreditation for selected employee. Right now the only way I am
>>> seeing it to load employee object and then get accreditations from it.
>>> This is a pretty basic scenario and I guess many people may have
>>> already came across this situation. Anyhow if i go with loading
>>> employee and then accessing its child then how do i perform column
>>> based sorting on this. Do I need to write a custom comparer for that
>>> purpose.
>>>
>>> Any help will be appreciated.
>>>
>>> --
>>> 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]<nhusers%[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]<nhusers%[email protected]>
>> .
>> For more options, visit this group at
>> http://groups.google.com/group/nhusers?hl=en.
>>
>
>
>
> --
> 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]<nhusers%[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