-
It would be very beneficial to include the context of the mapping to the CustomConverter. Currently, the converter doesn't know anything about the two fields being converted: Object convert(Object existingDestinationFieldValue, Object sourceFieldValue, Class destinationClass, Class sourceClass);
If we could also pass Object sourceParent, Object destinationParent, or better yet, a...
2010-01-07 03:32:43 UTC by jblinick
-
I am getting an error using Hibernate with Javassist, where Dozer is storing the javassist proxy class in the dozer class. I have isolated the problem to ClassMapBuilder.createDefaultClassMap( (Configuration globalConfiguration, Class srcClass, Class destClass).
In this method, classMap.setDestClass( new DozerClass( destClass.getName(), destClass .... ) is called, where destClass is...
2010-01-07 03:19:30 UTC by jblinick
-
hi,
writing Java custom converters:
benefits:
* Compile time checks
* Refactoring support
* No Xml
drawbacks:
* need to map in both directions (if you are marshalling in one direction then it is not your case)
* you can not run recursive mappings (if you are mapping container with elements that could be mapped by default dozer means). This is going to be fixed in 5.2
* you should...
2010-01-06 22:02:09 UTC by buzdin
-
My opinion is probably biased towards the context in which I'm using dozer, but I wanted to put this out there to solicit any input/feedback.
I'm converting from DAO beans to XML marshalling beans. Both the DB and the XSD layers are in a bit of a state of flux. At first I thought that using XML mapping would be the fastest way to go, but I've found that writing a custom converter takes just...
2010-01-06 16:29:51 UTC by calebjones
-
The MapperAware interface sounds exactly like what I need, I'll wait for that.
For now, I ended up removing the DozerConverter superclass and injected the dozer Mapper into them. I then called my converters directly (rather than through dozer). However, this was also influenced by the fact that these classes also had generics (User and Device was just an illustration), and I kept running into...
2010-01-06 16:21:35 UTC by calebjones
-
Oh, bummer. Thanks for looking into this though. I created bug #2926936 in the tracker. Thanks.
2010-01-06 14:52:29 UTC by https://www.google.com/accounts
-
I am using a ConfigurableCustomConverter (on a field level), and am setting the custom-converter-param to a string value. However, when the setParameter() method of my ConfigurableCustomConverter instance is called, it receives a "null" string value, instead of the value I had set in my mapping.xml file. This was confirmed to be a bug in dozer; an example follows below.
2010-01-06 14:50:51 UTC by https://www.google.com/accounts
-
Sounds like a bug to me, unfortunately. The example you are providing is quite right.
Please make a bug ticket in project tracker with attached sample.
We will try to handle that as soon as possible as there is another custom-converter-param bug related to mappings using java.util.Map structure.
Dmitry.
2010-01-06 08:22:36 UTC by buzdin
-
If you need only DeviceConverter why not inject it alone without whole DozerBeanMapper. Just a thought... Or just instantiate it as a workaround.
If that is not helping, you may check trunk where we added MapperAware interface for converters. It will inject internal mapper into converter, which you may use for mapping of internal objects. The official release will be done until end of January.
2010-01-06 08:18:23 UTC by buzdin
-
Hello,
I am using a ConfigurableCustomConverter (on a field level), and am setting the custom-converter-param to a string value. However, when the setParameter() method of my ConfigurableCustomConverter instance is called, it receives a "null" string value, instead of the value I had set in my mapping.xml file. Any ideas? An example of my mapping.xml is below; your help is much appreciated!
2010-01-06 02:36:02 UTC by https://www.google.com/accounts