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 |
From: Graeme F. (JIRA) <nh...@gm...> - 2011-04-21 06:42:32
|
[ http://216.121.112.228/browse/NH-2662?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Graeme Foster updated NH-2662: ------------------------------ Attachment: NH2662.zip Zip file in standard NH test format to illustrate problem. > 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 > 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 |
From: Richard B. (JIRA) <nh...@gm...> - 2011-04-27 15:23:59
|
[ http://216.121.112.228/browse/NH-2662?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Richard Brown reassigned NH-2662: --------------------------------- Assignee: Richard Brown > 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 > 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 |
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 |