问题
After upgrading to Play 2.3.0 I get this compilation error on object Row
not found: value Row
I noticed the Row object no longer exists in play 2.3.0 (I've found only the Row trait). Looking at the documentation, pattern matching should be still supported in Play 2.3
http://www.playframework.com/documentation/2.3.x/ScalaAnorm
See "Using Pattern Matching" paragraph
Here's my code:
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
}
}
How to solve that?
回答1:
As said, this pattern matching is restored on Play master by https://github.com/playframework/playframework/pull/3049 .
来源:https://stackoverflow.com/questions/24373787/anorms-row-object-no-longer-exists-in-play-2-3