0

有这样的要求

inTransaction {
      from(AppDb.bills, AppDb.legals)((billCount, legal) =>
        where(legal.id in (
          from(AppDb.bills)(bill =>
            where(bill.individualId === individualId and bill.deleted === false)
              select (bill.legalId)).distinct
          ) and billCount.individualId === individualId and billCount.legalId === legal.id)
          groupBy(legal.id, legal.name, legal.address, legal.siteUrl, legal.logoId, legal.phoneNumber, legal.email)
          compute(legal.id, legal.name, legal.address, legal.siteUrl, legal.logoId, legal.phoneNumber, legal.email, count(billCount.id))
      ).toList
    }

方法计算不能接受 8 个字段,只有 7 个和更少。

  def compute[T1,T2,T3,T4,T5,T6,T7]
    (e1: =>TypedExpressionNode[T1], e2: =>TypedExpressionNode[T2], e3: =>TypedExpressionNode[T3], e4: =>TypedExpressionNode[T4],
     e5: =>TypedExpressionNode[T5], e6: =>TypedExpressionNode[T6], e7: =>TypedExpressionNode[T7]): ComputeStateFromGroupByState[G,Product7[T1,T2,T3,T4,T5,T6,T7]] =
    new GroupWithMeasuresQueryYield[G,Product7[T1,T2,T3,T4,T5,T6,T7]](
      this.queryElementzz,
      this.groupByClauseClosure,
      this.unevaluatedHavingClause,
      () =>List(e1, e2, e3, e4, e5, e6, e7)
    )

我怎么解决这个问题?

4

1 回答 1

1

fork 项目并向ComputeMeasuresSignaturesFromGroupByState接受 8 个参数的 trait 添加另一个方法:

https://github.com/max-l/Squeryl/blob/master/src/main/scala/org/squeryl/dsl/boilerplate/ComputeMeasuresSignaturesFromGroupByState.scala

于 2013-07-05T13:45:38.733 回答