From: Graeme F. (JIRA) <nh...@gm...> - 2011-04-21 06:37:33
|
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 Priority: Major 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 |