Issue
I'm doing an exercise with Springboot that basically consists of a simple application with a Rest Controller who has to store an object received from POST request to a mysql db using JPA/Hibernate. My problem is the following one:
the table has this structure:
href="https://i.stack.imgur.com/08rdw.png" rel="nofollow noreferrer">
And I have this pojo which has to map the table as an object:
If you pay attention, the table has a column named "CARD_HOLDER_FULL_NAME", but in the app, the card holder must be a separate object:
so, how do I specify that the fullName attribuite in the CaldHolderInfo class represents that column in the table?
I'm very rusty with Springboot/JPA/hibernate so I don't know how to proceed
Solution
You need to make CaldHolderInfo
an Embeddable.
See JPA @Embedded And @Embeddable
And please, no images of code on this site.
Answered By - Lesiak
Answer Checked By - Candace Johnson (JavaFixing Volunteer)