使用播放!在 Scala 中使用 Squeryl ORM。我不知道是什么导致了这个问题,但是当我在 Play 中添加了一个新模型时!它现在不会编译一个非常奇怪的错误:
value update is not a member of models.OauthCred
this()
编译器专门指向Squeryl 所需的零参数构造函数。
代码如下:
case class OauthCred(
val id: Long,
@Column("vendor")
val vendor: String,
@Column("user_id")
val userId: Long,
@Column("remote_id")
val remoteId: Option[String],
@Column("scope")
var scope: String,
@Column("access_code")
var accessCode: Option[String],
@Column("unauthorized_token")
var unauthorizedToken: Option[String],
@Column("authorized_token")
var authorizedToken: Option[String],
@Column("refresh_token")
var refreshToken: Option[String],
@Column("is_active")
var isActive: Boolean,
@Column("is_revoked")
var isRevoked: Boolean,
@Column("created")
val created: Timestamp,
@Column("modified")
var modified: Timestamp
) extends KeyedEntity[Long] {
this() = this(0L, "", 0L, Some(""), "", Some(""), Some(""), Some(""), Some(""), false, false, new Timestamp(), new Timestamp())
}
object OauthCred {
def get(id:Long) = DB.oauthcred.lookup(id)
def save(o:OauthCred) = DB.oauthcred.update(o)
def getByRemoteId(remoteId:String) = { from(DB.oauthcred)( o => where(o.remoteId === Some(remoteId)) select(o) ).headOption }
}
这可能是什么原因造成的?