Hi Carl,

we had a simmilar problem in the project and basically use a builder for 
mapping (in this case JSON data) to an immutable class. We just pass the 
builder to the mapper instead of the actual bean and it"s get filled with 
the correct values. So theoretically it is possible. The tools just have to 
be aware and it's a lot of work to implement the builder. But this screams 
for a lombok solution which I am aiming to implement over the holdidays. An 
important thing to remember is that the builder should not use the nice 
guided construction since the order of the setters invoked by the mapper 
depends on the JSON.

You can find a somewhat working version of this 
here: 
https://github.com/shimberger/jackson-builder-module/blob/master/src/test/java/de/himberger/jackson/builder/BuilderModuleTestCase.java

I am thinking about implementing something similar for http://jdbi.org/ 
which I discovered recently. There you provide a class to "deserialize" the 
object from the SQL resultset.

Hope this helps a bit,
Sebastian

-- 
You received this message because you are subscribed to the Google Groups "The 
Java Posse" group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/javaposse/-/6YLiLGpamhsJ.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/javaposse?hl=en.

Reply via email to