【发布时间】:2014-08-17 20:55:43
【问题描述】:
我正在尝试在播放框架中使用 slick,但即使是最简单的示例也很困难。
这是我的代码:
case class Account (
id: Int,
email: String,
password: String,
permission: String
)
class Accounts(tag: Tag) extends Table[Account](tag, "account") {
def id = column[Int]("id")
def email = column[String]("email")
def password = column[String]("password")
def permission = column[String]("permission")
def * = (id, email, password, permission)
}
编译时出现以下错误:
play.PlayExceptions$CompilationException: Compilation error[No matching Shape found.
Slick does not know how to map the given types.
Possible causes: T in Table[T] does not match your * projection. Or you use an unsupported type in a Query (e.g. scala List).
Required level: scala.slick.lifted.ShapeLevel.Flat
Source type: (scala.slick.lifted.Column[Int], scala.slick.lifted.Column[String], scala.slick.lifted.Column[String], scala.slick.lifted.Column[String])
Unpacked type: models.Account
Packed type: Any
]
谁能告诉我这里是否有问题?
谢谢
更多细节:
- Scala 2.10
- 光滑 2.0.2
- Play-slick 0.6.0.1
- 播放框架 2.3.1
【问题讨论】:
标签: scala playframework playframework-2.0 slick play-slick