Take a look at the issue 761.
It took about 2 hours to implement such transformation with SQL DOM - the changes Alexis Kochetov has made to resolve this issue are really tiny. It's difficult to imagine how ORM tools without SQL DOM-like model (e.g. NHibernate) can handle such cases. So our approach is quite solid from this point.
P.S. Tobias, thank you a lot for your analysis of this case!
// This post is actually written solely to advertise our support services and the team itself ;)