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 am using ClassTableInheritance for a parent record and when I try to find a child record of this parent with either eager loading or aggregates. I get the error The correlation name 'X_root' is specified multiple times in a FROM clause. Is there a way to get the child record and the inherited parent in one call to the child record? Or do I need to set this up differently? Thanks, Craig |
|
|
That sounds like a possible bug as you are getting a bad SQL statement generated - are you able to send through a small repro project which triggers this behavior and we can have a look into what is causing this for you.
|
|
|
Hey Jeremy, I am getting this problem too. I'm sure it has something to do with the complexity of our model.
The problem happens when I am querying Transcations. When I do that I get the this infamous error: The correlation name 'Party_root' is specified multiple times in a FROM clause. I've had a look at the SQL generated and it seems to have become confused about which of the two relationships it has followed. I'll email you the SQL if you want to see that. You'd rather have a wee project that reproduces the eror I am guessing. Gaaaarh ... not how I saw my Friday unfolding ;( |
|
|
Note that we didn't have this problem before when we were using SingleTableInheritance. |
|
|
What is an example of a query which triggers this?
|
|
|
I've made a trimmed down solution which was going to demonstrate the issue. At present that solution isn't reproducing the problem as it is having an "STIntersects not supported" issue which wasn't happening in the main code base. |
|
|
UPDATE: I seem to have avoided this problem by removing the Eager Load BackReference from the two references to Party table. In this case I am willing to accept performing lazy-loads later on as a compromise to get the solution working. |
|