문제

I need to serialize scala.math.BigDecimalvalues using casbah automatic type conversions.

I've imported this

 import com.mongodb.casbah.commons.conversions.scala._

and call those methods within the class.

  RegisterJodaTimeConversionHelpers()
  DeregisterJodaLocalDateTimeConversionHelpers()

But it says, java.lang.IllegalArgumentException: can't serialize class scala.math.BigDecimal.

Isn't casbah support for Bigdecimal serialization or any other way that I can do this?

올바른 솔루션이 없습니다

다른 팁

You would have to write and register your own serializer. BigDecimal is not supported by bson - see the supported types.

The challenge is how to store the type so you can query against it effectively and how best to convert it back on deserialisation (without blanket converting of all types).

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top