Error message : not found : value ~
Any help ?
=== EDIT ===
Actual code :
val rowParser: RowParser[Category] = {
long("id") ~ str("name") ~ str("description") ~ long("parent_id") map {
case id ~ name ~ description ~ parent_id =>
Category(id, name, description, Category(parent_id))
}
}
Imports:
package models
import anorm.RowParser
import anorm.SQL
import anorm.SqlParser.long
import anorm.SqlParser.str
import anorm.sqlToSimple
import anorm.toParameterValue
import play.api.Play.current
import play.api.db.DB
import play.api.libs.json.Json
import play.api.libs.json.Json.toJsFieldJsValueWrapper
import play.api.libs.json.Writes
You need to import
~
class fromanorm
package.This class takes two params:
So it can be used with infix syntax in pattern matching:
A ~ B is same as ~(A, B)