I understand that may sound odd, but what exactly do you do in 
EntityBaseMap<T> class? May be some code that gets executed in the base 
class messes up derived classes somehow?

среда, 4 мая 2011 г., 18:46:46 UTC+4 пользователь seekay написал:
>
> Hi, 
> New to FNH and NHibernate as well. I'm trying to order a child 
> collection using the OrderBy property in the mapping file. 
>
> public class SectionMap : EntityBaseMap<Section> 
> { 
>     public SectionMap() 
>     { 
>         Map(x => x.Name); 
>         Map(x => x.Sortorder); 
>         Map(x => x.RedirectUrl); 
>         HasMany(x => x.Pages) 
>             .AsBag() 
>             .OrderBy("Sortorder ASC") 
>             .Inverse() 
>             .Cascade.All(); 
>     } 
> } 
>
> Here's how I get the a list of the Parent objects: 
>
> IList<Section> sectionPageList = session.QueryOver<Section>() 
>                                                 .OrderBy(x => 
> x.Sortorder).Asc() 
>                                                 .List(); 
>
> For some reason, the 'Order By' specified in the mapping file above 
> doesn't seem to be working. The parent sections are ordered correctly 
> because of the explicit OrderBy clause, but the lazy-loaded children 
> aren't. I exported the .hbm.xml files and there's no order-by 
> attribute generated. Using FluentNHibernate v1.2.0.712 obtained via 
> NuGet. 
>
> It feels as though I'm missing something small and stupid, but unable 
> to put my finger on it. Thanks!

-- 
You received this message because you are subscribed to the Google Groups 
"Fluent NHibernate" group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/fluent-nhibernate/-/L0keqyXaVv4J.
To post to this group, send email to fluent-nhibernate@googlegroups.com.
To unsubscribe from this group, send email to 
fluent-nhibernate+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/fluent-nhibernate?hl=en.

Reply via email to