I'm trying to parse some SQL and save it as PushMessage (which is a class, not a case class - don't know if that matters). Following the Anorm documentation I have
implicit val parser: RowParser[PushMessage] = Macro.namedParser[PushMessage]
val result = db.withConnection { implicit connection: Connection =>
SQL"select * from PUSH_MESSAGES where VENDOR_ID=$requestedVendorId;".as(parser.*)
}
However, I'm getting a problem as IntelliJ tells me that Macro.namedParser[PushMessage] returns an Any, and not a RowParser[PushMessage]. I tried removing the declaration type, but then I couldn't run the parser using the .as(parser.*) syntax.
How do I get this to return a RowParser?
Thanks in advance,