|
From: cremor (JIRA) <nh...@gm...> - 2011-05-05 11:15:59
|
Queries with nested subqueries either fail or return wrong results
------------------------------------------------------------------
Key: NH-2693
URL: http://216.121.112.228/browse/NH-2693
Project: NHibernate
Issue Type: Bug
Components: Linq Provider
Affects Versions: 3.2.0Alpha2
Reporter: cremor
Priority: Major
The attached test shows multiple failing queries which have in common that they are all using nested subqueries. I have no idea if the different queries fail because of different bugs or if it's all because of the same, but I hope they are clear enough that they can be fixed.
Following is an explanation of the test:
Domain model:
FirstLevel has a set of components of type SecondLevelComponent.
SecondLevelComponent has a many-to-one to ThirdLevel.
ThirdLevel is the abstract base of SpecificThirdLevel (table-per-subclass mapping).
SpecificThirdLevel has a set of entities of type FourthLevel.
The queries and why they are failing:
* _1_Querying_BasedOnFourthLevelExistence_WithIsAndCasting_ShouldReturnSameEntitiesAsLinqToObjects
+ Should select all FirstLevel entities that have at least one FourthLevel entity as child, implemented by using the "is" operator and then casting the ThirdLevel to a SpecificThirdLevel.
- Returns wrong results, the generated SQL checks for existing ThirdLevel childs instead of FourthLevel childs.
* _2_Querying_BasedOnFourthLevelExistence_WithSelectAndOfType_ShouldReturnSameEntitiesAsLinqToObjects
+ Should select same as first query, but this time implemented by using the Select() and OfType() methods.
- Fails with exception "QueryException : could not resolve property: class of: component[ThirdLevel,SpecificThirdLevel,SomeBool]". I think it should check the class of ThirdLevel instead of SecondLevelComponent.
* _3_Querying_BasedOnFourthLevelProperty_WithIsAndCasting_ShouldReturnSameEntitiesAsLinqToObjects
+ Should select all FirstLevel entities that have at least one FourthLevel entity _with a specific property_ as child. Implemented with "is" and casting like the first query.
- Fails with exception "QueryException : could not resolve property: SomeString of: ThirdLevel". It should search the "SomeString" property on FourthLevel instead of ThirdLevel.
* _4_Querying_BasedOnFourthLevelProperty_WithSelectAndOfType_ShouldReturnSameEntitiesAsLinqToObjects
+ Should select same as third query, but this time implemented with Select() and OfType() like the second query.
- Fails with same exception as the second query.
The last two queries are not using a polymorphistic association. Instead they are using the property SecondLevelComponent.SpecificThirdLevel so that no type checking or casting is needed. But they are still failing:
* _5_Querying_BasedOnFourthLevelExistence_ByUsingSpecificThirdLevelProperty_ShouldReturnSameEntitiesAsLinqToObjects
+ Should select same as first and second query.
- Returns no entities. But I'm not sure why it doesn't return anything.
* _6_Querying_BasedOnFourthLevelProperty_ByUsingSpecificThirdLevelProperty_ShouldReturnSameEntitiesAsLinqToObjects
+ Should select same as third and fourth query.
- Also returns no entities and I also don't know why.
--
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
|