From: Justin G. (JIRA) <nh...@gm...> - 2011-03-03 20:22:46
|
NH 3.0 Linq Provider : Issue using multiple filters on the same entity - test case attached ------------------------------------------------------------------------------------------- Key: NH-2559 URL: http://216.121.112.228/browse/NH-2559 Project: NHibernate Issue Type: Bug Components: Linq Provider Affects Versions: 3.0.0.GA Reporter: Justin Greene Priority: Critical Attachments: ManyToManyAny.patch Exception: NHibernate.Test.Linq.ByMethod.AnyTests.ManyToManyAny: NHibernate.QueryException : could not resolve property: Description of: NHibernate.DomainModel.Northwind.Entities.Employee [.Where[NHibernate.DomainModel.Northwind.Entities.Order](.Where[NHibernate.DomainModel.Northwind.Entities.Order](NHibernate.Linq.NhQueryable`1[NHibernate.DomainModel.Northwind.Entities.Order], Quote((o, ) => (String.op_Equality(o.Employee.Address.Region, p1))), ), Quote((o, ) => (.Any[NHibernate.DomainModel.Northwind.Entities.Territory](o.Employee.Territories, (t, ) => (String.op_Equality(t.Description, p2)), ))), )] Details: If you remove the first where clause the query will work properly. Adding it back in results in the above exception. I've also run into a separate version of what I believe is the same problem; except that it fails silently and just produces an incorrect subquery. I am unable to reproduce this second issue in nhibernates test harness. -- 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: Justin G. (JIRA) <nh...@gm...> - 2011-03-04 16:41:03
|
[ http://216.121.112.228/browse/NH-2559?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=20624#action_20624 ] Justin Greene commented on NH-2559: ----------------------------------- It turns out this issue is not an issue with the LINQ provider but with the HQL -> SQL translator. It can also be reproduced using the following HQL. [Test] public void ManyToManyAnyWithHql() { var query = session.CreateQuery("from Order as o where o.Employee.FirstName = 'test' and exists (from o.Employee.Territories as t where t.Description = 'test')"); var result = query.List<DomainModel.Northwind.Entities.Order>(); Assert.AreEqual(0, result.Count); } > NH 3.0 Linq Provider : Issue using multiple filters on the same entity - test case attached > ------------------------------------------------------------------------------------------- > > Key: NH-2559 > URL: http://216.121.112.228/browse/NH-2559 > Project: NHibernate > Issue Type: Bug > Components: Linq Provider > Affects Versions: 3.0.0.GA > Reporter: Justin Greene > Priority: Critical > Attachments: ManyToManyAny.patch > > > Exception: > NHibernate.Test.Linq.ByMethod.AnyTests.ManyToManyAny: > NHibernate.QueryException : could not resolve property: Description of: NHibernate.DomainModel.Northwind.Entities.Employee [.Where[NHibernate.DomainModel.Northwind.Entities.Order](.Where[NHibernate.DomainModel.Northwind.Entities.Order](NHibernate.Linq.NhQueryable`1[NHibernate.DomainModel.Northwind.Entities.Order], Quote((o, ) => (String.op_Equality(o.Employee.Address.Region, p1))), ), Quote((o, ) => (.Any[NHibernate.DomainModel.Northwind.Entities.Territory](o.Employee.Territories, (t, ) => (String.op_Equality(t.Description, p2)), ))), )] > Details: > If you remove the first where clause the query will work properly. Adding it back in results in the above exception. I've also run into a separate version of what I believe is the same problem; except that it fails silently and just produces an incorrect subquery. I am unable to reproduce this second issue in nhibernates test harness. -- 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: Justin G. (JIRA) <nh...@gm...> - 2011-03-04 18:29:41
|
[ http://216.121.112.228/browse/NH-2559?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=20625#action_20625 ] Justin Greene commented on NH-2559: ----------------------------------- Looking into this more it looks like the issue _may_ be in the DotNode.cs class in the DereferenceCollection method. This method calls set implied join and it seems to be selecting the wrong FromElement. Changing line 340 in DotNode from: SetImpliedJoin(elem) To: _impliedJoin = elem seems to resolve this issue. Running the unit tests seems to come up with passing test cases; though I am still worried about unintended side effects of this change. I am attaching another patch with this fix. I'm hoping someone with more knowledge of nhibernates internals can take a look and see if this will work out. > NH 3.0 Linq Provider : Issue using multiple filters on the same entity - test case attached > ------------------------------------------------------------------------------------------- > > Key: NH-2559 > URL: http://216.121.112.228/browse/NH-2559 > Project: NHibernate > Issue Type: Bug > Components: Linq Provider > Affects Versions: 3.0.0.GA > Reporter: Justin Greene > Priority: Critical > Attachments: ManyToManyAny.patch > > > Exception: > NHibernate.Test.Linq.ByMethod.AnyTests.ManyToManyAny: > NHibernate.QueryException : could not resolve property: Description of: NHibernate.DomainModel.Northwind.Entities.Employee [.Where[NHibernate.DomainModel.Northwind.Entities.Order](.Where[NHibernate.DomainModel.Northwind.Entities.Order](NHibernate.Linq.NhQueryable`1[NHibernate.DomainModel.Northwind.Entities.Order], Quote((o, ) => (String.op_Equality(o.Employee.Address.Region, p1))), ), Quote((o, ) => (.Any[NHibernate.DomainModel.Northwind.Entities.Territory](o.Employee.Territories, (t, ) => (String.op_Equality(t.Description, p2)), ))), )] > Details: > If you remove the first where clause the query will work properly. Adding it back in results in the above exception. I've also run into a separate version of what I believe is the same problem; except that it fails silently and just produces an incorrect subquery. I am unable to reproduce this second issue in nhibernates test harness. -- 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: Justin G. (JIRA) <nh...@gm...> - 2011-03-04 18:31:26
|
[ http://216.121.112.228/browse/NH-2559?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Justin Greene updated NH-2559: ------------------------------ Attachment: DotNodeFix.patch > NH 3.0 Linq Provider : Issue using multiple filters on the same entity - test case attached > ------------------------------------------------------------------------------------------- > > Key: NH-2559 > URL: http://216.121.112.228/browse/NH-2559 > Project: NHibernate > Issue Type: Bug > Components: Linq Provider > Affects Versions: 3.0.0.GA > Reporter: Justin Greene > Priority: Critical > Attachments: DotNodeFix.patch, ManyToManyAny.patch > > > Exception: > NHibernate.Test.Linq.ByMethod.AnyTests.ManyToManyAny: > NHibernate.QueryException : could not resolve property: Description of: NHibernate.DomainModel.Northwind.Entities.Employee [.Where[NHibernate.DomainModel.Northwind.Entities.Order](.Where[NHibernate.DomainModel.Northwind.Entities.Order](NHibernate.Linq.NhQueryable`1[NHibernate.DomainModel.Northwind.Entities.Order], Quote((o, ) => (String.op_Equality(o.Employee.Address.Region, p1))), ), Quote((o, ) => (.Any[NHibernate.DomainModel.Northwind.Entities.Territory](o.Employee.Territories, (t, ) => (String.op_Equality(t.Description, p2)), ))), )] > Details: > If you remove the first where clause the query will work properly. Adding it back in results in the above exception. I've also run into a separate version of what I believe is the same problem; except that it fails silently and just produces an incorrect subquery. I am unable to reproduce this second issue in nhibernates test harness. -- 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: Fabio M. (JIRA) <nh...@gm...> - 2011-05-17 22:13:48
|
[ http://216.121.112.228/browse/NH-2559?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Fabio Maulo updated NH-2559: ---------------------------- Summary: NH 3.0 Linq Provider : Issue using multiple filters on the same entity (was: NH 3.0 Linq Provider : Issue using multiple filters on the same entity - test case attached) > NH 3.0 Linq Provider : Issue using multiple filters on the same entity > ---------------------------------------------------------------------- > > Key: NH-2559 > URL: http://216.121.112.228/browse/NH-2559 > Project: NHibernate > Issue Type: Bug > Components: Linq Provider > Affects Versions: 3.0.0.GA > Reporter: Justin Greene > Priority: Critical > Attachments: DotNodeFix.patch, ManyToManyAny.patch > > > Exception: > NHibernate.Test.Linq.ByMethod.AnyTests.ManyToManyAny: > NHibernate.QueryException : could not resolve property: Description of: NHibernate.DomainModel.Northwind.Entities.Employee [.Where[NHibernate.DomainModel.Northwind.Entities.Order](.Where[NHibernate.DomainModel.Northwind.Entities.Order](NHibernate.Linq.NhQueryable`1[NHibernate.DomainModel.Northwind.Entities.Order], Quote((o, ) => (String.op_Equality(o.Employee.Address.Region, p1))), ), Quote((o, ) => (.Any[NHibernate.DomainModel.Northwind.Entities.Territory](o.Employee.Territories, (t, ) => (String.op_Equality(t.Description, p2)), ))), )] > Details: > If you remove the first where clause the query will work properly. Adding it back in results in the above exception. I've also run into a separate version of what I believe is the same problem; except that it fails silently and just produces an incorrect subquery. I am unable to reproduce this second issue in nhibernates test harness. -- 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: Fabio M. (JIRA) <nh...@gm...> - 2011-05-17 22:17:45
|
[ http://216.121.112.228/browse/NH-2559?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Fabio Maulo resolved NH-2559. ----------------------------- Resolution: Fixed Fix Version/s: 3.2.0Beta1 Probably it was fixed before 3.2.0Beta1 > NH 3.0 Linq Provider : Issue using multiple filters on the same entity > ---------------------------------------------------------------------- > > Key: NH-2559 > URL: http://216.121.112.228/browse/NH-2559 > Project: NHibernate > Issue Type: Bug > Components: Linq Provider > Affects Versions: 3.0.0.GA > Reporter: Justin Greene > Priority: Critical > Fix For: 3.2.0Beta1 > > Attachments: DotNodeFix.patch, ManyToManyAny.patch > > > Exception: > NHibernate.Test.Linq.ByMethod.AnyTests.ManyToManyAny: > NHibernate.QueryException : could not resolve property: Description of: NHibernate.DomainModel.Northwind.Entities.Employee [.Where[NHibernate.DomainModel.Northwind.Entities.Order](.Where[NHibernate.DomainModel.Northwind.Entities.Order](NHibernate.Linq.NhQueryable`1[NHibernate.DomainModel.Northwind.Entities.Order], Quote((o, ) => (String.op_Equality(o.Employee.Address.Region, p1))), ), Quote((o, ) => (.Any[NHibernate.DomainModel.Northwind.Entities.Territory](o.Employee.Territories, (t, ) => (String.op_Equality(t.Description, p2)), ))), )] > Details: > If you remove the first where clause the query will work properly. Adding it back in results in the above exception. I've also run into a separate version of what I believe is the same problem; except that it fails silently and just produces an incorrect subquery. I am unable to reproduce this second issue in nhibernates test harness. -- 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: Fabio M. (JIRA) <nh...@gm...> - 2011-05-17 22:23:30
|
[ http://216.121.112.228/browse/NH-2559?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=21106#action_21106 ] Fabio Maulo commented on NH-2559: --------------------------------- The test does not fail. Test committed in the trunk. > NH 3.0 Linq Provider : Issue using multiple filters on the same entity > ---------------------------------------------------------------------- > > Key: NH-2559 > URL: http://216.121.112.228/browse/NH-2559 > Project: NHibernate > Issue Type: Bug > Components: Linq Provider > Affects Versions: 3.0.0.GA > Reporter: Justin Greene > Priority: Critical > Attachments: DotNodeFix.patch, ManyToManyAny.patch > > > Exception: > NHibernate.Test.Linq.ByMethod.AnyTests.ManyToManyAny: > NHibernate.QueryException : could not resolve property: Description of: NHibernate.DomainModel.Northwind.Entities.Employee [.Where[NHibernate.DomainModel.Northwind.Entities.Order](.Where[NHibernate.DomainModel.Northwind.Entities.Order](NHibernate.Linq.NhQueryable`1[NHibernate.DomainModel.Northwind.Entities.Order], Quote((o, ) => (String.op_Equality(o.Employee.Address.Region, p1))), ), Quote((o, ) => (.Any[NHibernate.DomainModel.Northwind.Entities.Territory](o.Employee.Territories, (t, ) => (String.op_Equality(t.Description, p2)), ))), )] > Details: > If you remove the first where clause the query will work properly. Adding it back in results in the above exception. I've also run into a separate version of what I believe is the same problem; except that it fails silently and just produces an incorrect subquery. I am unable to reproduce this second issue in nhibernates test harness. -- 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 |