Joins are currently generated for every attribute as opposed to once
for each entity.
Additionally most joins are appended to the end of the SQL and not
done in-line.
Joins should only be generated once and should be done the first
time they are needed. This should give the developer better control
over the SQL generated.