I'm trying to implement a request like in example in documentation: http://squeryl.org/joins.html
I have a table "Requisite" and "Service". In field "paymentRequisite" of table Service could be a link to row of Requisite or Null:
@Column("paymentRequisite")
var paymentRequisite: Option[Long],
I have a request like this:
inTransaction {
join(AppDb.paymentRequisite, AppDb.catalogService.leftOuter)((p, c) =>
compute(p.id, count(c.map(_.id)))
on(p.id === c.map(_.paymentRequisite))).toList
}
But this throws an exception:
[error] found : Option[Option[Long]]
[error] required: org.squeryl.dsl.NumericalExpression[?]
It's because of _.paymentRequisite
Finally, what I'm trying to select ReqId and count of Services which reference to this requisite.