升级到 Play 2.3.0 后,我在对象 Row 上收到此编译错误
not found: value Row
我注意到游戏 2.3.0 中不再存在 Row 对象(我只发现了 Row 特征)。查看文档,Play 2.3 中仍应支持模式匹配
http://www.playframework.com/documentation/2.3.x/ScalaAnorm
请参阅“使用模式匹配”段落
这是我的代码:
def findById(aId: Long) = {
DB.withConnection { implicit conn =>
SQL(byIdStmt).on("id" -> aId)().map {
case Row(id:Integer, Some(userId:String), Some(description:String),
Some(solrCriteria:String), Some(solrCriteriaHash:String),
Some(hits:Integer), Some(lastPerformedUtc:java.sql.Timestamp), Some(notify:Boolean) ) =>
new UserInquiry(id.toLong, userId, description, solrCriteria, solrCriteriaHash,
hits, lastPerformedUtc, notify)
}.head
}
}
如何解决?