From: Richard B. (JIRA) <nh...@gm...> - 2011-06-04 19:20:04
|
[ http://216.121.112.228/browse/NH-2662?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Richard Brown resolved NH-2662. ------------------------------- Resolution: Fixed Fix Version/s: 3.2.0Beta2 Fixed. Thanks for the test case. > Casting a joined alias in QueryOver loses alias context and looks for property on QueryOver root > ------------------------------------------------------------------------------------------------ > > Key: NH-2662 > URL: http://216.121.112.228/browse/NH-2662 > Project: NHibernate > Issue Type: Bug > Components: QueryOver > Affects Versions: 3.2.0Alpha2 > Reporter: Graeme Foster > Assignee: Richard Brown > Priority: Major > Fix For: 3.2.0Beta2 > > Attachments: NH2662.zip > > > If you QueryOver an entity, alias-join to a property on that entity which has an inheritance tree, and then attempt to project a property on a specific subclass of the entity, the property path loses the context of the alias and attempts to find it on the queryover root. > Pseudo code: > QueryOver<Customer>() > .JoinAlias(c => c.Order, () => orderAlias) > .SelectList(list => list.Select( () => ((SpecialOrder)orderAlias).SpecialReason); > blows up. > The equivalent in linq-nhibernate works OK which is why I think this is a bug. > Query<Customer>().Select( c => new { SpecialReason = ((SpecialOrder)c.Order).SpecialReason } ); > Will attach issue zip in same format as NH Trunk issues. > Graeme -- This message is automatically generated by JIRA. - If you think it was sent incorrectly contact one of the administrators: http://216.121.112.228/secure/Administrators.jspa - For more information on JIRA, see: http://www.atlassian.com/software/jira |