Problems may occur if you allow the client to set fields of type LocalDate, LocalTime and LocalDateTime. In general it's not a good idea to use the same class to both represent data in your database and data received from the client. For instance, what if I POST your JSON example from Germany? First of all, why can the client POST commentId, createdAt and updatedAt at all? Those fields should be determined by the server, not the client
I have separate IN and OUT Dtos which uses mapping library MapStruct to map the IN and OUT fields. The createdAt and updatedAt are not sent by the client, those are set by the server. I removed all these details to avoid verbosity. I kept the bare minimum code.
You can find out which of the two does it by printing the value of comment.updatedAt before you save it in the repository and after you retrieve it from the repository
Yes I will check this out and post the results here.
Thanks for your time Stephan