As part of my spring boot application, I am auto-generating my DO classes using jooq. After getting this data from db as do object, I am trying to convert it to map using jackson library. But it is giving the error:
com.fasterxml.jackson.databind.JsonMappingException: No serializer found for class org.jooq.impl.DefaultBinding and no properties discovered to create BeanSerializer (to avoid exception, disable SerializationFeature.FAIL_ON_EMPTY_BEANS)
Can I get some help on this?
As of jOOQ version 3.10, you cannot simply serialise / deserialise jOOQ Record
types using Jackson without specifying your own custom bindings. Another option is to map the jOOQ Record
into your own POJO ("DO") object first, e.g. using:
Result<Record> result = ctx.select(...).from(...).fetch();
List<MyPojo> list = result.into(MyPojo.class);
And then you should be able to easily serialise that list instead.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With