Hi Tatu Thanks a lot for the quick response. After your response, I checked my getID() method. It was declared *static *because the ID field AtomicLong is declared as a static field. Taking the 'static' out of the method signature seems to fix the issue and I can now see the ID field in my output.
Since it is working for now, I will consider this issue closed and create a new one if it occurs again. Thanks again for your quick response and timely help. ~MV On Saturday, December 29, 2018 at 6:14:29 PM UTC-5, Tatu Saloranta wrote: > > On Sat, Dec 29, 2018 at 3:01 PM MV <[email protected] <javascript:>> > wrote: > > > > Hi There > > > > I have ID's in my POJO objects using AtomicLong for auto generation of > ID's in a thread safe environment. I use > ObjectMapper.writeWithPrettyWriter().writeValueAsString(pojo). > > I notice in the output that the fields marked as AtomicLong are not > written out. > > > > I apologize for the wrong methods in ObjectMapper that I have called out > here but the idea is that I am using the default pretty writer to write the > java object as a string. > > > > Is there any special handling required for these AtomicLong and > AtomicInteger data types? > > No, both are supported directly by jackson-databind with default > settings, not via extension modules. > > So I think a reproduction of the problem would be needed. > > -+ Tatu +- > > > > > Thanks > > MV > > > > > > -- > > You received this message because you are subscribed to the Google > Groups "jackson-user" group. > > To unsubscribe from this group and stop receiving emails from it, send > an email to [email protected] <javascript:>. > > To post to this group, send email to [email protected] > <javascript:>. > > For more options, visit https://groups.google.com/d/optout. > -- You received this message because you are subscribed to the Google Groups "jackson-user" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To post to this group, send email to [email protected]. For more options, visit https://groups.google.com/d/optout.
