Sure, that works, but it isn't viable performance-wise. I should have been more specific in my initial post, I want to sort the result dataset by the parent's name. So retrieving all entries, sort them by code and then display only a single page of them isn't a good idea. Doing it in the DB is the only performant solution - and that involves a join.
The DocumentQuery API should be able to create those joins, it's just that I'm stuck with the syntax.
Thanks for your help,
Stefan