0

我在反序列化我的案例类时遇到问题。尽管序列化效果很好,但由于某种原因,我无法以正确的类型取回案例类。

这是我的案例类:

case class Team(
  id: ObjectId = new ObjectId,
  teamType: String = "",
  categories: List[String] = List(),
  entities: List[Map[String,String]] = List()
)

就像我说的,当我创建一个文档或更新一个文档时,它工作得很好,但是当我做一个查询时,我得到一个像这样的对象

List(Team(52165d582736bd8a7e67ce3a,,List(foo, bar, baz),List({ "id" : "52165d582736bd8a7e67ce39" , "name" : "testuser"})))

List({ "id" : "52165d582736bd8a7e67ce39" , "name" : "testuser"})是我无法弄清楚的部分。

我怎样才能让它反序列化为List(Map( "id" -> "52165d582736bd8a7e67ce39" , "name" -> "testuser"))

4

1 回答 1

1

正如我在 Salat 邮件列表上回复你的那样,Salat 目前不支持反序列化嵌套集合。

https://github.com/salat/salat/wiki/Collections

于 2013-08-22T20:24:08.083 回答