Closed GoogleCodeExporter closed 9 years ago
Please try the following (on the DefaultMapperFactoryBuilder):
new DefaultMapperFactory.Builder().useBuiltinConverters(true).build();
Original comment by matt.deb...@gmail.com
on 20 Sep 2012 at 8:47
Hi,
Thanks for the prompt suggestion. I tried the following. It wouldn't work
though. At the moment I'm creating CustomConverter to address this issue.
public com.company.abc.Person translate(
Person person) {
MapperFacade mapper = new MyCustomMapper();
return mapper.map(person,
com.company.abc.Person.class);
}
public class MyCustomMapper extends ConfigurableMapper {
@Override
public void configure(MapperFactory factory) {
// register class maps
factory.registerClassMap(factory
.classMap(
Person.class,
com.company.abc.Person.class)
.byDefault().toClassMap());
// register mappers
// register object factories
// register converters
}
@Override
public void configureFactoryBuilder(DefaultMapperFactory.Builder builder) {
// configure properties of the factory, if needed
builder.usedBuiltinConverters(true);
}
}
Regards,
Srimathi
Original comment by meetma...@gmail.com
on 24 Sep 2012 at 2:59
Sorry, now that I look into the details properly, I see that you're trying to
map XMLGregorianCalendar to itself.
There are basically 2 options for this:
(1) decide to treat XMLGregorianCalendar as an immutable type (we know it's not, technically) and use a PassThroughConverter
(2) use your own custom converter as mentioned
I can add a built-in converter for this to the existing ones...
Original comment by matt.deb...@gmail.com
on 5 Oct 2012 at 4:26
A fix for this has now been provided in the 1.3.1 trunk; a new type of
converter CloneableConverter has been added (which is parallel to
PassThroughConverter, but calls clone() on the types instead of passing them by
reference.
XMLGregorianCalendar, java.util.Date, and java.util.Calendar are all added to a
default instance of this Converter that is registered with BuiltinConverters by
default.
If you have the ability to test with the latest trunk, could you confirm this
resolves your issue?
Original comment by matt.deb...@gmail.com
on 5 Oct 2012 at 6:42
Fixed in 1.3.4 release.
Original comment by matt.deb...@gmail.com
on 19 Oct 2012 at 10:49
Original issue reported on code.google.com by
meetma...@gmail.com
on 20 Sep 2012 at 10:25