This thread looks to be a little on the old side and therefore may no longer be relevant. Please see if there is a newer thread on the subject and ensure you're using the most recent build of any software if your question regards a particular product.
This thread has been locked and is no longer accepting new posts, if you have a question regarding this topic please email us at support@mindscape.co.nz
|
I've detected a issue in SQL statement generated by querying objects thats have a self reference: var query = from part in workOfUnit.Parts where part.Parent.Name == "DESK" select part; This query use a self reference "Parent" property in where clause, and LightSpeed was generated a SQL statement that result 0 rows: SELECT Parts.Id, Parts.Name, Parts.ParentId FROM Parts WHERE EXISTS ( SELECT Parts.* FROM Parts WHERE Parts.Id = Parts.ParentId AND Parts.Name = 'DESK' ) The expected statement, must use a table alias in inner query and return many rows: SELECT Parts.Id, Parts.Name, Parts.ParentId FROM Parts WHERE EXISTS ( SELECT t1.* FROM Parts t1 WHERE t1.Id = Parts.ParentId AND t1.Name = 'DESK' ) Thanks! |
|
|
Thanks Rafael, I received your email and will look into resolving this issue. Thanks for the clear example. Kind regards, John-Daniel Trask |
|
|
Just to update you Rafael, this is an issue with the LightSpeed Querying system and is something we need to add as your example shows. Unfortunately this won't be resolved quickly as we need to be careful not to make any breaking changes. I'll update this thread when we have added automatic aliasing for this situation. Thanks for reporting the issue. John-Daniel Trask |
|
|
Any updates on this issue? I've run into the same problem. |
|
|
As far as I know this is still not supported. We have however enhanced the core query engine in LightSpeed 3 to support this scenario, and plan to have LINQ automatically handle the aliasing if time permits. |
|