升级到Play 2.3.0后,我在对象行上得到了这个编译错误
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
}
}
如何解决?