我是 scala、play 和 anorm 的新手。试图弄清楚。
现在我创建了一个案例类,例如;
case class Company(
var id: Pk[Long] ,
var name: String,
var appid: String,
var appSecret: String,
var iban: String)
我可以像这样创建要插入的虚拟对象;
var c: Company = Company(anorm.NotAssigned,"Test Inc","test123456","4506xk23iosc44545","TR324349999000342")
但我无法使用 id 字段填充虚拟对象(稍后我将使用它来更新模型)
当我输入
var c: Company = Company(7,"Test Inc","test123456","4506xk23iosc44545","TR324349999000342")
我说错了type mismatch; found : Int(7) required: anorm.Pk[Long]
我该如何解决?