Skip to content
Advertisement

How to map java.time.LocalDate field with Orika?

This occurs because LocalDate is not a JavaBean (it has no zero-arg constructor)

To fix this, you need to create a LocalDateConverter :

JavaScript

and then register it adding this line :

JavaScript

As a shorcut, you can instead register the provided “PassThroughConverter” as suggested by Adam Michalik so Orika doesn’t try to instanciate a new “LocalDate” :

JavaScript

Advertisement

Answer

This occurs because LocalDate is not a JavaBean (it has no zero-arg constructor)

To fix this, you need to create a LocalDateConverter :

JavaScript

and then register it adding this line :

JavaScript
User contributions licensed under: CC BY-SA
2 People found this is helpful
Advertisement