Hi,I have a problem trying to serialize/deserialize custom types wrapped in Option.The problemn is that `asDBObject` or `asObject` itself runs but doesn't seem to use my custom transformer.I'm currently using Scala 2.9.1 with the Salat 1.9.2-SNAPSHOT.And my custom types:```package examplecase class Foo(value: String)```And my serializing/deserializing code and results:```import example.{Foo, Doc1, Doc2}import com.novus.salat.{Context, grater}import com.mongodb.casbah.Imports._import com.novus.salat.transformers.CustomTransformerval fooTransformer = new CustomTransformer[Foo, String] {def deserialize(b: String): Foo = Foo(b)def serialize(a: Foo): String = a.value}implicit val context = new Context {val name: String = "foo"registerCustomTransformer(fooTransformer)}/** Not O.K. The custom transformer is NOT USED for `foo` */val doc2Grater = grater[Doc2]doc2Grater.asDBObject(Doc2(Some(Foo("value"))))//=> {"foo": {"value": "value"} }, but expected {"foo": "value"}doc2Grater.asObject(DBObject("foo" -> "value"))//=> Doc2(None), but expected Doc2(Some(Foo("value")))/** This is O.K. The custom transformer is used for `foo` */val doc1Grater = grater[Doc1]
doc1Grater.asDBObject(Doc1(Foo("value")))//=> {"foo": "value"} as it is expected.doc1Grater.asObject(DBObject("foo" -> "value"))//=> Doc1(Foo("value")) as expected```Am I missing something?Thanks,Yusuke
--Btw, I'm using Salat on my production systems and its working like a charm. Thanks :)--
You received this message because you are subscribed to the Google Groups "scala-salat" group.
To unsubscribe from this group and stop receiving emails from it, send an email to scala-salat...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.