【发布时间】:2015-07-24 14:56:55
【问题描述】:
我使用了一个从 slick 代码生成器生成的代码。
我的表有超过 22 列,因此它使用 HList
它生成1个类型和1个函数:
type AccountRow
def AccountRow(uuid: java.util.UUID, providerid: String, email: Option[String], ...):AccountRow
如何从生成的代码编写编译后的插入代码?
我试过了:
val insertAccountQueryCompiled = {
def q(uuid:Rep[UUID], providerId:Rep[String], email:Rep[Option[String]], ...) = Account += AccountRow(uuid, providerId, email, ...)
Compiled(q _)
}
我需要将 Rep[T] 转换为 T 才能使 AccountRow 函数正常工作。我该怎么做?
谢谢
【问题讨论】:
-
你能找到答案吗?