I'm trying to join a Card with a Part and left join a summed Stock value to a part (some parts won't have a stock row).
I have the following which I thought would work..
def stockPerBase = from(stock)(s => groupBy(s.base) compute(sum(s.quantity)))
def allCardsWithStock =
join(cards, parts, stockPerBase.leftOuter)((c,p,s) =>
on(c.partId === p.id, p.base === s.map(_.key))
select(c, p, s.measures))
However I get the following error:
too many arguments for method on: (table: org.squeryl.Table[A])(declarations: A => Seq[org.squeryl.dsl.ast.BaseColumnAttributeAssignment])Unit
[error] on(c.partId === p.id, p.base === s.map(_.key))
Any help on how I can do such a query is greatly apprecited.