Created
May 26, 2014 23:30
-
-
Save nicmarti/b2714edaaed2f204e785 to your computer and use it in GitHub Desktop.
Slick 2.x left join
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
object JournauxRepository { | |
def allWithOperateurs():Seq[(Journal, Operateur, Option[String])] = { | |
DB.withSession { | |
implicit s => | |
val result = for { | |
((journal, operateur), intervenant) <- Journaux leftJoin Operateurs on(_.idOperateur === _.id) leftJoin Intervenants on(_._1.idIntervenant === _.idAgence) | |
} yield (journal,operateur,intervenant.nom.?) | |
result.run | |
} | |
} | |
// We must use intervenant.nom.? and we cannot use intervenant, as | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment