Closed GoogleCodeExporter closed 9 years ago
Did you register a converter for Double <-> BigDecimal ?
Original comment by elaat...@gmail.com
on 9 Jul 2012 at 1:21
Is it strictly necessary? Now see that this is required, but initially what
confused me - that I have to register such conversion even for built-in types.
Anyway, it would be greate to have such conversion options covered just out of
the box. So, this is not defect, but feature request probably :)
BTW, I'm starting to think that I had another problem there with double values
- but will take a more look and will report later.
Original comment by maxim.ku...@gmail.com
on 9 Jul 2012 at 1:24
There is no builtin converters (if not autoboxing) :( just to avoid unexpected
behavior
but we can start thinking about this feature request.
Original comment by elaat...@gmail.com
on 9 Jul 2012 at 1:41
In the new 1.2.0 branch, there is a (pending) capability to enable this
behavior via a common set of default converters, like so:
MapperFactory factory = new DefaultMapperFactory.Builder().useBuiltinConverters(true).build();
Also, the exception is improved for cases where it wasn't registered:
ma.glasnost.orika.MappingException: While attempting the folling mapping:
sourceType = BigDecimal
destinationType = Double
Error occurred: No converter registered for conversion from BigDecimal to Double, nor any ObjectFactory which can generate Double from BigDecimal
Note that this is still disabled by default, in order to avoid unexpected
changes in behavior.
Original comment by matt.deb...@gmail.com
on 9 Jul 2012 at 9:07
+1 for sensible conversion of numeric types. (Just hit the same issue).
Original comment by martyp...@mango-factory.com
on 22 Aug 2012 at 10:46
As mentioned in Matt comment this will be bundled in the 1.2.0,
Original comment by elaat...@gmail.com
on 22 Aug 2012 at 10:51
Fixed in 1.2.0 release.
Original comment by matt.deb...@gmail.com
on 8 Sep 2012 at 5:05
Original issue reported on code.google.com by
maxim.ku...@gmail.com
on 9 Jul 2012 at 12:54