Skip to content
Advertisement

Spring Boot Mapstruct not woking mapping

My Dto model

JavaScript

My main model

JavaScript

My mapstruct class

JavaScript

Hi everyone my project using mapstruct but my dto class user_id not mapping user please help me Thanks

Advertisement

Answer

This should solve the problem:

JavaScript

Because you’re wanting to map user_id from CoverLetterDto to the User class in CoverLetter, you have to use dot notation to access the user_id field in the user object.

Please let me know if you have additional questions.

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