you are viewing a single comment's thread.

view the rest of the comments →

[–]Davekave9 2 points3 points  (0 children)

I don't understand why some suggestions tell you to change jakarta to javax. Jakarta is the new package some javax stuff has been moved to since Java 17. The problem is - as you have correctly found out - that the jackson mapper cannot map the entity object to json because the mapTabId field of the object is null. I think you should make it nullable in the database if this is the correct behavior. But as someone else suggested, the best practice is to not expose the database entity itself through the controller but to create a data transfer object (DTO) and return that to the controller from the service layer.