Play + Anorm + Postgres - load json value into a case class
问题 I am using anorm to query and save elements into my postgres database. I have a json column which I want to read as class of my own. So for example if I have the following class case class Table(id: Long, name:String, myJsonColumn:Option[MyClass]) case class MyClass(site: Option[String], user:Option[String]) I am trying to write the following update: DB.withConnection { implicit conn => val updated = SQL( """UPDATE employee |SET name = {name}, my_json_column = {myClass} |WHERE id = {id} """