relationsToUse.Add(LibraryStudy.Relations.StudyEntityUsingStudyID,JoinHint.Left);
will result in:
LibraryStudy LEFT JOIN Study
(so a join towards LibraryStudy)
relationsToUse.Add(StudySiteEntity.Relations.StudyEntityUsingStudyID,JoinHint.Left);
Will result in
StudySite LEFT JOIN Study
(so a join towards StudySite)
As Study is already in the pack, this will effectively be the same as:
LibraryStudy LEFT JOIN Study RIGHT JOIN StudySite
which is the same as
Study RIGHT JOIN LibraryStudy RIGHT JOIN StudySite
What you want:
Study LEFT JOIN StudySite LEFT JOIN LibraryStudy
means that you want to join away from StudySite and away from LibaryStudy.
This means that you have to specify the relations as:
relationsToUse.Add(LibraryStudy.Relations.StudyEntityUsingStudyID,JoinHint.Right);
relationsToUse.Add(StudySiteEntity.Relations.StudyEntityUsingStudyID,JoinHint.Right);
OR:
relationsToUse.Add(Study.Relations.LibraryStudyEntityUsingStudyID, JoinHint.Left);
relationsToUse.Add(StudyEntity.Relations.StudySiteEntityUsingStudyID,JoinHint.Left);
If you specify join hints, leave ObeyWeakRelations alone, it has no meaning in that context, so set it to false or don't set it at all.