Anorm's Row object no longer exists in Play 2.3

≡放荡痞女 提交于 2019-12-02 09:12:45

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!