我是斯卡拉的新人。我经历了教程并尝试创建一些有用的东西,但是遇到了像这样的奇怪错误:
value <> is not a member of (slick.lifted.Rep[Long], slick.lifted.Rep[String], slick.lifted.Rep[String], slick.lifted.Rep[String])
我的代码:
package models
import java.sql.Timestamp
import slick.jdbc.MySQLProfile._
import slick.jdbc.MySQLProfile.api.stringColumnType
import slick.jdbc.MySQLProfile.api.longColumnType
import slick.jdbc.MySQLProfile.api.timestampColumnType
import slick.lifted.Tag
case class User(id: Long, name: String, email: String, PMAccount: String)
class Users(tag: Tag) extends Table[User](tag, "Users") {
def id = column[Long]("id")
def name = column[String]("name")
def email = column[String]("email")
def PMAccount = column[String]("PMAccount")
def * = (id, name, email, PMAccount) <> (User.tupled, User.unapply(_))
}
任何人都可以帮我理解这个吗?
答案 0 :(得分:2)
您忘记导入必要的api,只需将此行添加到您的代码中即可使用
import database.driver.api._
def * = (id, name, email, PMAccount) <> (User.tupled, User.unapply(_))