Actually, there are some solutions on the internet for this problem. Sadly, the one I found here does not work for me in TYPO3 6.0. The code snippet found here pointed me to the right direction. There is only one problem with the snippet, since it does not contain the whole SQL query (some parameters are filled with a questionmark).
So here is hopefully a complete solution on how to output the resulting SQL from an Extbase query.
Attention: The following code changes should only be done for development purposes on development systems.
- Open the file "/typo3/sysext/extbase/Classes/Persistence/Generic/Storage/Typo3DbBackend.php"
- Navigate to the function "GetObjectDataByQuery()"
- Go to the line next to "$this->replacePlaceholders($sql, $parameters, $tableName);"
- Insert the following code
If anyone has another solution for this problem, feel free to drop me a message.
Happy debugging :-)