am I right that what is causing the unwanted additional results is the
missing department id restriction? If so, the following could work for
you:
val myDepartmentId = 1
join(students, addresses.leftOuter, emails.leftOuter, advisors, labs)(
(student, address, email, advisor, lab) =>
where(lab.department === myDepartmentId)
select(student, address, email)
on(student.id === address.map(_.studentId), student.id ===
email.map(_.studentId), student.advisorId === advisor.id,
advisor.labId === lab.id)
)
Kind regards,
Roland