Setting order by clause in mapping

48 views
Skip to first unread message

Alan Heywood

unread,
Mar 17, 2009, 8:17:22 PM3/17/09
to fluent-n...@googlegroups.com
Hi, I am trying to specify a sort order for a collection of child entities, based on the 'sort' field in the child entity.

mapping.WithTable("ContentPages");
mapping.HasMany<ContentSubPage>(x => x.SubPages)
   .WithKeyColumn("ParentContentPageId")
   .Inverse()
   .Cascade.AllDeleteOrphan()
   .AsBag()
   .SetAttribute("order-by", "sort");

I tried the above, adding the 'order-by' attribute to the mapping but it is not producing an 'order by' in the SQL.

Any pointers?

Thanks,
Alan


Reply all
Reply to author
Forward
0 new messages