[DDC-2764] Prefix criteria orderBy with rootAlias
Set rootAlias outside loop
Add rootAlias to Criteria where clauses
Merge pull request #830 from sandermarechal/sort-alias

[DDC-2764] Prefix criteria orderBy with rootAlias