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
|
Given the following model: A has a nullable one-to-one association with itself And the following testcase
The following SQL is generated
Which results in
I found some additional information at http://stackoverflow.com/questions/4429319/you-cant-specify-target-table-for-update-in-from-clause I assume this is a bug =) //Johan W |
|
|
Unfortunately this is a limitation that crops up with MySQL (but not with other providers). There isn't anything we can do about this Im afraid.
|
|
|
According to the StackOverflow question here: http://stackoverflow.com/a/14302701, the MySql issue can be worked around by placing the inner query in another sub-query. I assume that would only have to be done for for self referencing entities. Wouldn't that solve this issue? For now, we have worked around the issue by making a new entity with two one-to-one associations with the target entity. Edit: In case there is no plan to support this, could you at least throw an exception during query generation for MySql in this scenario? //JohanW |
|
|
I will have a look at what we can do to try and detect this to throw an exception but I suspect it wont be possible as at the point where detection would be sensible we are in a provider agnostic context, likewise when an exception is surfaced however it may be possible to add something higher up the stack to allow the exception to be inspected by the provider which would allow for a rethrow with a better error message. Will let you know if we make an update here.
|
|