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
|
Hi, I spent some time browsing the forums, but haven't seen something similar to this problem. I have 3 Entities all joined by One to Many associations A -> B -> C When querying for Cs I want to have the B and A entities loaded with an aggregate and sorted by a field in A. ex.) Order.By("BTable.ATable.Name") This works when not paging, but once paging is thrown in the queries that LightSpeed produces do not execute. Here is an example of one of the queries produced: SELECT BTable.Id, BTable.ATableId, BTable.Name FROM BTable WHERE EXISTS ( SELECT CTable.* FROM ( SELECT CTable.*, ROW_NUMBER() OVER(ORDER BY BTable.ATable) as RowNumber FROM CTable INNER JOIN BTable ON CTable.BTableId = BTable.Id ) CTable WHERE CTable.BTableId = BTable.Id AND RowNumber > 0 AND RowNumber <= 20 ); Am I correct in my method of ordering or does this require a different syntax when ordering across associations? Thanks, -Steven |
|
|
Thanks - this looks to be a bug in a specific case where you are ordering across associations, are eager loading and are using paging. We will be having a look into a fix for this and will post an update once we have made some progress on a fix.
Thanks! Jeremy |
|
|
Hi Steven, We have added a candidate fix for this issue into the nightly builds and this will be available in the next nightly build for you. Let us know how you get on with this.
Thanks! Jeremy |
|