#1158 Fix for multi-join in TypedQueryBuilder

(cherry picked from commit 8c4f646f4beb605b76f55b026c139f358c712267)