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
|
Hello, I am delving into compiled queries. I have tried to compile this query and other similar queries
But I get
This error message is vague, I don't know how to proceed adjusting my queries. I find it hard to believe this error is caused by my custom type I would like to know what the limitations of the Compilation process are, if this had been made clear in the article that their usage perhaps I wouldn't have started. Thanks Scott |
|
|
Further to above I tried removing the join, (Slightly embarrassed that the example query I picked had that redundant
My other queries using The result of removing the I am just confused on the can and can't do's of Compiling. Cheers, Scott |
|
|
OK last post, I promise. Futher to my ramblings in Post 2, I realise I did need the join to avoid the client side projection. My query should have been
But as per Post 1, this results in the So confused. Thanks again, Scott |
|
|
You are still making a client side projection with:
The instantiation of the client side object has to be done in a client side projection even though the query would still be able to be satisfied via a server side select statement for just those specific columns.
|
|
|
OK, So it seems to me then compiled queries are very limited, at least where returning specific fields are required. How can the example (http://www.mindscapehq.com/blog/index.php/2011/08/16/compiled-queries-for-lightspeed/) return an Is there nothing I can do? Thanks |
|
|
In that example the Penguin class is a LightSpeed entity so we are not needing to perform a client side projection (we surface the entity internally). I will have a look at what might be possible to support the use of client side projections where it could be satisfied by Project
|
|
|
Thanks Jeremy for your help, as always greatly appreciated. Cheers, Scott |
|
|
Ive added in some experimental support for this into the nightlies for you to have a play with and this will be available in tonights nightly build - let me know how you get on once you have had a chance to play with an updated nightly.
|
|
|
Hello Jeremy, I have tried your experimental support on a couple of queries but I can't get it working. QUERY 1 The query:
My SiteConfigResult class:
I query like this:
The logger result:
So in this case the query appears to be wrong, as it is returning Entity Ids when it should be returning other fields. QUERY 2 However on a more complex query it's creating the right SQL but it can't reflect the result into my object The query:
My UserResult class:
I query like this:
The logger result:
The stack trace of the exception
I have also tried creating a constructor for my results objects and output through the constructor, but no luck with that either. Let me know if you need further details. Thanks for including this support. Cheers, Scott |
|
|
Thanks for the update Scott - I will have a look into whats going on with these. Could you send us a copy of the your model so I can reproduce those queries here please.
|
|