hello,
Please consider this scenario
my models
I have a very simple repository and controller just to
test how the data is persisted
I would like to save a record like this using the /load endpoint
{
"id": 2,
"firstName": "Cris",
"lastName": "Star",
"middleName": "None",
"alias": "Cr",
"dateOfBirth": "2020-02-12",
"gender": "male",
"contactDetails": {
"emailAddress": "cris@javaranch.com"
}
}
What I get now is
[
{
"id": 2,
"firstName": null,
"lastName": null,
"middleName": null,
"alias": null,
"dateOfBirth": null,
"gender": null,
"contactDetails": {
"id": 8,
"emailAddress": "hello",
"mobileTelNo": null,
"homeTelNo": null,
"workTelNo": null,
"employee": null,
"new": false
},
"new": false
}
]
When I query the MySql data base I can see the record added in the customer_details table.
End goal:
1. save employee details and persist data in contact_details table
2. search by phone_number and list the details(either customer or employee) of the related phone number
3. search by employee_id or customer_id and get customer/employee + contact details back
How could i map my model to start with?
Could anyone help me with the queries, please?
properties