Using Squeryl ORM and Scala. For the first time I did a JOIN statement that used grouping. Admittedly, I can't figure out how to start iterating through the contents.
Here's the JOIN:
join(DB.jobs, DB.users.leftOuter, DB.clients.leftOuter, DB.projects.leftOuter)((j,u,c,p) =>
where((j.teamId === teamId)
and (j.startTime > yesterdayBegin))
groupBy(j.userId)
on(j.userId === u.map(_.id), j.clientId === c.map(_.id), j.projectId === p.map(_.id)))
How do I print out its contents?
I tried:
Job.teamTimeline( teamId(request) ).map{ user => Map(
"name" -> user._1.map(_.name).getOrElse("Pending")
)}
But got the compiler error:
value _1 is not a member of org.squeryl.dsl.Group[Option[org.squeryl.PrimitiveTypeMode.LongType]]