From: Stefan W. (JIRA) <nh...@gm...> - 2011-01-05 08:42:14
|
[ http://216.121.112.228/browse/NH-2317?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=20413#action_20413 ] Stefan Wenig commented on NH-2317: ---------------------------------- re-linq guy thinks: Take().Select() and Select().Take() is sementically the same. In-memory execution would be different, but that's just imperative code. An optimizing query engine would be free to come up with the same query plan for both. So I think you're cool just mentally swapping those. As Fabio said, for some other scenarios, with or without subqueries, a global SetMaxResults() won't do (same for Skip/SetFirstResult). If you want to make it work in every case, you'll have to get it into the HQL statement. I'd consider adding that syntax to HQL, but there might be a trick to pack it into the query's where clause. I wouldn't know though. Or you might go ahead and just implement what HQL can do. If there's been no request to add that feature to HQL, it might not be that important to have it in LINQ. But it's ugly to have valid LINQ code break at runtime. > Select after Take does not work properly > ---------------------------------------- > > Key: NH-2317 > URL: http://216.121.112.228/browse/NH-2317 > Project: NHibernate > Issue Type: Bug > Components: Linq Provider > Affects Versions: 3.0.0.Alpha2 > Reporter: Jose F. Romaniello > Priority: Major > Attachments: NH2317.7z > > > artists.Take(10).Select(a => a.Id) throws exception on > NHibernate.Hql.Ast.ANTLR.PolymorphicQuerySourceDetector.GetClassName(IASTNode querySource) en PolymorphicQuerySourceDetector.cs: line 62 > artists.Select(a => a.Id).Take(10) works properly > These two queries work with the old provider. -- 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 |